ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Patrick Martin <antu...@gmail.com>
Subject Re: No BuildFinished event in subproject
Date Thu, 28 Jul 2005 14:04:22 GMT
Yes, that's what I saw.
. BuildFinished event is not raised by subproject, only by main
project. Only BuildListeners added to the main project will receive
it.
. A listener that is created in a subproject cannot listen to
BuildFinished event as it won't be registered in the main project.
. SubBuildFinish are thrown at the end of each subproject.

I want my listener to be notified on BuildFinished event, even if
created in a subproject.
The only solution I see is to be able to add a build listener to the
main project from a subproject task. But I don't know if that's
possible as I cannot find any reference to the main project anywhere..

Patrick

On 7/28/05, Jeffrey E Care <carej@us.ibm.com> wrote:
> Try reading this: http://ant.apache.org/manual/develop.html#buildevents
> 
> --
> Jeffrey E. Care (carej@us.ibm.com)
> WebSphere v7 Release Engineer
> WebSphere Build Tooling Lead (Project Mantis)
> 
> 
> Patrick Martin <antuser@gmail.com> wrote on 07/28/2005 05:34:54 AM:
> 
> > Hello,
> >
> > I am writing a task that runs tasks in background and listens to build
> > events in order to make sure background threads finish before the
> > build ends (as suggested in [1]).
> >
> > The trick works perfectly well when running the task in the main
> > project, but I never get the BuildFinished event when I run the task
> > from a subproject (created with antcall).
> >
> > For example, the following script:
> >
> > <target name="test">
> >    <antcall target="test2" />
> > </target>
> >
> > <target name="test2">
> >    <taskdef name="invoke"
> classname="com.sardak.antform.util.TargetInvoker" />
> >    <invoke target="longTarget" background="true" />
> > </target>
> >
> > <target name="longTarget">
> >    <echo message="before wait" />
> >    <waitfor maxwait="5" maxwaitunit="second">
> >       <isset property="dummy.property" />
> >    </waitfor>
> >    <echo message="after wait" />
> > </target>
> >
> > Calling test2 works: the build waits until the completion of longTarget.
> > Calling test fails: the build finishes before teh completion of
> longTarget.
> >
> > Does it mean that subproject never fire a BuildFinished event?
> >
> > I am not including the task sources because it might be a bit long,
> > but I can do it if needed.
> >
> > Thank you,
> >
> > Patrick
> >
> > [1] http://marc.theaimsgroup.com/?l=ant-user&m=112242105429652&w=2
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > For additional commands, e-mail: user-help@ant.apache.org
> >
> 
>

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


Mime
View raw message