Ant遇到错误时还能继续吗?

Joh*_*n W 5 ant

我有一个 Ant 目标,它按顺序执行 2 个步骤:

<target name="release">
    <antcall target="-compile"/>
    <antcall target="-post-compile"/>
</target>
Run Code Online (Sandbox Code Playgroud)

使用上面的脚本,如果“-compile”目标失败,它会立即退出。“-post-compile”没有机会运行。有没有办法确保即使第一步(-compile)失败也执行第二步(-post-compile)?

Neo*_*Neo 2

我想你正在寻找

-继续 (-k)

这将告诉 Ant 继续构建所有不依赖于失败目标的目标。