我正在尝试根据以下条件在 Ant 中打印一些消息:
<if>
<equals arg1="${docs.present}" arg2="true"/>
<then>
</then>
<else>
<echo message="No docss found!"/>
</else>
</if>
但如您所见,如果 docs.present 属性设置为“true”,那么只有我只想执行其他部分。 if 部分没有什么要执行的。我怎样才能实现这个目标?
最佳答案
您可以在 if
条件中使用 echo
而不是 else,如下所示:
<if>
<equals arg1="${docs.present}" arg2="false"/>
<then>
<echo message="No docss found!"/>
</then>
</if>
关于java - Ant else 条件执行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39362098/