ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Reilly <peter.kitt.rei...@gmail.com>
Subject Re: where to download the latest ant-contrib-1.0b3.jar
Date Fri, 16 Apr 2010 07:22:30 GMT
Yes, you sould use the antlib.xml and not the .properties resource.
The .properties one is meant for compatibility with ant 1.5.

Peter

On Fri, Apr 16, 2010 at 7:05 AM,  <Jan.Materne@rzf.fin-nrw.de> wrote:
> There are two ways of declaring new tasks:
> - with properties files
> - with antlib.xml files: since Ant 1.6
> With Ant 1.6 <macrodef> was introduced with the notion of @{localParameter}.
> <ac:for> is the <ac:foreach> equivalent but using the macro way.
>
> The difference between <ac:for> and <ac:foreach> is that the latter creates
a new project instance for each iteration which requires additional resources. So the prefered
way is using <ac:for>.
> But <ac:foreach> works with Ant before 1.6, so if you have that .... (i recommend
updating Ant to 1.8 ;)
>
>
> Jan
>
>> -----Ursprüngliche Nachricht-----
>> Von: David Weintraub [mailto:qazwart@gmail.com]
>> Gesendet: Freitag, 16. April 2010 05:32
>> An: Ant Users List
>> Betreff: Re: where to download the latest ant-contrib-1.0b3.jar
>>
>> On Thu, Apr 15, 2010 at 7:40 PM, Andy2008 <hoangtu69@yahoo.com> wrote:
>>
>> >
>> > I did download that zip file and as I mentioned in my post,
>> the issue is
>> > there's no for loop in the antcontrib.properties.
>>
>>
>> You're absolutely correct!
>>
>> I can't believe it. I never used the "for" task, so never
>> noticed it before.
>> There is certainly a class for it
>> (net.sf.antcontrib.logic.forTask), but
>> it's not there.
>>
>> I did manage to change taskdef to <taskdef
>> resource="net/sf/antcontrib/antlib.xml"/> and that worked. I
>> noticed the
>> antlib.xml file in there, and the "for" task is defined there.
>>
>> Here's my build file:
>>
>>     <taskdef resource="net/sf/antcontrib/antlib.xml">
>>         <classpath>
>>             <pathelement location="${basedir}/ant-contrib-1.0b3.jar"/>
>>         </classpath>
>>     </taskdef>
>>     <target name="foo">
>>         <echo message="The first five letters of the alphabet are:"/>
>>         <for list="a,b,c,d,e" param="letter">
>>             <sequential>
>>                 <echo>Letter @{letter}</echo>
>>             </sequential>
>>         </for>
>>     </target>
>> </project>
>>
>>
>> --
>> David Weintraub
>> qazwart@gmail.com
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

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


Mime
View raw message