ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jose Alberto Fernandez <>
Subject RE: Lazy evaluation of custom taskdefs
Date Wed, 20 Sep 2000 19:13:35 GMT
Just to add to the comment here. The great job that Stefan has done also
allows people to define their on variants of the core tasks.

So for example if you want to add feature XXX to javac. You can now subclass, into mypackage.MyJavac and then just do:

  <taskdef name="javac" classname="mypackage.MyJavac">
   <classpath .../>

And voila' you have your own <javac> task with the features you want, and it
works with the out of the box ANT.

I think we should formalize this on the web site so that people that just
want a little change here and a little change there can just do it their onw

Jose Alberto

> -----Original Message-----
> From: Stefan Bodewig []
> Sent: Tuesday, September 19, 2000 11:54 PM
> To:
> Subject: Re: Lazy evaluation of custom taskdefs
> >>>>> "MA" == Mads Andersen <> writes:
>  MA> This would be possible if custom taskdefs were evaluated in a
>  MA> lazy fasion, that is when the custom tasdef is first needed.
> They are, but somewhat different than you propose.
> You can now (1.2alpha3) put the taskdef into a target and it will be
> evaluated at runtime. 
> <target name="build.and.define.task">
>   <javac ... />
>   <taskdef name="transform" 
> classname="com.madsie.util.xsl.XSLTransformTask"/>
> </target>
> <target name="use.task" depends="build.and.define.task">
>   <transform ... />
> </target>
> Should work - i.e. if it doesn't you've found a bug.
> You might need to use the nested classpath element of taskdef if your
> freshly compiled task is not inside of Ant's classpath.
> Stefan

View raw message