Ant-contrib <for> task

View: New views
4 Messages — Rating Filter:   Alert me  

Ant-contrib <for> task

by Slickscorp :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I am using ant 1.6.5 and am an ant beginner.

I found the ant-contrib tasks which have been very helpful in writing my
ant script.  Now I decide to make use of the <for> task and I get the
traditional error we've all seen before.

BUILD FAILED
<path>/build.xml:902: Could not create task or type of type: for.

Simplified code is below, and the failure occurs on the <for> task only.
Other ant-contrib tasks like <propertyselector, sortlist> shown below,
have no problem, so its not that the jar file can't be located. I also
tried cutting and pasting the first example of the <for> task from the
documentation, but this has the same problem.

<?xml version = '1.0' encoding = 'ISO-8859-1' ?>
<project name="MY_PROJECT" default="post-install-notes" basedir="." >

    <taskdef resource="net/sf/antcontrib/antcontrib.properties"/>

    <property name="post-install-notes-1" value="Hello" />
    <property name="post-install-notes-2" value="World" />

    <target name="post-install-notes" >
        <echo message="POST INSTALL NOTES" />

        <propertyselector property="install-notes"
match="post-install-notes.*" />
        <sortlist property="install-notes-sorted"
value="${install-notes}" />

        <for list="${install-notes-sorted}" param="property-name" >
            <sequential>
                <echo message="@{property-name}" />
            </sequential>
        </for>
    </target>
</project>


Any help would be appreciated.
 
--
 
This message and any attachments are confidential, proprietary, and may be privileged.  If this message was misdirected, Barclays Global Investors (BGI) does not waive any confidentiality or privilege.  If you are not the intended recipient, please notify us immediately and destroy the message without disclosing its contents to anyone.  Any distribution, use or copying of this e-mail or the information it contains by other than an intended recipient is unauthorized.  The views and opinions expressed in this e-mail message are the author's own and may not reflect the views and opinions of BGI, unless the author is authorized by BGI to express such views or opinions on its behalf.  All email sent to or from this address is subject to electronic storage and review by BGI.  Although BGI operates anti-virus programs, it does not accept responsibility for any damage whatsoever caused by viruses being passed.
 
--
 
Barclays Global Investors Limited is authorized and regulated by The Financial Services Authority. Registered in England. Registered No:796793. Registered Office: 1 Churchill Place, London E14 5HP.

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Ant-contrib-developers mailing list
Ant-contrib-developers@...
https://lists.sourceforge.net/lists/listinfo/ant-contrib-developers

Re: Ant-contrib <for> task

by fabien29200 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi !

I just faced the same problem with ant-contrib 1.02b.
The answer is simple, if you open net/sf/antcontrib/antcontrib.properties file, you'll see that at the end :

# Tasks Requiring Ant 1.6 or higher
#for=net.sf.antcontrib.logic.For
math=net.sf.antcontrib.math.MathTask

