On Thu, 24 Jun 2004, Conor MacNeill <[EMAIL PROTECTED]> wrote: > Well, you could still take the approach of removing the main build > listeners and then fire a SubBuildFinished on all the remaining > listeners that are BuildListener2.
Yes, much like what Jose Alberto describes later. This would mean triggering the events from within <ant> and not from Project#executeTarget. subProjectStarted may be interesting for some kinds of build listeners as well. subBuild or subProject? subBuild is closer to buildStarted/Finished. Another thing that just occured to me is that AntClassLoader should check the BuildEvent to see whether the firing project is the same it has been registered with and only cleanup itself if it is. This way we don't have to worry about removing the "master build" build listeners before subProjectFinished is fired. > I wonder if we should have separate lists for objects just to listen > to their project and not events from subbuilds. Listeners can look into the BuildEvent if this matters, we've jsut never told anybody that it could matter. Not sure when we started to send BuildListeners down to the subbuilds, but it hasn't been always that way - so things like <record> simply don't take it into account. > Really we have overloaded the event interface to provide a cleanup > mechanism. True. > Just to note that cleanup should be safe to call on the > AntClassLoaders at any time if not necessarily optimal for > performance. cleanup nulls out the project reference which disturbs logging, Gump specific handling of the context classloader and addPathElement which is used by <classloader>. > If that is not true, I'm not sure you can be safe cleaning them up > at sub-build finished time :-) That would only be classloaders created in the subbuild. No object created in the subbuild should be able to reach the main build, so we are pretty save - except for spawned threads. Stefan --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]