我有一个执行 makefile 的 ant 构建文件
<target name="jni">
<exec executable="make">
<arg line="-f jni/Makefile"/>
</exec>
</target>
但是,如果 make 失败,依赖于该规则的其他规则将执行
如果 jni 规则失败,如何停止 ant?
最佳答案
使用failonerror
属性,默认为false
:
<target name="jni">
<exec executable="make" failonerror="true">
<arg line="-f jni/Makefile"/>
</exec>
</target>
我一直想知道为什么默认情况下它不是真的...... See the docs.
关于ant - 如果 makefile 失败则停止 ant 构建,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13351992/