I want to simplify this:
<target name="build">
<parallel>
<antcall target="build-A" />
<antcall target="build-B" />
<antcall target="build-C" />
</parallel>
</target>
<target name="build-A">
<exec executable="tool.exe" dir="projects/A">
<arg value="input.xml" />
</exec>
</target>
where build-B and build-C do the exact same thing (only in dirs B and C, respectively), into something akin to this:
<dirset id="projects" dir="." >
<include name="projects/*" />
</dirset>
<apply executable="tool.exe" parallel="true">
<arg value="input.xml" />
<dirset refid="projects" />
</apply>
This doesn’t work because apply will do one of the following:
If parallel is set to true,
tool.exe input.xml projects/A projects/B projects/C
or if parallel is set to false,
tool.exe projects/A/input.xml
...waits for tool.exe to complete...
tool.exe projects/B/input.xml
...etc
And even that is incorrect because tool.exe expects to be run within the projects/A directory.
Is there a way to parallelize this such that the output I get is equivalent to:
cd project/A
tool.exe input.xml
cd ../B
tool.exe input.xml
cd ../C
tool.exe input.xml
but in parallel?
I’d use ant-contrib‘s for task to do this.