ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Les Hughes <leslie.hug...@rubus.com>
Subject RE: Platform specific targets???
Date Wed, 02 May 2001 08:43:21 GMT

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:nico@apache.org]
> Sent: 30 April 2001 23:15
> To: ant-user@jakarta.apache.org
> Subject: Re: Platform specific targets???
> 
> 
> ----- Original Message -----
> From: "Bill Meyer" <BMeyer@HNS-NET.com>
> To: <ant-user@jakarta.apache.org>
> 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
> 
> 

Mime
View raw message