I'd like to define a list of variables in ant build file in order to use for loop with this list in my tasks. How can I do that?
p.s.: It should be something like the following:
<varlist name="mylist"> <!-- Actually, there is no such tag in Ant -->
<item>someThing</item>
<item>anotherThing</item>
</varlist>
...
<for param="item" list="${mylist}">
<sequential>
<echo>@{item}</echo>
</sequential>
</for>
Not sure if this is what you meant:
Ant Addon Flaka has a very flexible for task. You may use your own property foobar=item1,item2,.. or any existing csv like property, f.e. some property provided by ant path/fileset/dirset like ${ant.refid:whatever} or ${toString:whatever} or the result of an EL function provided by Flaka like split() or list() .. or another list of objects/items to iterate over, see Flaka manual, Flaka examples for more details and examples.