ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Irfan.Sa...@t-systems.com>
Subject RE: Ant tasks
Date Tue, 27 May 2008 10:09:28 GMT
Thanks jan.

>From where I can get the in-built tasks??

Regards
Irfan.


-----Original Message-----
From: Jan.Materne@rzf.fin-nrw.de [mailto:Jan.Materne@rzf.fin-nrw.de] 
Sent: Tuesday, May 27, 2008 3:32 PM
To: user@ant.apache.org
Subject: AW: Ant tasks

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@t-systems.com [mailto:Irfan.Sayed@t-systems.com] 
> Gesendet: Dienstag, 27. Mai 2008 11:49
> An: user@ant.apache.org
> 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@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message