Anderson Mesquita
03/24/2025, 8:15 PMant tasks that are available in $ANT_HOME. I'm importing build.xml via ant.importBuild("build.xml"). However, none of the custom ant tasks are available and the build fails because they're not defined. I've read "Using custom Ant tasks", but it sounds like that only applies if I want to run the ant tasks directly from gradle, but I really just want them available in ant so that the import succeeds. Would anyone have any pointers?Vampire
03/24/2025, 9:16 PMANT_HOME is irrelevant, as Gradle ships its own Ant built-in. I don't know whether you can add it similarly though, never tried. The importBuild is in my eyes more a crutch or very short term work-around. 🤷‍♂️Sergej Koščejev
03/25/2025, 8:44 AMval antConfig = configurations.create("ant")
dependencies {
antConfig("org.apache.ant:ant-launcher:1.10.15")
antConfig("whatever:extra-libs:you-need")
}
tasks.register("runAnt", JavaExec::class) {
classpath = antConfig
args("-buildfile", "myfile", "-Dmyprop=myvalue")
mainClass = "org.apache.tools.ant.launch.Launcher"
}
(you could also use something like
antConfig(fileTree(System.getenv("ANT_HOME")) { include("lib/**") })
for Ant classpath instead but that makes it more system-dependent)