Title: RE: [Nant-users] Interim state on a build between SUCCEEDED and FAILED
Henry/Bill
A)Put all of your mission critical tasks up front in some sort of clean or init target specifying failonerror="true" for all critical tasks
B)introduce the concept of task dependencies to later targets..consequent targets cannot execute if the initial target(s) failed
----- Original Message -----
Sent: Thursday, May 13, 2004 11:13 AM
Subject: RE: [Nant-users] Interim state on a build between SUCCEEDED and FAILED

I've worked around a similar problem which relates to the success of Nunit tests (amongst other things) based on external sources. We have no control over them, so they are prone to fail which would normally cause the build to fail entirely. In this case, we may be aware that the external sources are down, but still want the build to run (entirely) without just failing.

Without going into huge detail, the way I do most of it is with a combination of the <exec> task (to run the Nunit tests - gives a bit more control than the Nant task) and several generous chunks of C# script. The tests are run and output XML, some C# script then runs against that XML looking for failures and stores the result in a Nant property. The <exec> task has failonerror="false" so the build will continue regardless of failures.

As the last task in the build, it looks at a number of such properties (this can be applied to template checking, Ndoc generation, FXCop etc) and then I have another little piece of C# script which then writes a summary report (something like 'Build Succeeded, but the following external tests failed ... There were the following warnings...' etc. You can also use a conditional <fail> task to fail things deliberately at the end if you decide it's all gone too wrong.

This is fine for a non-release candidate, the scripts also check for this, and are a lot more rigid in what passes and gets versioned and packaged for release.

Sorry if that's a bit vague - hope it helps :)

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: 13 May 2004 3:04P
To: [EMAIL PROTECTED]
Subject: [Nant-users] Interim state on a build between SUCCEEDED and FAILED


I have written a custom task to perform a scan on a VS project file when the build is executed to ensure the project complies with standards (it checks that option explicit is set in a VB project for example and checks for files in the archive that aren't part of the project.)

The problem I have is that I want to have an interim state in the build script so that if there are errors from my task, it doesn't fail the build but does produce warnings and the end state of the build script should be SUCCEEDED WITH WARNINGS or something.  I can throw an exception in my task and fail the build, but I can't see any way of just flagging warnings.

The task currently outputs a warning in the build output, but this tends to get lost in the total output as there are about 50 projects that get built and checking each one is laborious.

Is what I want to do possible?  Has anyone found another way?

Cheers,

Bill




______________________________________________________________

CONFIDENTIALITY NOTICE

This communication and the information it contains is intended for the person or organisation to
whom it is addressed.  Its contents are confidential and may be protected in law.  Unauthorised use,  copying or disclosure of any of it may be unlawful.  If you are not the intended recipient, please

contact us immediately.

The contents of any attachments in this e-mail may contain software viruses, which could damage your
own computer system.  While Marlborough Stirling has taken every reasonable precaution to minimise
this risk, we cannot accept liability for any damage, which you sustain as a result of software
viruses.  You should carry out your own virus checking procedure before opening any attachment.


Marlborough Stirling plc, Registered in England and Wales
Registered No. 3008820,
Allen Jones House, Jessop Avenue, Cheltenham, Gloucestershire, GL50 3SH
Tel: 01242 547000     Fax: 01242 547100
http://www.marlborough-stirling.com



-------------------------------------------------------
This SF.Net email is sponsored by: SourceForge.net Broadband Sign-up now for SourceForge Broadband and get the fastest 6.0/768 connection for only $19.95/mo for the first 3 months! http://ads.osdn.com/?ad_id%62&alloc_ida84&op=click

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



"This communication is intended solely for the addressee and is confidential and not for third party unauthorised distribution."

Reply via email to