【发布时间】:2014-01-24 18:44:06
【问题描述】:
可以通过指定if 或unless 子句有条件地执行Ant 目标。据我所知,这个条款只接受一个属性。如何检查两个属性?
这是一个例子:
<project default="test">
<property name="a" value="true"/>
<property name="b" value="true"/>
<target name="test-a" if="a">
<echo>a</echo>
</target>
<target name="test-b" if="b">
<echo>b</echo>
</target>
<target name="test-ab" if="a,b">
<echo>a and b</echo>
</target>
<target name="test" depends="test-a,test-b,test-ab"/>
</project>
如果我运行它,test-ab 目标不会产生任何输出:
如何为这两个属性指定一个and表达式?
【问题讨论】:
标签: ant