Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.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
Ant 如何实现蚂蚁目标?_Ant - Fatal编程技术网

Ant 如何实现蚂蚁目标?

Ant 如何实现蚂蚁目标?,ant,Ant,我希望能够让不同的目标做几乎相同的事情,因此: ant build <- this would be a normal (default) build ant safari <- building the safari target. ant build我的第一次尝试(目前无法测试): 奇怪的错误消息会有帮助,就像你在macrodef上的射击一样。必须将crater.mymacro放在其他目标之前,但除此之外,它工作得非常好!谢谢 <target name="buil

我希望能够让不同的目标做几乎相同的事情,因此:

ant build   <- this would be a normal (default) build
ant safari  <- building the safari target.
ant build我的第一次尝试(目前无法测试):



奇怪的错误消息会有帮助,就像你在
macrodef
上的射击一样。必须将crater.mymacro放在其他目标之前,但除此之外,它工作得非常好!谢谢
<target name="build" depends="javac" description="GWT compile to JavaScript">
  <java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler">
    <classpath>
      <pathelement location="src"/>
      <path refid="project.class.path"/>
    </classpath>
    <jvmarg value="-Xmx256M"/>
    <arg value="${lhs.target}"/>
  </java>
</target>

<target name="safari" depends="javac" description="GWT compile to Safari/JavaScript">
  <java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler">
    <classpath>
      <pathelement location="src"/>
      <path refid="project.class.path"/>
    </classpath>
    <jvmarg value="-Xmx256M"/>
    <arg value="${lhs.safari.target}"/>
  </java>
</target>
<target name="build" depends="javac, create.mymacro" description="GWT compile to JavaScript">
  <mymacro target="${lhs.target}"/>
</target>

<target name="safari" depends="javac, create.mymacro" description="GWT compile to Safari/JavaScript">
  <mymacro target="${lhs.safari.target}"/>
</target

<target name="create.mymacro">
  <macrodef name="mymacro">
    <attribute name="target" default="${lhs.target}"/>
    <sequential>
      <java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler">
        <classpath>
          <pathelement location="src"/>
          <path refid="project.class.path"/>
        </classpath>
        <jvmarg value="-Xmx256M"/>
        <arg value="@{target}"/>
     </java>
    </sequential>
  </macrodef>
</target>