tags:

views:

47

answers:

1

How to replace tree calls to "myMacro":

<myMacro value="value 1"/>
<myMacro value="value 2"/>
<myMacro value="value 3"/>

By only one call who would use a list of three elements: value 1, value 2, value 3

+1  A: 

You could make use of the For task from the 3rd party Ant-Contribs tasks. It makes use of the Ant MacroDef task, so combining this with your earlier question you could replace your macro and three macro calls with:

<for list="1,2,3" param="value">
    <sequential>
        <exec executable="cmd">
            <arg value="/c"/>
            <arg value="value @{value}"/>
        </exec>
    </sequential>
</for>
Simon Lieschke
nothing to add, thanks a lot.
TaintedLove