ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Vlaminck <sc...@vlaminck.com>
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.


Usage:

<catch property="exception">
    <javac srcdir="${srcdir}"
           destdir="${builddir}"
           includes="com/**"
           deprecation="on"
           failonerror="true">
      <classpath refid="project.class.path" />
    </javac>
  </catch>

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?

Thanks,
Scott Vlaminck






--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message