ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Jaffe" <mja...@eturn.com>
Subject RE: Setting a Unix vs Windows switch
Date Mon, 21 May 2001 23:53:23 GMT
Thanks to others' help, this is working for me (YMMV):

<property name="is.${os.name}" value="true"/>

<target name="init.win1" if="is.Windows NT" >
  <property name="javahome" value="d:\jdk1.3" />
  <property name="wlhome" value="d:\weblogic" />
  <property name="cvswork" value="d:\cvswork" />
  <property name="ejbjars" value="d:\EJBJarfiles" />
</target>

<target name="init.win2" if="is.Windows_NT" >
  <property name="javahome" value="d:\jdk1.3" />
  <property name="wlhome" value="d:\weblogic" />
  <property name="cvswork" value="d:\cvswork" />
  <property name="ejbjars" value="d:\EJBJarfiles" />
</target>

<target name="init.win3" if="is.Windows 2000" >
  <property name="javahome" value="d:\jdk1.3" />
  <property name="wlhome" value="d:\weblogic" />
  <property name="cvswork" value="d:\cvswork" />
  <property name="ejbjars" value="d:\EJBJarfiles" />
</target>

<target name="init.unix" if="is.SunOS" >
  <property name="javahome" value="/usr/local/jdk1.3" />
  <property name="wlhome" value="/usr/local/weblogic" />
  <property name="cvswork" value="~/cvswork" />
  <property name="ejbjars" value="~/EJBJarfiles" />
</target>

  <target name="init" depends="init.win1,init.win2,init.win3,init.unix">
    <tstamp>
      <format property="now" pattern="mmdd"/>
      <format property="DSTAMP" pattern="mm/dd/yyyy" /> 
    </tstamp>
  <echo message="Checking environment"/>
  <echo message="   OS = ${os.name}" />
  <echo message="   Java = ${javahome}" />
  <echo message="   Weblogic = ${wlhome}" />
  <echo message="   work dir = ${cvswork}" />
  <echo message="   ejbjars = ${ejbjars}" />
  <echo message="   version = ${vers}" />
  
  </target>

-----Original Message-----
From: Christopher Berry [mailto:christopher.berry@etrade.com]
Sent: Monday, May 21, 2001 4:46 PM
To: Ant-User (E-mail)
Subject: Setting a Unix vs Windows switch


Greetings,

The following build.xml -- running on a Windows 2000 box -- prints out::
     
      Installing on a Windows 2000 machine
      (is.Windows= ${is.Windows}) (is.Unix= true)
      (isWindows 2000= true)

Can anyone point to my error??? 
Thanks,
-- Chris 

=====================================
 <property name="is${os.name}" value="true"/>

 <target name="set_windows1" depends="init" if="${isWindows 2000}" >
    <property name="is.Windows" value="true" />
  </target>
  <target name="set_windows2" depends="set_windows1" if="${isWindows NT}" >
    <property name="is.Windows" value="true" />
  </target>
  <target name="set_windows3" depends="set_windows2" if="${isWindows 98}" >
    <property name="is.Windows" value="true" />
  </target>
  <target name="set_unix" depends="set_windows3" unless="${is.Windows}" >
    <property name="is.Unix" value="true" />
  </target>

  <target name="print_os" depends="set_unix">
    <echo>
      Installing on a ${os.name} machine  
      (is.Windows= ${is.Windows}) (is.Unix= ${is.Unix}) 
      (isWindows 2000= ${isWindows 2000})
    </echo>
  </target>

Chris Berry  --- christopher.berry@etrade.com  -- 512-323-9479

Mime
View raw message