这就是我想要实现的目标:
如果设置了属性,则调用 antcall 目标。这是可行的吗?有人能告诉我怎么做吗?
<condition>
<isset property="some.property">
<antcall target="do.something">
</isset>
</condition>
最佳答案
这样的事情应该工作:
<if>
<isset property="some.property"/>
<then>
<antcall target="do.something"/>
</then>
</if>
如果条件需要 ant-contrib ,但几乎所有对 ant 有用的东西也是如此。
关于基于条件的 Ant 调用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11231838/