1

I need to import many ant files(build.xml) for a build.gradle.kts. If I import only one build.xml working fine, but if a try a second build file this second file don't have all targets imported.

I tried rename all task during import using


ant.importBuild("../project1/build.xml") { antTaskName ->
    "ant-project1-$antTaskName"
}
ant.importBuild("../project2/build.xml") { antTaskName ->
    "ant-project2-$antTaskName"
}

All targets are renamed, but all target with the same name in project2 build.xml file not are imported.

I enable verbose mode and received this messages:

Already defined in main or a previous import, ignore clean

Already defined in main or a previous import, ignore deploy

Clean and Deploy are targets commons between project1 and project2.

I need to import all targets renaming with the project name suffix.

Community
  • 1
  • 1
jcebidanes
  • 41
  • 1
  • 9
  • Interesting, I tested this out locally and I'm getting the same thing. It could be a bug. However, I noticed in the documentation for running Ant from Gradle, the stated purpose of renaming Ant targets is to avoid naming collision with existing Gradle tasks, not Ant targets from other Ant build scripts. – CAustin Jun 25 '19 at 21:06
  • I'm using a "workaround". I created one build.gradle.kts inside each project and import one build.xml. After I imported all build.gradle.kts child to main project build.gradle.kts. That way working, but not is the good way a believe. – jcebidanes Jun 26 '19 at 18:06
  • I'm using a "workaround". I created one build.gradle.kts inside each project and import one build.xml. After I imported all build.gradle.kts child to main project build.gradle.kts. That way working, but not is the good way a believe. – jcebidanes Jun 26 '19 at 18:06

0 Answers0