> > I am working with a project that needs to work on both unix and
> > NT. Is there an easy way to set properties that will know their
> > platform?
>

Thanks all for your suggestions. This seems to be working well for me now,
thought I'd share it back:

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

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

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

  <target name="init" depends="init.win,init.unix">
  <echo message="Checking environment"/>
  <echo message="   OS = ${os.name}" />
  <echo message="   Home = ${user.home}" />
  <echo message="   Java = ${javahome}" />
  <echo message="   Weblogic = ${wlhome}" />
  </target>


Reply via email to