ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geoff Meakin" <geo...@isocra.com>
Subject RE: if
Date Tue, 06 Aug 2002 12:59:24 GMT
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:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message