Kelvin Chung
05/14/2024, 4:11 PMAntBuilder passed around in Gradle? Suppose I have this:
fun AntBuilder.taskdef(name: String, classname: String, classpath: Configuration) = withGroovyBuilder { ... }
class MyPlugin : Plugin<Project> {
override fun apply(project: Project) {
project.ant.taskdef("myTask", ...)
}
}
Does that mean that a task defined as so:
abstract task MyGradleTask : DefaultTask() {
@TaskAction
fun run() {
ant.withGroovyBuilder {
"myTask"(...)
}
}
}
will only make sense if MyPlugin is applied? Conversely, if the taskdef() was inside MyGradleTask, and you have a MyOtherGradleTask that has its own taskdef(), will they conflict?