Java Mailing List Archive

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

Home » Ant Users List »

AW: Ant tasks

Jan Materne

2008-05-27

Replies: Find Java Web Hosting

Author LoginPost Reply
Usually you use the built-in tasks as <echo> <copy> <javac> etc.
The mapping from these tasknames to their implementing classes is done inside of Ant
 echo=org.apache.tools.ant.taskdefs.EchoTask
 ...

If you need additional functionality you can use <macrodef> and others for scripting
them.
 <macrodef name="mytask"> ... </macrodef>
 <mytask/>

Another approach is using external libraries. Using -lib option you extend Ants own
classpath. The 2nd step is extending the taskname=classname mapping. One possibility
is using <taskdef>
 <taskdef name="mytask" classname="com.acme.MyTask"/>
 <taskdef name="other" classname="com.acme.MyOtherTask"/>
 <mytask/>
 <other/>
Having these mapping in a properties file (as Ant does) you can also do a
 <taskdef file="anttasks.properties"/>
 <mytask/>
 <other/>
Since Ant 1.6 you can also have "AntLibs". They provide an antlib.xml which contains
that mapping (and maybe more). AntLibs could be loaded using antlib: protocoll handler and
XML namespaces
 <my:mytask xmlns:my="antlib:com.acme"/>
 --> having a com/acme/antlib.xml on classpath


Which tasks you really needs depends only on your personal requirements.



Jan


> -----Ursprüngliche Nachricht-----
> Von: Irfan.Sayed@(protected)]
> Gesendet: Dienstag, 27. Mai 2008 11:49
> An: user@(protected)
> Betreff: Ant tasks
>
> Hi All,
>
>
>
> How to decide what are the different task definitions are required for
> specific project and what classnames are required to implement these
> tasks.
>
>
>
> For example : <taskdef name="myjavadoc"
> classname="com.mydomain.JavadocTask"/>
>
>
>
> I really don't understand the meaning of above example.
>
>
>
> Please help
>
>
>
> Regards
>
> Irfan.
>
>
>
>

---------------------------------------------------------------------
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.