Ant gradle's task dependsOn ant target problem


(Tali Kolker) #1

Hi all,

Here is my code println “this will always runs first” task buildMoped << {

ant.importBuild(‘build.xml’)

println “Done importing”

}

task testGradle(dependsOn: ‘init’ ) << {

if i do gradle tasks -all I see init listed as an other task but when I call testGradle it fails telling me that it can’t resolve dependencies of testGradle. What is wrong?


(René Groeschke) #2

the ant.importBuild statement must be called during configuration phase to work as expected and not during execution phase as in your example.

cheers, rene