Hi,

There's always more than one way to do it eh? I tend to do similar using
props but from an overal build.properties something like

<property file="build.props">

<target name="unix" if="os.unix">...</target>
<target name="NT" if="os.nt">...</target>

and in the props file I have either

os.unix=1
or
os.nt=1

These two props files are mapped out into the same physical location via my
SCM (so the unix build gets ths unix version and the NT build gets the NT
version)


Bye,

Les
P.S. execon may also be of interes
P.P.S I guess you could even embed a <script> that does some funky hostname
based thing?

> -----Original Message-----
> From: Nico Seessle [mailto:[EMAIL PROTECTED]]
> Sent: 30 April 2001 23:15
> To: [EMAIL PROTECTED]
> Subject: Re: Platform specific targets???
> 
> 
> ----- Original Message -----
> From: "Bill Meyer" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, April 30, 2001 11:06 PM
> Subject: Platform specific targets???
> 
> 
> > Does anyone have an example of a target that is only executed on a
> specific
> > platform?
> >
> > For example-  I have a module of code that is JNI based and 
> I only want it
> > built on Unix.  There are no native binaries available on 
> Windows NT so it
> > wouldn't make sense to execute the target to build the JNI 
> code on NT,
> only
> > Unix.
> >
> 
> How do you want to detect "Unix"? If file separator == "/" is 
> enough for
> you, you might use something like:
> 
> <?xml version="1.0"?>
> <project name="PROJECT" default="test" basedir=".">
> 
>   <property name="pathSeparatorIs${file.separator}" value="1"/>
> 
>   <target name="test" depends="onlyOnDosWindows,onlyOnUnix"/>
> 
>   <target name="onlyOnDosWindows" if="pathSeparatorIs\">
>     <echo message="DOS/Windows"/>
>   </target>
> 
>   <target name="onlyOnUnix" if="pathSeparatorIs/">
>     <echo message="Unix"/>
>   </target>
> 
> </project>
> 
> Nico
> 
> 

Reply via email to