0

I have a bat file and shell script which performs the same operation. Now i have create a ant build.xml file which would execute the shell script or bat file. How should i write my build.xml or how should i configure it ?

kittudk
  • 55
  • 3
  • 14

1 Answers1

0

Option 1: Use conditional targets

<condition property="windowsos">
  <os family="windows" />
</condition>

<condition property="linuxos">
  <os family="unix" />
</condition>

<target name="go" depends="go-windows,go-linux"/>

<target name="go-windows" if="windosos">
..
..
</target>

<target name="go-linux" if="windosos">
..
..
</target>

Option 2: Use conditional exec task

<target name="go">
  <exec executable="doSomthing.exe" osfamily="windows"/>

  <exec executable="doSomthing" osfamily="unix"/>
</target>
Mark O'Connor
  • 76,015
  • 10
  • 139
  • 185