-----Original Message----- From: Stefan Bodewig 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.
[DD] This is what I was trying to say earlier, except that if [DD] Ant.java itself was pushing (and popping if needed) [DD] itself as the current threadTask in its execute() method [DD] then SubAnt.java would not need to do any of that. [DD] At least in my original impl of SubAnt.java, I was already [DD] call ant.setTaskName(getTaskName()), so the name was not [DD] really the issue (for me). [DD] All I'm trying to say, and I think Jose Alberto as well, is [DD] poor sobs like me who do not understand (or are even aware) [DD] of Ant's I/O system should be able to reuse Ant.java without [DD] knowing the details, 'cause Ant.java would do the right thing. 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(); [DD] This looks useful in its own right, especially for prototyping [DD] purposes when writing a <script> or <scriptytypef>. But I believe [DD] this is a bit different than the pb at hand. OK, it's not really [DD] a pb as a patch is already in, it's just that I don't really like [DD] what the patch means, i.e. that you need detailed and intimate [DD] knowledge of Ant.java to use it correctly. Any API should strive [DD] to make difficult to write bad code, and ease writing good code, [DD] and I just learned about Ant.java contradicts this principle. --DD --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]