-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
The extensions are isolated so they can be seen as a data class to contain all properties and any behavior on it can be a method.
Any knowledge about lazy APIs and Gradle internal could be ignored and just use Kotlin basic types, under the hood they will be mapped to lazy APIs.
An example could be:
@GExtension
data class MyFancyExtension(
val prop1: String,
val prop2: GFile, // or `GInputFile` ?
@GAssisted val randomThing: RandomThing,
) {
fun foo() {
// do something with props
}
}// generated, automatically add `ProjectLayout`, `ObjectFactory`,
// and any `@GAssisted` value.
open class MyFancyExtension @Inject constructor(...) {
val prop1: Property<String> = ...
val prop2: FileProperty = ...
fun foo() {
// do something with props
}
}The annotation @GAssisted would help to enable doing anything in complex use cases.
Nested extensions should be supported automatically:
@GExtension
data class RootFancyExtension(val nestedFancy: NestedFancyExtension, ...)
@GExtension
data class NestedFancyExtension(...)should be consumed on the user side:
rootFancy {
// ...
nestedFancy {
// ...
}
}The annotation @GExtension could support specifying a name: String? = null. If it is not indicated, the name should be extracted from the class name by decapitalizing and removing the suffix Extension from it.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels