Or do what I do. I have a per environment props file (build.properties) that
my SCM maps out into $basedir/conf/build.properties on all systems
(different files per system).

I then just have to do a <property file="${basedir}/conf/build.properties"/>
and the correct props for the platform are automagically made available.

Les.

> -----Original Message-----
> From: Stefan Bodewig [mailto:[EMAIL PROTECTED]]
> Sent: 10 May 2001 07:26
> To: [EMAIL PROTECTED]
> Subject: Re: Cross-platform properties?
> 
> 
> Mark Jaffe <[EMAIL PROTECTED]> wrote:
> 
> > I am working with a project that needs to work on both unix and
> > NT. IUs there an easy way to set properties that will know their
> > platform?
> 
> Yes, use property tasks inside of targets that will only be executed
> on the appropriate OS.  Using a very Unix simple heuristic (everything
> that doesn't have a C:\config.sys is Unix, everything that does is
> Windows) this would look like
> 
> <target name="os-check">
>   <available property="win" file="C:\config.sys" />
> </target>
> 
> <target name="set-for-windows" depends="os-check" if="win">
>   <property name="home" value="c:\winnt\profiles\user" />
> </target>
> 
> <target name="set-for-unix" depends="os-check" unless="win">
>   <property name="home" value="/home/user" />
> </target>
> 
> <target name="set" depends="set-for-windows,set-for-unix" />
> 
> Stefan
> 
> PS: You are not trying to reinvent ${user.home}, are you?
> 

Reply via email to