我有一个build.xml蚂蚁使用,而我试图把目标内的条件:如何在ant中使用condition元素来设置另一个属性?
首先,我在这里它设置属性工程确定:
<condition property="isWindows">
<os family="windows"/>
</condition>
然后我试着在目标中使用它:
<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>
我收到一个错误:“条件不支持嵌套的”属性“元素。 问题是:我如何正确地将条件放置在目标中,为什么错误是指“嵌套”属性?
这看起来酷似蚂蚁文档的语法。你确定你没有在条件任务内创建一个元素(你写过“在这里做事情”)? –
啊......我在那里创建了另一个属性(下一行是 是否是否定的? –
Pete855217