Java Mailing List Archive

http://www.ant-tasks.com/

Apache Ant Archive

» Ant Users List
» Ant Developers List
Task help

Task help

2006-10-19       - By peter reilly
Reply:     1     2     3     4     5     6     7     8     9  

On 10/19/06, Jan.Materne@(protected) <Jan.Materne@(protected)> wrote:
> You can use external tasks in the way of Ant until 1.5 (which is and will
supported in the feature too):
> * place the jar in ${user.home}/.ant/lib, so Ant adds it to its classpath
> * declare the tasks:
>   - use <taskdef> for the mapping of taskname-classname
>     + for each task
>     + for a bundle of tasks using properties-file
>
> Since Ant 1.6 we have "Antlibs". Same here:
> * place the jar in ${user.home}/.ant/lib, so Ant adds it to its classpath
> * declare the tasks
>   - use <taskdef> for the mapping of taskname-classname
>     + for each task
>       <taskdef name="for" classname="net.sf.antcontrib.For"/>
>     + for a bundle of tasks using properties-file
>       <taskdef file="net/sf/antcontrib/default.properties"/>
>     + NEW: for a bundle of tasks using xml-file
>       <taskdef file="net/sf/antcontrib/antlib.xml"/>
>   - NEW: use of xml namespaces and "antlib:" protocol for a bundle of tasks
using the xml file (antlib.xml)
>     <project .... xmlns:ac="antlib:net.sf.antcontrib">
>         <ac:for>
>
>
> I'll put a note into the manual at "Using Ant :: (NEW) Use of external tasks"
>
>
> Jan
I am thinking of adding:

 <project xmlns:ac="antlib:net.sf.antcontrib">
    <typedef antlib="antlib:net.sf.antcontrib"
                  classpath="${PATH_TO_ANTCONTRIB.JAR}"/>

which would be equilivent to
 <typedef uri="antlib:net.sf.antcontrib"
               resource="net/sf/antcontrib/antlib.xml"
               classpath="${PATH_TO_ANTCONTRIB.JAR}"/>


Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)


©2008 ant-tasks.com - Jax Systems, LLC, U.S.A.