我正在寻找一种退出目标并继续运行 ant 代码而不退出整个过程的方法。像下面这样的东西,但我得到错误。
<target name="foo">
<some-task/>
<another-task/>
<condition property="should.exit">
(condition check here....)
</condition>
<exit if="should.exit" message="some message"/>
(skipped tasks if "should.exit" is true)
</target>
我得到的错误:
Problem: failed to create task or type exit
[sshexec] [echo] Cause: The name is undefined.
[sshexec]
[sshexec] [echo] Action: Check the spelling.
[sshexec]
[sshexec] [echo] Action: Check that any custom tasks/types have been declared.
[sshexec] [echo] Action: Check that any <presetdef>/<macrodef> declarations have taken place.
[sshexec]
[sshexec] [echo] [sshexec]
[sshexec] [echo] ERROR Error error
<target name="foo">
<some-task/>
<another-task/>
<condition property="should.exit">
(condition check here....)
</condition>
<fail message="failing">
<condition>
<equals arg1="${should.exit}" arg2="true"/>
</condition>
</fail>
(skipped tasks if "should.exit" is true)
</target>