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
Javac.java, into mypackage.MyJavac and then just do:

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

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

Jose Alberto

> -----Original Message-----
> From: Stefan Bodewig [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, September 19, 2000 11:54 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Lazy evaluation of custom taskdefs
> 
> 
> >>>>> "MA" == Mads Andersen <[EMAIL PROTECTED]> 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
> 

Reply via email to