Yep, this was something I was thinking about when the inheritance
discussion went on. I was going to clean things up afterwards and test
these cases (which reminds me, we still need unit tests for this). 

We really need to separate the project/system props from the user props
so that certain properties don't get inherited. Or at least have a block
list that doesn't get inherited.

Another way to do this is to establish an event model so that you can
add an eventTask which will be called for certain things.

So I would image that something like this would be reasonable.

<project>
        <event for="onsuccess">
                <call targer="good"/>
        </event>
        <event for="onfailure">
                <call target="bad-cleanup"/>
        </event>
</project>

And I'd image that there would be events for the following things.

Start/End (pre/post?) for 
1.) global tasks (as a group)
2.) individual targets (as they are called/executed) 
3.) whole build process

As well as success/failure.

> -----Original Message-----
> From: [EMAIL PROTECTED]
[mailto:nant-developers-
> [EMAIL PROTECTED]] On Behalf Of [EMAIL PROTECTED]
> Sent: Thursday, June 13, 2002 11:17 AM
> To: [EMAIL PROTECTED]
> Subject: [nant-dev] Property Inheritance & nant.onsuccess
> 
> I found something interesting today.
> 
> I'm using a master build file that calls tasks in other build files
using
> the nant task.  In my master build file I have a nant.onsuccess and
> nant.onfailure property set to execute after the main build file has
> either
> succeeded or failed.  When I call the child build files using the nant
> task
> it tries to execute the nant.onsuccess target because it has inherited
the
> properties from the master build file but in the child files I don't
have
> a
> success target defined.  To keep this from failing I have to put in
empty
> targets in the child build files.  Does this make sense or is this
> something that should behave differently.  Here is an example to show
the
> problem.
> 
> Example files:
> 
> master.build
> 
> <project name="master" default="main">
> 
> <property name="hello.world" value="Hello World" />
> <property name="nant.onsuccess" value="successtarget" />
> 
> <target name="main">
> <nant buildfile="U:\Spikes\build\a.build" target="one"
failonerror="true"
> verbose="true" />
> <nant buildfile="U:\Spikes\build\b.build" target="one"
failonerror="true"
> verbose="true" />
> <nant buildfile="U:\Spikes\build\a.build" target="two"
failonerror="true"
> verbose="true" />
> <nant buildfile="U:\Spikes\build\b.build" target="two"
failonerror="true"
> verbose="true" />
> <nant buildfile="U:\Spikes\build\a.build" target="three"
> failonerror="true"
> verbose="true" />
> <nant buildfile="U:\Spikes\build\b.build" target="three"
> failonerror="true"
> verbose="true" />
> <nant buildfile="U:\Spikes\build\a.build" target="four"
failonerror="true"
> verbose="true" />
> <nant buildfile="U:\Spikes\build\b.build" target="four"
failonerror="true"
> verbose="true" />
> </target>
> 
> <target name="successtarget">
>      <echo message="Success!" />
> </target>
> 
> </project>
> 
> a.build
> 
> <project default="one" name="a">
> 
> <target name="one"><echo message="a.one"/></target>
> <target name="two"><echo message="a.two"/></target>
> <target name="three"><echo message="a.three"/></target>
> <target name="four"><echo message="a.four"/></target>
> 
> </project>
> 
> b.build
> 
> <project default="one" name="b">
> 
> <target name="one"><echo message="b.one"/></target>
> <target name="two"><echo message="b.two"/></target>
> <target name="three"><echo message="b.three"/></target>
> <target name="four"><echo message="b.four"/></target>
> 
> </project>
> 
> 
> 
> 
> _______________________________________________________________
> 
> Don't miss the 2002 Sprint PCS Application Developer's Conference
> August 25-28 in Las Vegas -
> http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink
> 
> _______________________________________________
> Nant-developers mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/nant-developers



_______________________________________________________________

Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas - 
http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink

_______________________________________________
Nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to