ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: SubAnt output
Date Fri, 02 Jul 2004 11:42:25 GMT
On Fri, 2 Jul 2004, Jose Alberto Fernandez <jalberto@cellectivity.com>
wrote:

> Maybe Ant should provide its own delegation entry point since this
> is a very common pattern of use.

But maybe not something you want to expose.  Do you want to see [ant]
show up in the log instead of [subant]?

If so, a simple invocation of
getProject().registerThreadTask(Thread.currentThread(), ant) before
ant.execute() would have done the trick.  Hmm,
ant.setTaskName(getTaskName()) would solve the [ant] vs. [subant]
issue.

> So, a task that wants to delegate its work to Ant, will call
> something like:
> 
> 	Ant ant = new Ant(...);
> 	//Configure it ...
> 	ant.delegate(this);  // was ant.execute();

The name looks the wrong way around since delegate is active and
really this is delegating to ant.

For some time we've been kicking around the idea of a utility class
for the delegation cases

        // uses project.createTask, transfers task name and target ...
        DelegatedTask ant = new DelegatedTask(this, "ant");
        // uses IntrospectionHelper, also supports nested elements in
        // some way
        ant.setAttribute("buildfile", buildFile);
        // registers itself as task responsible for output, calls
        // execute and deregisters itself at the end
        ant.execute();

> Maybe is is something for 1.7.

At least not for 1.6.2 8-)

Stefan

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


Mime
View raw message