DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4399>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4399

Handling failure within the buildfile

           Summary: Handling failure within the buildfile
           Product: Ant
           Version: unspecified
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Core tasks
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


What happens if an error occurs?  All BuildListeners are alerted.  That's fine.

But what if I want to send myself an email whenever the build fails?  It's so 
much easier to add a target to a buildfile than writing a custom build 
listener...

Here's my suggestion: change the project tag to include a "failure" attribute 
whose value would represent the target to call in case of failure.  So you get:

  <project name="my_project" default="buildAll" failure="buildFailed" 
basedir=".">
    <target name="buildAll">
      ...
    </target>

    ...

    <target name="buildFailed">
      <echo message="My build failed!"/>
    </target>
  </project>

Matt

Reply via email to