ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alejandro Abdelnur <alejandro.abdel...@sun.com>
Subject [PATCH] ant1.4B2 - antcall task, added support for looping
Date Sun, 02 Sep 2001 02:29:18 GMT

i've modified the the org.apache.tools.ant.CallTarget class to support iterations.

it allows to execute the antcall task in a looping way. the iterate
attribute contains the list (space separated) to iterate through, the
iterator attribute defines the name of the property that will contain
the element of the current iteration (the looping variable). for example:

    <target name="buildModule" if="module">
        <echo message="building module ${module}"/>
        ...
    </target>

    <target name="build">
        <property name="modules" value="frontend backend reporting"/>

        <antcall target="buildModule"
              iterate="${modules}" iterator="module" />
    </target>

the antcall task will invoke the buildModule target 3 times, each time
the value of the iterator variable -module- will be set to "frontend",
"backend" and "reporting".


attached you'll find the modified CallTarget.java file.

regards.

a

Mime
View raw message