Yes, throw an exception. In fact, throw a BuildException.

We have a failonerror attribute which dictates how this exception is
treated. The user can choose to ignore it, or let it stop the build. Also
there are targets that can be called on a failure, or success of a build.

----- Original Message -----
From: James Lewis
To: '[EMAIL PROTECTED]'
Sent: Wednesday, April 02, 2003 6:45 AM
Subject: [Nant-users] How to make a usertask stop the build

I have a custom user task working pretty well but I have one other tweak I'd
like to make. I've noticed that ExecuteTask returns void so I wasn't exactly
how to signal NAnt if my task failed. I had assumed that it would be bad to
throw an exception from ExecuteTask so the only other thing I could think of
was to set a property at run time that would gate the rest of my build.
Here's what I've got:

[snip]



-------------------------------------------------------
This SF.net email is sponsored by: ValueWeb: 
Dedicated Hosting for just $79/mo with 500 GB of bandwidth! 
No other company gives more support or power for your dedicated server
http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/
_______________________________________________
Nant-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to