What is your reaction to handling platform-specific properties as shown below? Is there a
better way?
Note: Our environment only has Windows and Unix platforms.
<!-- =================================================================== -->
<!-- Handle platform-specific properties by determining the platform -->
<!-- and setting a windowsBuild property which we can key off of to do -->
<!-- windows-specific or unix-specific actions. -->
<!-- =================================================================== -->
<!-- Are we running on a windows platform? -->
<target name="initBuildPlatform">
<condition property="windowsBuild">
<and>
<os family="windows" />
</and>
</condition>
</target>
<!-- Windows-specific property settings -->
<target name="initWindowsProperties" depends="initBuildPlatform" if="windowsBuild">
<property name="signTool" value="signtool.exe"/>
<property name="DASHO_CONFIG" value="Build_Scripts/OrderEntry.dop"/>
<property name="JspCompiler" value="../jdk1.3/bin/javac"/>
<property name="DEVA_DELTA" value="i:/60_deva_delta/MARS"/>
</target>
<!-- Unix-specific property settings -->
<target name="initUnixProperties" depends="initBuildPlatform" unless="windowsBuild">
<property name="signTool" value="signtool"/>
<property name="DASHO_CONFIG" value="Build_Scripts/OrderEntryUnix.dop"/>
<property name="JspCompiler" value="/usr/j2se/bin/javac"/>
<property name="DEVA_DELTA" value="../60_deva_delta/MARS"/>
</target>
<!-- Determine the build platform and set platform-specific properties -->
<target name="initPlatformProperties" depends="initUnixProperties, initWindowsProperties"/>
<target name="init" depends="initPlatformProperties" ...
|