I have some files:
dir/foo.txt
dir/bar.txt
dir/foobar.txt
In an Ant apply
task, I want to pass the list of files as arguments:
<target name="atask">
<apply executable="${cmd}" parallel="false" verbose="true">
<arg value="-in"/>
<srcfile/>
<arg value="dir/foo.txt"/>
<arg value="dir/bar.txt"/>
<arg value="dir/foobar.txt"/>
<fileset dir="${list.dir}" includes="*.list"/>
</apply>
</target>
This works fine, but what if I want to pick the list of files dynamically, using a fileset:
<fileset dir="dir" includes="*.txt"/>
How can I convert this fileset to arg
elements - one per file? Something like:
<arg>
<fileset dir="dir" includes="*.txt"/>
</arg>
instead of
<arg value="dir/foo.txt"/>
<arg value="dir/bar.txt"/>
<arg value="dir/foobar.txt"/>
(This example doesn't work because arg doesn't support fileset)