我有一個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