【发布时间】:2013-01-15 13:26:10
【问题描述】:
我无法找到这个问题的答案,正如您将看到的,理解我试图逆向工程的 build.xml 是如何工作的并不重要。不过我确实认为这个问题有一定的道理。
在这个 build.xml 中,我有以下代码段:
<condition property="tests.complete">
<isset property="no.tests" />
</condition>
<condition property="tests.complete">
<and>
<uptodate>
...
</uptodate>
<uptodate>
...
</uptodate>
<uptodate>
...
</uptodate>
<not>
<available ... />
</not>
<not>
<isset ... />
</not>
</and>
</condition>
我明白,如果在遇到这段代码之前设置了属性 no.tests,那么属性 tests.complete 将在第一个条件下设置为 true,无论在第二个条件任务中发生什么,这个属性离开代码段时将保持设置为 true。我的问题是,既然属性 tests.complete 是由第一个条件设置的,那么第二组条件测试是否会被评估?
【问题讨论】:
标签: ant conditional-statements short-circuiting