Kelvin Chung
07/24/2024, 7:53 PMfun AntBuilder.taskdef(name: String, classname: String, classpath: Configuration) = withGroovyBuilder {
"taskdef"("name" to name, "classname" to classname, "classpath" to classpath.asPath)
}
class MyPlugin : Plugin<Project> {
override fun apply(project: Project) {
val configuration = ...
project.ant.taskdef("someTask", "someClass", configuration)
}
}
Now, suppose I have a task that does this:
abstract class MyTask : DefaultTask() {
@TaskAction
fun run() {
ant.withGroovyBuilder {
// something with "someTask"
}
}
}
Would that be well-formed, or do I need to apply the taskdef in MyTask - ie. introduce a @Classpath property?Vampire
07/24/2024, 7:59 PMKelvin Chung
07/24/2024, 8:02 PMproject.ant and task.ant is shared in some way.Vampire
07/24/2024, 8:07 PMtask.ant you will see that it calls project.ant, so ...ephemient
07/24/2024, 8:13 PMKelvin Chung
07/24/2024, 8:15 PMVampire
07/24/2024, 8:27 PM