Skip to content

Improve compatibility with Gradle Provider API #47

@aSemy

Description

@aSemy

Currently the properties that Knit considers are not compatible with Gradle lazy configuration

var siteRoot: String? = globalDefaults.siteRoot
var moduleRoots: List<String> = globalDefaults.moduleRoots
var moduleMarkers: List<String> = globalDefaults.moduleMarkers
var moduleDocs: String = globalDefaults.moduleDocs
var files: FileCollection? = null
var rootDir: File? = null
var dokkaMultiModuleRoot: String = globalDefaults.dokkaMultiModuleRoot
var defaultLineSeparator: String? = null

This is a particular problem with the Knit files. I would like to be able to share the Markdown files using Gradle best practices, but because the Knit files use FileCollection, not a ConfigurableFileCollection, the files must be evaluated instantly, not on-demand.

Here is an example of how the properties could be made compatible with the Gradle Provider API

abstract class KnitPluginExtension {
    abstract val knitVersion: Property<String>
    abstract val siteRoot: Property<String>
    abstract val moduleRoots: ListProperty<String>
    abstract val moduleMarkers: ListProperty<String>
    abstract val moduleDocs: Property<String>
    abstract val files: ConfigurableFileCollection
    abstract val rootDir: RegularFileProperty
    abstract val dokkaMultiModuleRoot: Property<String>
    abstract val defaultLineSeparator: Property<String>
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions