You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Eduardo B. Santilli - SICREDI Serviços" <sa...@sicredi.com.br> on 2002/08/06 14:22:27 UTC

if

Someone can give me an example that verify the OS, and if the OS is windows start an script else start another?

thanks.....


Eduardo B. Santilli 
Tecnologia - Programador
Sicredi Serviços
Telefone: (51) 3358-4700 Ramal: 858



Re: if

Posted by Stefan Bodewig <bo...@apache.org>.
On Tue, 6 Aug 2002, Geoff Meakin <ge...@isocra.com> wrote:

>   <condition property="isWindows" value="true">
>     <or>
>       <equals arg1="${os.name}" arg2="Windows NT"/>
>       <equals arg1="${os.name}" arg2="WindowsNT"/>
>       <equals arg1="${os.name}" arg2="Windows 2000"/>
>       <equals arg1="${os.name}" arg2="Windows 95"/>
>       <equals arg1="${os.name}" arg2="Windows 98"/>
>       <equals arg1="${os.name}" arg2="Windows ME"/>
>       <equals arg1="${os.name}" arg2="Windows NT"/>
>     </or>
>   </condition>

Why not

<condition property="isWindows" value="true">
  <os family="windows" />
</condition>

??

Stefan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: if

Posted by "Eduardo B. Santilli - SICREDI Serviços" <sa...@sicredi.com.br>.
yes!!! that´s it....thanks .....

----- Original Message -----
From: "Geoff Meakin" <ge...@isocra.com>
To: "Ant Users List" <an...@jakarta.apache.org>
Sent: Tuesday, August 06, 2002 9:59 AM
Subject: RE: if


You want to do something like this I would have thought
Bear in mind I haven't tested it, so you may have to do
some tweaking ;) This is just off the top of my head..

-Geoff


<target name="main" depends="checkos,firescript1,firescript2">
  your main stuff in here
</target>

<target name="checkos">
  <condition property="isWindows" value="true">
    <or>
      <equals arg1="${os.name}" arg2="Windows NT"/>
      <equals arg1="${os.name}" arg2="WindowsNT"/>
      <equals arg1="${os.name}" arg2="Windows 2000"/>
      <equals arg1="${os.name}" arg2="Windows 95"/>
      <equals arg1="${os.name}" arg2="Windows 98"/>
      <equals arg1="${os.name}" arg2="Windows ME"/>
      <equals arg1="${os.name}" arg2="Windows NT"/>
    </or>
  </condition>
</target>

<target name="firescript1" if="isWindows">
  execute windows script here
</target>

<target name="firescript2" unless="isWindows">
  execute non-windows script here
</target>





-----Original Message-----
From: Eduardo B. Santilli - SICREDI Serviços
[mailto:santilli@sicredi.com.br]
Sent: 06 August 2002 01:22 PM
To: ant-list
Subject: if


Someone can give me an example that verify the OS, and if the OS is windows
start an script else start another?

thanks.....


Eduardo B. Santilli
Tecnologia - Programador
Sicredi Serviços
Telefone: (51) 3358-4700 Ramal: 858




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: if

Posted by Geoff Meakin <ge...@isocra.com>.
You want to do something like this I would have thought
Bear in mind I haven't tested it, so you may have to do
some tweaking ;) This is just off the top of my head..

-Geoff


<target name="main" depends="checkos,firescript1,firescript2">
  your main stuff in here
</target>

<target name="checkos">
  <condition property="isWindows" value="true">
    <or>
      <equals arg1="${os.name}" arg2="Windows NT"/>
      <equals arg1="${os.name}" arg2="WindowsNT"/>
      <equals arg1="${os.name}" arg2="Windows 2000"/>
      <equals arg1="${os.name}" arg2="Windows 95"/>
      <equals arg1="${os.name}" arg2="Windows 98"/>
      <equals arg1="${os.name}" arg2="Windows ME"/>
      <equals arg1="${os.name}" arg2="Windows NT"/>
    </or>
  </condition>
</target>

<target name="firescript1" if="isWindows">
  execute windows script here
</target>

<target name="firescript2" unless="isWindows">
  execute non-windows script here
</target>





-----Original Message-----
From: Eduardo B. Santilli - SICREDI Serviços
[mailto:santilli@sicredi.com.br]
Sent: 06 August 2002 01:22 PM
To: ant-list
Subject: if


Someone can give me an example that verify the OS, and if the OS is windows
start an script else start another?

thanks.....


Eduardo B. Santilli
Tecnologia - Programador
Sicredi Serviços
Telefone: (51) 3358-4700 Ramal: 858




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>