在 NAnt 0.92 中,我定义了一个属性,并在检查它是否存在后立即进行。它不存在......但它存在于一个被调用的目标中。这是错误还是功能?!?我在文档中搜索,但找不到提及它。
<target name="test">
<property name="testprop" value="test value" />
<echo message="property value = ${testprop}" />
<if test="${property::exists(testprop)}">
<echo message="property exists, as it should!" />
</if>
<if test="${not property::exists(testprop)}">
<echo message="property doesn't exists... WTF?" />
</if>
<call target="test2" />
</target>
<target name="test2">
<echo message="property value in sub-target = ${testprop}" />
</target>
输出:
测试:
[echo] property value = test value
[echo] property doesn't exists... WTF?
测试2:
[echo] property value in sub-target = test value