ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kris Read <kris.r...@gmail.com>
Subject Re: Cross-Platform Exec Task
Date Fri, 29 Oct 2004 06:14:23 GMT
Perhaps you can use this information to help: 

In the "Condition" task one of the supported conditions is "os". 

os: 

Test whether the current operating system is of a given type. Each
defined attribute is tested and the result is true only if all the
tests succeed.

family : The name of the operating system family to expect.
name : The name of the operating system to expect.
arch : The architecture of the operating system to expect.
version : The version of the operating system to expect.

Perhaps "family" is what you are looking for.  Families can be unix or
windows. You do not need to specify exactly what the OS is for each
windows or unix variant.

--
Kris




On Thu, 28 Oct 2004 18:45:04 -0500, Satish Jeejula
<satish_jeejula@irco.com> wrote:
> Hi All,
> 
> I am trying to write a target that calls an different executable
> depending upon the operating system it is running on. For example, this
> is my intention.
> 
> <target name="runExecutable">
> 
>             <!-on windows 2000 or XP -->
>         <exec executable="executable.bat" />
> 
>             <!-on UNIX Solaris or AIX -->
>         <exec executable="executable.sh" />
> 
> </target>
> 
> I can't include element "os" in the "exec" .
> 
> if I have to use 'os' attribute in the 'exec', I have provide correct
> value to it and redundant code is the result. This is what I am doing
> right now.
> 
> <target name="runExecutable">
> 
>             <!-on windows 2000 -->
>         <exec executable="executable.bat" os="Windows XP" />
> 
>             <!-on windows XP -->
>         <exec executable="executable.bat"  os="Windows 2000"/>
> 
>             <!-on UNIX Solaris -->
>         <exec executable="executable.sh" os="SunOS"/>
> 
>             <!-on UNIX AIX -->
>         <exec executable="executable.sh" os="Aix"/>
> 
> </target>
> 
>  Is there any way to generalize it?
> 
> Thanks,
> Satish
> 
> -----------------------------------------
> The information contained in this message is privileged and intended only
> for the recipients named. If the reader is not a representative of the
> intended recipient, any review, dissemination or copying of this message or
> the information it contains is prohibited. If you have received this
> message in error, please immediately notify the sender, and delete the
> original message and attachments.
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message