Ant equivalent to nant.onsuccess / nant.onfailure

NAnt has two built-in properties , nant.onsuccess and nant.onfailure , for setting tasks for successful operation and failure, respectively.

Is there an equivalent in Ant?

+1
source share
3 answers

I don't think there is an ant equivalent, but you can use trycatch (part of ant -contrib)

 <trycatch> <try> <!-- Your code here --> <!-- Success message --> </try> <catch> <!-- Fail message --> </catch> </trycatch> 

Hope this helps

+2
source

Kev Jackson, gave a neat example of an exec listener in his presentation = http://people.apache.org/~kevj/ossummit/extending-ant.html , sources of the exec listener included

You can run certain tasks depending on the result of the assembly after the assembly is completed.

 <exec-listener onSuccess="true|false"> .. your stuff goes here .. </exec-listener> 
+1
source

Although I tagged John McGg as the answer (as well as what I went with), I also found that it is also possible to build similar functionality using BuildListeners .

0
source

Source: https://habr.com/ru/post/1384957/


All Articles