ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Weintraub <qazw...@gmail.com>
Subject Re: Automating without foreach?
Date Wed, 05 May 2010 00:01:00 GMT
There is a foreach task in the Ant Contrib tasks:
<http://ant-contrib.sourceforge.net/ant-contrib/manual/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: http://ant-contrib.sourceforge.net/

To download, try this link:
http://sourceforge.net/projects/ant-contrib/files/ant-contrib/1.0b3/ant-contrib-1.0b3-bin.zip/download

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/antcontrib.properties">
        <classpath>
            <fileset dir="${basedir}/lib/antlib">
                <include name="*.jar"/>
            </fileset>
        </classpath>
    </taskdef>


On Tue, May 4, 2010 at 1:45 PM, Misha Koshelev <misha680@gmail.com> 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: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>



-- 
David Weintraub
qazwart@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message