ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Weintraub <>
Subject Re: Automating without foreach?
Date Wed, 05 May 2010 00:01:00 GMT
There is a foreach task in the Ant Contrib tasks:

We recently discussed that the <for> task is not defined in the
properties file, but was defined in the antlib.xml file (if I remember
correctly). However, the <foreach> task is defined in the properties
file, but not the antlib.xml file.

Try the <foreach> task first and see if that'll work for you.

To see how to use the Ant Contrib jar file:

To download, try this link:

You could put the ant-contrib.jar file inside your $ANT_HOME/lib
directory, but that'll require everyone to have that installed. Better
put this in your project, so when someone checks out the repository,
they'll have that file. Let's say you put this in a directory called
$PROJ_HOME/antlib. You need to put this in your build.xml

    <taskdef resource="net/sf/antcontrib/">
            <fileset dir="${basedir}/lib/antlib">
                <include name="*.jar"/>

On Tue, May 4, 2010 at 1:45 PM, Misha Koshelev <> wrote:
> Dear All:
> I was wondering if there might be a simple, ant-specific way to automate tasks like this:
> <target name="jar-all" depends="pre-dist-all,compile">
>  <antcall target="jar">
>    <param name="platform" value="gtk-linux-x86_64"/>
>  </antcall>
>  <antcall target="jar">
>    <param name="platform" value="win32-win32-x86"/>
>  </antcall>
> </target>
> Specifically, I'd like to have  a list of platforms, and be able to repeat a task for
each platform like above.
> Any help much appreciated!
> Thank you
> Misha
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

David Weintraub

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

View raw message