Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#235 "for" task not listed in antcontrib.properties

open
nobody
platform (5)
5
2009-08-16
2009-08-16
Alan
No

Is there some reason why the "for" task is not listed in antcontrib.properties?

Discussion

  • I cannot answer why it isn't in the antcontrib.properties, but it is in the antlib.xml. You could use that instead. It is what I ended up doing.

     
  • Mario Frasca
    Mario Frasca
    2009-09-21

    well, it actually *is* listed in antcontrib.properties, but on a comment line.

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

    you might want to alter the jar...
    or include all of the task definitions in your own resource file: if you already have one it's hardly any extra work.

    and, about your question, I'm also asking!

     
  • I modified the jar. Adding:

    for=net.sf.antcontrib.logic.ForTask

    to the Logic tasks section did the trick.

     

  • Anonymous
    2010-07-20

    Since 1.0b3 is still the "current" version, I would really urge those involved to put a note about using the xml file on the home page (http://ant-contrib.sourceforge.net/) or the download page. I have just spent most of a day tracking this down. The warning "Could not load definitions from resource org/apache/tools/ant/antlib.xml." is very misleading.

    You do a great job with this project. It would be great to help users to make it work more easily.

     
  • Ian
    Ian
    2011-01-19

    I used the following work around....

    <echo message="for requires ant version greater than or equal to ant 1.6.0." />
    <antversion property="antversion" />
    <echo message="You are running antversion = ${antversion}" />
    <echo>
    ************ Ant Contrib ************
    antcontrib.dir = ${antcontrib.dir}
    antcontrib.jar.filename = ${antcontrib.jar.filename}
    antcontrib.jar.filename location="${antcontrib.dir}/${antcontrib.jar.filename}"
    ************ ************
    </echo>

    <taskdef resource="net/sf/antcontrib/antcontrib.properties">
    <classpath>
    <pathelement location="${antcontrib.dir}/${antcontrib.jar.filename}" />
    </classpath>
    </taskdef>
    <taskdef name="for" classname="net.sf.antcontrib.logic.ForTask">
    <classpath>
    <pathelement location="${antcontrib.dir}/${antcontrib.jar.filename}" />
    </classpath>
    </taskdef>
    <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>