Slackbot
02/19/2024, 6:06 PMJavi
02/20/2024, 10:40 AMdata class to contain all properties and any behavior on it can be a method. I haven't checked the internal details, but I guess you are mapping everything into lazy values, so
@GExtension
data class MyFancyExtension(
val prop1: String,
val prop2: GFile, // or `GInputFile` ?
@Assisted val randomThing: RandomThing,
) {
fun foo() {
// do something with props
}
}
// generated, automatically add `ProjectLayout`, `ObjectFactory`,
// and any `@Assisted` value.
open class MyFancyExtension @Inject constructor(...) {
val prop1: Property<String> = ...
val prop2: FileProperty = ...
fun foo() {
// do something with props
}
}Martin
02/20/2024, 10:41 AMMartin
02/20/2024, 10:42 AMJavi
02/20/2024, 10:43 AMJavi
02/20/2024, 10:45 AM@GExtension class in my sample aboveMartin
02/20/2024, 10:45 AMMartin
02/20/2024, 10:46 AMMartin
02/20/2024, 10:47 AMMartin
02/20/2024, 10:48 AMMartin
02/20/2024, 10:48 AMJavi
02/20/2024, 10:49 AMMartin
02/20/2024, 10:50 AMMartin
02/20/2024, 10:50 AMMartin
02/20/2024, 10:52 AMJavi
02/20/2024, 10:56 AMMartin
02/20/2024, 10:58 AMMartin
02/20/2024, 10:59 AMgratatouille-core (for the @GExtension annotation)Martin
02/20/2024, 10:59 AMJavi
02/20/2024, 11:06 AMJavi
02/20/2024, 11:07 AM@GExtension
data class RootFancyExtension(val nestedFancy: NestedFancyExtension, ...)
@GExtension
data class NestedFancyExtension(...)
should be consumed on the user side:
rootFancy {
// ...
nestedFancy {
// ...
}
}Tapchicoma
02/20/2024, 5:46 PMMartin
02/20/2024, 5:48 PMMartin
02/20/2024, 5:48 PMMartin
02/20/2024, 5:52 PM