NAnt有两个built-in properties,nant.onsuccess和nant.onfailure,分别用于指定在成功和失败时运行的任务。
Ant中有没有等价物?
发布于 2009-08-10 12:20:30
我不认为有等同于ant的东西,但你可以使用trycatch (ant-contrib的一部分)
<trycatch>
<try>
<!-- Your code here -->
<!-- Success message -->
</try>
<catch>
<!-- Fail message -->
</catch>
</trycatch> 希望这能有所帮助
发布于 2009-09-03 20:42:10
Kev Jackson,在他的演示文稿中给出了一个很好的例子,= http://people.apache.org/~kevj/ossummit/extending-ant.html,其中包含了exec-listener的源代码
在构建完成后,您可以根据构建结果启动特定的任务。
<exec-listener onSuccess="true|false">
..
your stuff goes here
..
</exec-listener>发布于 2009-08-10 13:04:08
虽然我已经将John McG标记为答案(因为我也是这么做的),但我也发现也可以使用BuildListeners构建类似的功能。
https://stackoverflow.com/questions/1254032
复制相似问题