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 ?
Asked
Active
Viewed 1,332 times
1 Answers
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