Kevin

I'm using the following to set paths based on O/S (Ant 1.3), and it appears
to work but it does mean you have to find a file that's uniq to your O/S and
you have more than 1 properties file (ntssab.properties for NT, and
unixssab.properties for UNIX)!

        <target name="setProperties">
                <echo message="Set base environment variables from
properties."/>
                <property file="${ssab.propertyFile}"/> 
        </target>

        <target name="validate">
                <available property="ssab.propertyFile"
value="ntssab.properties" file="c:\autoexec.bat"/>
                <available property="ssab.propertyFile"
value="unixssab.properties" file="/dev/null"/>
        </target>

        <target name="init" depends="validate,setProperties">
                <tstamp/>
                <property name="ssab.distributionLatest"
value="${ssab.distributionDirectoryRoot}/latest"/>
                <property name="ssab.distributionArchive"
value="${ssab.distributionDirectoryRoot}/${DSTAMP}${TSTAMP}"/>
                <!-- Create the build directory structure used by compile
-->
                <mkdir dir="${ssab.classesDir}"/>
                <mkdir dir="${ssab.libDir}"/>
        </target>



-----Original Message-----
From: Kevin Duffey [mailto:[EMAIL PROTECTED]]
Sent: 21 September 2001 05:56
To: [EMAIL PROTECTED]
Subject: Any way to test if on unix/linux, mac, windows, etc?


Hi,

I have built scripts for windows only, and now I need a "cross-platform" 
script. Almost everything in the script should work fine to build my java 
projects, but I do have the problem of "paths". I am wondering if there is 
a way to conditionally check and/or set the path based on the platform it 
is being run on?

Thanks.


------------------------------------------------------------------------------
Halifax plc, Registered in England No. 2367076.  Registered Office: Trinity Road, 
Halifax, West Yorkshire HX1 2RG. Represents only the Halifax Financial Services 
Marketing Group for the purposes of advising on and selling life assurance, pensions 
and unit trust business.  The Marketing Group is regulated by the Personal Investment 
Authority.  Switchboard 01422 333333.

==============================================================================

Reply via email to