http://nagoya.apache.org/bugzilla/show_bug.cgi?id=261 *** shadow/261 Thu Feb 1 01:42:54 2001 --- shadow/261.tmp.8576 Thu Feb 1 01:42:54 2001 *************** *** 0 **** --- 1,47 ---- + +============================================================================+ + | Adding suport for failure and done targets BugRat Report#452 | + +----------------------------------------------------------------------------+ + | Bug #: 261 Product: Ant | + | Status: UNCONFIRMED Version: 1.2 | + | Resolution: Platform: All | + | Severity: Normal OS/Version: All | + | Priority: High Component: Main | + +----------------------------------------------------------------------------+ + | Assigned To: [EMAIL PROTECTED] | + | Reported By: [EMAIL PROTECTED] | + | CC list: Cc: | + +----------------------------------------------------------------------------+ + | URL: | + +============================================================================+ + | DESCRIPTION | + Using ANT to do nightly builds, I would like to receive an + email of the result, fail or not. However, I could not + find a way to catch a failure in my build file. + + Here's what I would want to do: + + - if a failure occured, clean up any directory my build + created, rollback any changes I already made and send + the log file, including the error, by mail; + - if the build whent through, send the log file by mail. + + The second one I can do easily. The last target executed + simply sends an email. However, if a failure occured, + the build process stops and I am never notified. + + Since I could not find an easy way to do this (other than + writing an event listener, and even then I'm not sure if + it would work), I took it upon myself to modify the Project + class to include two new attributes: failure and done. So, + my build XML file now starts with: + + <project name="myBuild" + default="mainTarget" + failure="failTarget" + done="doneTarget" + basedir="."> + + + and I added the call to the "failure" and "done" targets in + the execution. That way, I am always notified whenever + there's a failure in my build. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]