ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Weintraub <qazw...@gmail.com>
Subject Re: where to download the latest ant-contrib-1.0b3.jar
Date Fri, 16 Apr 2010 03:31:53 GMT
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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message