As you can see, the FOR task is simply commented ... (I don't know why).
Just uncomment the line, update the jar and you're done !

Slickscorp wrote:
Hi,

I am using ant 1.6.5 and am an ant beginner.

I found the ant-contrib tasks which have been very helpful in writing my
ant script.  Now I decide to make use of the <for> task and I get the
traditional error we've all seen before.

BUILD FAILED
<path>/build.xml:902: Could not create task or type of type: for.

Simplified code is below, and the failure occurs on the <for> task only.
Other ant-contrib tasks like <propertyselector, sortlist> shown below,
have no problem, so its not that the jar file can't be located. I also
tried cutting and pasting the first example of the <for> task from the
documentation, but this has the same problem.

<?xml version = '1.0' encoding = 'ISO-8859-1' ?>
<project name="MY_PROJECT" default="post-install-notes" basedir="." >

    <taskdef resource="net/sf/antcontrib/antcontrib.properties"/>

    <property name="post-install-notes-1" value="Hello" />
    <property name="post-install-notes-2" value="World" />

    <target name="post-install-notes" >
        <echo message="POST INSTALL NOTES" />

        <propertyselector property="install-notes"
match="post-install-notes.*" />
        <sortlist property="install-notes-sorted"
value="${install-notes}" />

        <for list="${install-notes-sorted}" param="property-name" >
            <sequential>
                <echo message="@{property-name}" />
            </sequential>
        </for>
    </target>
</project>


Any help would be appreciated.
 
--
 
This message and any attachments are confidential, proprietary, and may be privileged.  If this message was misdirected, Barclays Global Investors (BGI) does not waive any confidentiality or privilege.  If you are not the intended recipient, please notify us immediately and destroy the message without disclosing its contents to anyone.  Any distribution, use or copying of this e-mail or the information it contains by other than an intended recipient is unauthorized.  The views and opinions expressed in this e-mail message are the author's own and may not reflect the views and opinions of BGI, unless the author is authorized by BGI to express such views or opinions on its behalf.  All email sent to or from this address is subject to electronic storage and review by BGI.  Although BGI operates anti-virus programs, it does not accept responsibility for any damage whatsoever caused by viruses being passed.
 
--
 
Barclays Global Investors Limited is authorized and regulated by The Financial Services Authority. Registered in England. Registered No:796793. Registered Office: 1 Churchill Place, London E14 5HP.

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Ant-contrib-developers mailing list
Ant-contrib-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ant-contrib-developers

Re: Ant-contrib <for> task

by leeand00 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Where did you even get version ant-contrib 1.02b?  I don't see it on sourceforge.


Hi !

I just faced the same problem with ant-contrib 1.02b.
The answer is simple, if you open net/sf/antcontrib/antcontrib.properties file, you'll see that at the end :

# Tasks Requiring Ant 1.6 or higher
#for=net.sf.antcontrib.logic.For
math=net.sf.antcontrib.math.MathTask

As you can see, the FOR task is simply commented ... (I don't know why).
Just uncomment the line, update the jar and you're done !

Slickscorp wrote:
Hi,

I am using ant 1.6.5 and am an ant beginner.

I found the ant-contrib tasks which have been very helpful in writing my
ant script.  Now I decide to make use of the <for> task and I get the
traditional error we've all seen before.

BUILD FAILED
<path>/build.xml:902: Could not create task or type of type: for.

Simplified code is below, and the failure occurs on the <for> task only.
Other ant-contrib tasks like <propertyselector, sortlist> shown below,
have no problem, so its not that the jar file can't be located. I also
tried cutting and pasting the first example of the <for> task from the
documentation, but this has the same problem.

<?xml version = '1.0' encoding = 'ISO-8859-1' ?>
<project name="MY_PROJECT" default="post-install-notes" basedir="." >

    <taskdef resource="net/sf/antcontrib/antcontrib.properties"/>

    <property name="post-install-notes-1" value="Hello" />
    <property name="post-install-notes-2" value="World" />

    <target name="post-install-notes" >
        <echo message="POST INSTALL NOTES" />

        <propertyselector property="install-notes"
match="post-install-notes.*" />
        <sortlist property="install-notes-sorted"
value="${install-notes}" />

        <for list="${install-notes-sorted}" param="property-name" >
            <sequential>
                <echo message="@{property-name}" />
            </sequential>
        </for>
    </target>
</project>


Any help would be appreciated.
 
--
 
This message and any attachments are confidential, proprietary, and may be privileged.  If this message was misdirected, Barclays Global Investors (BGI) does not waive any confidentiality or privilege.  If you are not the intended recipient, please notify us immediately and destroy the message without disclosing its contents to anyone.  Any distribution, use or copying of this e-mail or the information it contains by other than an intended recipient is unauthorized.  The views and opinions expressed in this e-mail message are the author's own and may not reflect the views and opinions of BGI, unless the author is authorized by BGI to express such views or opinions on its behalf.  All email sent to or from this address is subject to electronic storage and review by BGI.  Although BGI operates anti-virus programs, it does not accept responsibility for any damage whatsoever caused by viruses being passed.
 
--
 
Barclays Global Investors Limited is authorized and regulated by The Financial Services Authority. Registered in England. Registered No:796793. Registered Office: 1 Churchill Place, London E14 5HP.

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Ant-contrib-developers mailing list
Ant-contrib-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ant-contrib-developers

Thank you,
   Andrew J. Leer - My Blog

Re: Ant-contrib <for> task

by fabien29200 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I mispelled the name of the jar, the version was the 1.0b2.


Where did you even get version ant-contrib 1.02b?  I don't see it on sourceforge.

fabien29200 wrote:
Hi !

I just faced the same problem with ant-contrib 1.02b.
The answer is simple, if you open net/sf/antcontrib/antcontrib.properties file, you'll see that at the end :

# Tasks Requiring Ant 1.6 or higher
#for=net.sf.antcontrib.logic.For
math=net.sf.antcontrib.math.MathTask

As you can see, the FOR task is simply commented ... (I don't know why).
Just uncomment the line, update the jar and you're done !

Slickscorp wrote:
Hi,

I am using ant 1.6.5 and am an ant beginner.

I found the ant-contrib tasks which have been very helpful in writing my
ant script.  Now I decide to make use of the <for> task and I get the
traditional error we've all seen before.

BUILD FAILED
<path>/build.xml:902: Could not create task or type of type: for.

Simplified code is below, and the failure occurs on the <for> task only.
Other ant-contrib tasks like <propertyselector, sortlist> shown below,
have no problem, so its not that the jar file can't be located. I also
tried cutting and pasting the first example of the <for> task from the
documentation, but this has the same problem.

<?xml version = '1.0' encoding = 'ISO-8859-1' ?>
<project name="MY_PROJECT" default="post-install-notes" basedir="." >

    <taskdef resource="net/sf/antcontrib/antcontrib.properties"/>

    <property name="post-install-notes-1" value="Hello" />
    <property name="post-install-notes-2" value="World" />

    <target name="post-install-notes" >
        <echo message="POST INSTALL NOTES" />

        <propertyselector property="install-notes"
match="post-install-notes.*" />
        <sortlist property="install-notes-sorted"
value="${install-notes}" />

        <for list="${install-notes-sorted}" param="property-name" >
            <sequential>
                <echo message="@{property-name}" />
            </sequential>
        </for>
    </target>
</project>


Any help would be appreciated.
 
--
 
This message and any attachments are confidential, proprietary, and may be privileged.  If this message was misdirected, Barclays Global Investors (BGI) does not waive any confidentiality or privilege.  If you are not the intended recipient, please notify us immediately and destroy the message without disclosing its contents to anyone.  Any distribution, use or copying of this e-mail or the information it contains by other than an intended recipient is unauthorized.  The views and opinions expressed in this e-mail message are the author's own and may not reflect the views and opinions of BGI, unless the author is authorized by BGI to express such views or opinions on its behalf.  All email sent to or from this address is subject to electronic storage and review by BGI.  Although BGI operates anti-virus programs, it does not accept responsibility for any damage whatsoever caused by viruses being passed.
 
--
 
Barclays Global Investors Limited is authorized and regulated by The Financial Services Authority. Registered in England. Registered No:796793. Registered Office: 1 Churchill Place, London E14 5HP.

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Ant-contrib-developers mailing list
Ant-contrib-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ant-contrib-developers