Gradle Version: 2.14.1
Operating System: Windows 7 (64bit)
We are porting a large ant based build system into gradle and are using ‘ant.importBuild build.xml’, as the first step, to import all ant targets as gradle tasks as is. We found a couple of issues though, one of which has been captured into a minimal code snippet and presented here.
<?xml version="1.0" encoding="utf-8"?> <project name="Test" default="build" > <target name="build" depends="init, a, c"/> <target name="init"/> <target name="a"/> <target name="b" /> <target name="c" depends="b"/> <target name="x" depends="b,a"/> </project>
run gradle build produces following output:
:b :init :a :c :build
which is different from the expected result generated by ant build:
init: a: b: c: build:
The ant reference document(https://ant.apache.org/manual/targets.html) says that 'Ant tries to execute the targets in the depends attribute in the order they appear (from left to right). ’ And we don’t see that this basic rule is respected in this particular case.
- If we remove the “x” target from build.xml, the output matches the expected output.
*If we rename the ‘init’ task to ‘Init’, the output matches the expected output.