ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cornellious Mann <cornerm...@yahoo.com>
Subject Re: Setting a property based on the OS
Date Mon, 20 Aug 2001 19:22:19 GMT
Another possible way to do this in version 1.3 would
be to set up a different property for each OS, and
then test for the existence of that property.

Your command line would read...

... -Dlinux=true ...
or
... -Dwindows=true ...

The value after the property ("true") would only exist
for documentation and wouldn't be used.

In Ant you would then code...

<target name="processLinux" if="linux">
    ...
</target>

<target name="processWindows" if="windows">
    ...
</target>

<target name="processOS">
    <antcall target="processLinux"/>
    <antcall target="processWindows"/>
</target>


--- Stefan Bodewig <bodewig@apache.org> wrote:
> On Mon, 20 Aug 2001, Kurien Mathew
> <kurien@envivio.com> wrote:
> 
> > Is it possible to set a property based on the OS?
> 
> > redist
> >  |- win32
> >  |- mac
> >  |- linux
> > 
> 
> Using 1.4beta
> 
> <condition property="redistdir"
> value="redist/win32">
>   <os family="windows" />
> </condition>
> <condition property="redistdir" value="redist/mac">
>   <os family="mac" />
> </condition>
> <condition property="redistdir"
> value="redist/linux">
>   <equals arg1="${os.name}" arg2="Linux" />
> </condition>
> 
> Stefan


=====
Regards,
Cornellious Mann

__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

Mime
View raw message