ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Duncan Davidson <james.david...@eng.sun.com>
Subject Re: [RFE] Richer Task Specification
Date Wed, 21 Jun 2000 22:08:10 GMT
on 2000/06/18 19:49, mpfoemme@ThoughtWorks.com at mpfoemme@ThoughtWorks.com
wrote:

> What if we allow all tasks (as opposed to just properties and taskdefs) to
> be used outside of targets , and execute them on the spot? They would be
> similar to "static {...}" blocks in java, in that they get run as soon as
> the class/project is loaded. So at the top of your build file you could
> just put the following, which would cause the javac task to run before the
> taskdef:
> 
> <project name="foo">
> 
> <javac srcdir="lib" destdir="lib"/>
> <taskdef name="xslt" classname="Xslt" classpath="lib"/>
> 
> <target name="bar">
> ...

I'm of mixed feelings on this. On the one side, I don't like what's below,
on the other, I'm not sure I like the idea of static {...}...

> Or, if we decide to wait until execution time to instantiate tasks, we
> could add a "target" attribute to taskdef, which would cause that target to
> be built before loading the task class:
> 
> <project name="foo>
> <taskdef name="xslt" classname="Xslt" classpath="lib" target
> ="xslt-compile"/>

Or this could be just a "depends" attrib.



Mime
View raw message