ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Ellsworth <>
Subject Iterating a list?
Date Tue, 30 Oct 2001 00:05:19 GMT
I have a list of build files I need executed in a certain order, and in 
certain directories.  I would like to get this down to just a couple of 
separated lists of project names.  I can do this if I can iterate through a 
list in order, but I do not know how to do that.

Assume I have a list of ant build files I want run:




I can set up:

   <property name="orgtargets" value="foo,bar"/>
   <property name="orgbuilddir" value="org/mine/build"/>
   <property name="comtargets" value="hi,mom"/>
   <property name="combuilddir" value="com/employers/stuff/build"/>

My build targets could be:

   <target name="build-debug">
     <property name="builddirectory" value="${orgbuilddir}"/>
     <for each org target>
       <property name="buildproject" value="orgtarget[i]" >
       <ant dir="${builddirectory}/{buildproject}" target="${buildcommand}"/>
     <end for>
     <property name="builddirectory" value="${combuilddir}"/>
     <for each com target>
       <property name="buildproject" value="comtarget[i]" >
       <ant dir="${builddirectory}/{buildproject}" target="${buildcommand}"/>
     <end for>

This then would do

<ant dir="/org/mine/build/foo"/>
<ant dir="/org/mine/build/bar"/>
<ant dir="com/employers/stuff/build/hi"/>
<ant dir="com/employers/stuff/build/mom"/>

Is there any way to do this?

Scott Ellsworth

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message