如何构建build.xml文件以运行bat文件或shell脚本
我有一个执行相同操作的bat文件和shell脚本。现在我已经创建了一个ant build.xml文件,它将执行shell脚本或bat文件。我应该如何编写build.xml或如何配置它?选项1:使用条件目标如何构建build.xml文件以运行bat文件或shell脚本,shell,unix,batch-file,ant,antbuilder,Shell,Unix,Batch File,Ant,Antbuilder,我有一个执行相同操作的bat文件和shell脚本。现在我已经创建了一个ant build.xml文件,它将执行shell脚本或bat文件。我应该如何编写build.xml或如何配置它?选项1:使用条件目标 .. .. .. .. 选项2:使用条件exec任务 <condition property="windowsos"> <os family="windows" /> </condition> <condition property="l
..
..
..
..
选项2:使用条件exec任务
<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>
<target name="go">
<exec executable="doSomthing.exe" osfamily="windows"/>
<exec executable="doSomthing" osfamily="unix"/>
</target>