Convert Makefile content to Apache Ant

淺唱寂寞╮ 提交于 2019-12-25 05:07:08

问题


What would be the syntax in 'build.xml' of an Ant build system that corresponds to the following content of a Makefile (GNU Make):

target: dependency0 dependency1
     shell command 1  # Not java, cc or the like
     shell command 2
     shell command 3

回答1:


Example

$ ant

dependency0:
     [echo] Hello world one

dependency1:
     [echo] Hello world two

build:
     [exec] command 1
     [exec] command 2
     [exec] command 3

build.xml

<project name="demo" default="build">

  <target name="dependency0">
    <echo>Hello world one</echo>
  </target>

  <target name="dependency1">
    <echo>Hello world two</echo>
  </target>

  <target name="build" depends="dependency0,dependency1">
    <exec executable="echo">
      <arg line="command 1"/>
    </exec>
    <exec executable="echo">
      <arg line="command 2"/>
    </exec>
    <exec executable="echo">
      <arg line="command 3"/>
    </exec>
  </target>

</project>


来源:https://stackoverflow.com/questions/43633442/convert-makefile-content-to-apache-ant

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!