Julian,
 
Have a look at the <trycatch/> task from NAntContrib - HYPERLINK 
"http://nantcontrib.sourceforge.net/"http://nantcontrib.sourceforge.net/ 
 
You script would end up looking something like this:
 
<?xml version="1.0"?>

<project name="TestProject" default="run">

  <description>Nant Script</description>

 

  <target name="run" description="does exactly that">

    <trycatch>

      <try>

        <call target="a"/>

        <call target="b"/>

        <call target="c"/>

        <call target="d"/>

        <call target="e" />

        <call target="f"/>

      </try>

      <catch>

        <call target="g"/>

      </catch>

    </trycatch>

  </target>

<!-definitions of targets a -f à   

</project>

 

Chris


   _____  

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of JulianH
Sent: 19 March 2008 12:55
To: nant-users@lists.sourceforge.net
Subject: [NAnt-users] Question: Run certain target after another target fails



Hello,

 

We use NAnt in our project and I try to call a certain target if another target 
fails.

 

So, lets say, we have the following - simplified - build script:

 

<?xml version="1.0"?>

<project name="TestProject" default="run">

  <description>Nant Script</description>

 

  <target name="run" description="does exactly that">

    <call target="a"/>

    <call target="b"/>

    <call target="c"/>

    <call target="d"/>

    <call target="e" />

    <call target="f"/>

  </target>

<!-definitions of targets a -f à   

</project>

 

I want to run a certain target g, when the target named "run" fails. How can I 
do this? 

 

 

Regards,

 

JulianH


No virus found in this incoming message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.21.7/1334 - Release Date: 18/03/2008 
20:52



No virus found in this outgoing message.
Checked by AVG. 
Version: 7.5.519 / Virus Database: 269.21.7/1334 - Release Date: 18/03/2008 
20:52
 
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to