ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geoff Meakin" <>
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..


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

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

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

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

-----Original Message-----
From: Eduardo B. Santilli - SICREDI Servi├žos
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?


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

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message