Koen, I see that multiple people have already
responded. So…… The script below is another way of
accomplishing your request. I haven’t tested it, but it should
be easy enough to get functional. The script won’t work properly if
you use the ‘depends’ attribute on your targets. This only works if you have a sequential
build order. Noel <?xml
version="1.0"?> <project
name="Test" default="start">
<!-- File to store restart information in -->
<property name="restartFile" value="Test.restart" />
<!-- The 'start' target sets the stage to allow
restarting from the failed
target -->
<target name="start">
<!-- Set up the default first target to execute -->
<property name="targetToCall" value="firstTarget" />
<property name="nant.onsuccess" value="success" />
<property name="nant.onfailure" value="setupRestart"
/>
<if test="${file::exists(restartFile)">
<!-- Load the restart target into a property -->
<loadfile file="${restartFile}" property="targetToCall"
/>
<delete file="${restartFile}" />
</if test>
<!-- call either the default first target or the restart target -->
<call target="${targetToCall}" />
</target>
<target name="firstTarget">
<property name="targetToCall"
value="${target::get-current-target()}" />
<echo message="In ${target::get-current-target()}" />
<call target="checkoutCode" />
</target>
<target name="checkoutCode">
<property name="targetToCall"
value="${target::get-current-target()}" />
<echo message="In ${target::get-current-target()}" />
<call target="build" />
</target>
<target name="build">
<property name="targetToCall" value="${target::get-current-target()}"
/>
<echo message="In ${target::get-current-target()}" />
<call target="package" />
</target>
<target name="package">
<property name="targetToCall"
value="${target::get-current-target()}" />
<echo message="In ${target::get-current-target()}" />
</target>
<!-- nant.onfailure handler -- writes the name of the target that failed
into a file -->
<target name="setupRestart">
<echo file="${restartFile}" message="${targetToCall}"
/>
<echo message="target, ${targetToCall}, failed to complete" />
</target>
<!-- nant.onsuccess handler -->
<target name="success">
<echo message="all targets executed successfully" />
</target> </project> From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Koen Mayens Hi, |
- [NAnt-users] status build Koen Mayens
- Re: [NAnt-users] status build Gary Feldman
- RE: [NAnt-users] status build Noel Gifford
- RE: [NAnt-users] status build John Cole