I am using ant to combine multiple independant build processes under one 
umbrella.  Once I get beyond some initialization which applies to the 
whole process, I'd like to make the umbrella build tolerant of failures 
within the previously independant builds.  Furthermore, in the event of a 
failure in one of the builds, I'd like to e-mail notification of the 
failure, along with an attached log of the build. 
I am not aware of a way to do this with the existing Ant functionality. If 
I am wrong in this, please enlighten me.
What I propose to accomodate this is an <isolatefailure> task.  It would 
contain a <sequential> element, implemented by a private NestedSequential 
class which implements TaskContainer, ala MacroDef.  However, the 
IsolateFailure class' execute method would catch any BuildException, and 
not rethrow it.  This would isolate tasks following the <isolatefailure> 
task from the failure, and allow them to continue executing. 
<isolatefailure> would also accept an optional <executeonfailure> element 
which, like <sequential>, holds nested tasks, but these would only be 
executed if a BuildException was caught.  This would accomodate the 
requirement for special processing in the event of a failure. 
<executeonfailure> would take an optional errorproperty="propertname" 
parameter, which would identify the name of a property which should be set 
with the message from the BuildException before executing the tasks nested 
within the <executeonfailure>.
I'm looking for feedback on this idea before I start work on it...

--------------------------------------------------------
David S. Johnson

"Oh scholar, if your scholarship benefits not Mankind,
you deserve not admiration but contempt." -- Kahlil Gibran

Reply via email to