我想使用相同的ant腳本在本地Windows環境或我們的redhat構建服務器上進行構建。Ant:引用動態屬性
我在兩個文件(build_unix.properties & build_windows)中有一個變量'buildDirectory'。我想根據環境設置變量。
<osfamily property="os.family"/>
<property file="./build_${os.family}.properties" />
<property name="tmp-base.folder" value="${buildDirectory}/tmp/"/>
我也試過
<if>
<os family="unix"/>
<then>
<property file="./build_unix.properties" />
</then>
<else>
<property file="./build_windows.properties" />
</else>
</if>
任何想法?
問題似乎是語句的位置。當他們嘗試訪問時,來自這裏的屬性可能還沒有解決。 – 2009-08-13 08:55:28