Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/unix/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何构建build.xml文件以运行bat文件或shell脚本_Shell_Unix_Batch File_Ant_Antbuilder - Fatal编程技术网

如何构建build.xml文件以运行bat文件或shell脚本

如何构建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

我有一个执行相同操作的bat文件和shell脚本。现在我已经创建了一个ant build.xml文件,它将执行shell脚本或bat文件。我应该如何编写build.xml或如何配置它?

选项1:使用条件目标

..
..
..
..
选项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>