ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antoine Levy-Lambert" <anto...@gmx.de>
Subject Re: Custom task invoking other tasks
Date Wed, 09 Aug 2006 22:28:17 GMT
Hello Gili,

you can construct your Java task instance in two ways :

a) for Ant 1.6 code

Java myjava = (Java) getProject().createTask("java");

or

b) for Ant 1.7 code

Java myjava = new Java();
myjava.bindToOwner(this);
myjava.init();

in both cases you need to set afterwards all the attributes which you want your java task
instance to have, such as 

myjava.setClassname("org.foo.bar.doit");

Regards,

Antoine
-------- Original-Nachricht --------
Datum: Wed, 9 Aug 2006 16:20:21 -0400 
Von: "Tzabari, Gili" <Gili.Tzabari@nuance.com>
An: Ant Users List <user@ant.apache.org>
Betreff: Custom task invoking other tasks

> Hi,
> 
>  
> 
>             I'd like my custom task to invoke the Java task. Do I simply
> construct a new instance of org.apache.tools.ant.taskdefs.Java and
> execute()
> it? Or is there a nicer convention for chaining tasks programmatically
> (not
> in the build.xml side, but rather on the Java end)?
> 
>  
> 
> Thanks,
> 
> Gili
> 

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


Mime
View raw message