Kelvin Chung
03/15/2024, 4:50 PMabstract class MyTask : DefaultTask() {
init {
val task = project.tasks.register("myTask-$name-derived") {
}
finalizedBy(task)
}
}
What would be a sane redesign so that you don't have this?Eric Haag
03/15/2024, 4:53 PMKelvin Chung
03/15/2024, 4:55 PMMyTask that is registered necessitates a related derived task.Eric Haag
03/15/2024, 5:00 PMMyTask is registered?Kelvin Chung
03/15/2024, 5:01 PMMyTask, so there are some weird "input to input" and "output to output" wirings in place.Kelvin Chung
03/15/2024, 5:01 PMEric Haag
03/15/2024, 5:09 PMNamedDomainObjectContainer property that, when something is registered, will create the two tasks and wire the inputs / outputs appropriately.
You should find this section of the docs helpful: https://docs.gradle.org/current/userguide/custom_gradle_types.html#nameddomainobjectcontainer