ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Vlaminck <>
Subject Catch Task
Date Wed, 13 Feb 2002 18:36:39 GMT

I'm new to the list, so please forgive me if something along these lines
has already been discussed, but here goes ...

I have created an Ant task to catch build failures, so that they can be
handled within the script itself - much like java try-catch. 

It simply catches any build failures and sets a property instead. I have
then used this property in the 'if' or 'unless' clauses of other
targets. I'd like to get some feedback, and contribute the code if it
makes sense.


<catch property="exception">
    <javac srcdir="${srcdir}"
      <classpath refid="project.class.path" />

sets the property 'exception' if the javac task fails.

It seems to me that this would be pretty powerful to have in ant and it
worked really well for what I needed to do. If it makes sense to add this,
I'm more than happy to submit the code.

Any comments/ideas?

Scott Vlaminck

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message