NAnt has two built-in properties, nant.onsuccess
and nant.onfailure
, for specifying tasks to run on success and failure respectively.
Is there an equivalent in Ant?
Join Stack Overflow to learn, share knowledge, and build your career.
NAnt has two built-in properties, nant.onsuccess
and nant.onfailure
, for specifying tasks to run on success and failure respectively.
Is there an equivalent in Ant?
I don't think there's an ant equivalent but you could use trycatch (part of ant-contrib)
<trycatch>
<try>
<!-- Your code here -->
<!-- Success message -->
</try>
<catch>
<!-- Fail message -->
</catch>
</trycatch>
Hope this helps
Kev Jackson, gave a neat example of an exec-listener in his presentation, = http://people.apache.org/~kevj/ossummit/extending-ant.html, the sources of the exec-listener are included
You're able to kick off specific tasks depending on the build result after your build has finished.
<exec-listener onSuccess="true|false">
..
your stuff goes here
..
</exec-listener>
Although I've marked John McG as the answer (as it's what I've gone with), I've also discovered that it's also possible to build similar functionality using BuildListeners.