ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Reilly <>
Subject Re: buildStarted/Finished and subbuilds
Date Wed, 23 Jun 2004 12:37:51 GMT

The clean up you propose sounds very good.

As regards whether the ant family tasks should fire build started
and finished events. One may see these for <subant>, and <ant>
but not for <antcall> (or at least the way it is used by some scripts
as a sub-routine call). In any case, as you say, it cannot be
changed for backwards compatibility reasons.


Stefan Bodewig wrote:

>Hi all,
>while investigating bug 8689 I realized that the Ant project instances
>we create in Ant never fire the build started or finished events.  I'm
>not entirely sure that this is a good thing (but it probably is), but
>we probably can't change it for backwards compatibility reasons
>This has a couple of consequences, one of them causes the excess
>memory needed in AntClassLoader.  If a task in the subbuild creates an
>AntClassLoader instance it never gets cleaned up since the subproject
>never calls build finished.
>Another one is that any <record> task used in the subbuild could leave
>open files hanging around until Ant exits.  For what I propose below,
>I'll also have to add a close method to RecorderEntry.
>Since I don't think we can "fix" the build* events for subbuilds, I
>plan to do some things in <ant> after the subbuild has finished:
>* remove all build listeners of the main project from the subbuild.
>* iterate over the remaining build listeners of the subbuild and
>  a) invoke cleanup() if it is an AntClassLoader
>  b) invoke close() if it is a RecorderEntry
>this is ugly, but any clean solution I could come up with is not
>backwards compatible (add a dispose method to BuildListener, make
>subbuilds fire buildFinished ...).
>Any better ideas?
>To unsubscribe, e-mail:
>For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message