我有一个与ant一起使用的build.xml,我正在尝试在目标中放置一个条件:
首先,我在这里设置属性工作正常:
<condition property="isWindows">
<os family="windows"/>
</condition>
Run Code Online (Sandbox Code Playgroud)
然后我尝试在目标中使用它:
<target name="-post-jar">
<condition property="isWindows" value="true">
<!-- set this property, only if isWindows set -->
<property name="launch4j.dir" location="launch4j" />
</condition>
<!-- Continue doing things, regardless of property -->
<move file="${dist.jar.dir}" tofile="myFile"/>
<!-- etc -->
</target>
Run Code Online (Sandbox Code Playgroud)
我收到一个错误:"条件不支持嵌套的"property"元素." 问题是:如何正确地将条件放入目标中,为什么错误引用了'嵌套'属性?