zoukankan      html  css  js  c++  java
  • 如何在ant里import

    http://hi.baidu.com/fangpw/blog/item/78cfe7fcf7988a8cb801a0ec.html

        <!--[endif]-->Import

    <antcall>和<marcodef>可以达到类似函数的效果,但是调用者和被调用者还是必须在同一个文件中。Ant从1.6开始引入Import Task,可以真正的实现代码重用:属性,Task 定义,Task, Macro。一个简单的例子:

    common.xml:

    <?xml version="1.0" ?>

    <project>

           <property name="project.name" value="Ant Modulazation" />

           <target name="commonTarget">

                  <echo message="${test.param}" />

           </target>

          

           <macrodef name="showModule">

                <attribute name="test.param" default="NOT SET"/>

                <sequential>

                     <echo message="@{test.param}" />

                </sequential>

           </macrodef>

    </project>

    call.xml:

    <?xml version="1.0" ?>

    <project name="testCommon" default="callingTarget">

           <import file="common.xml" />

          

           <target name="callingTarget">

                  <antcall target="commonTarget">

                         <param name="test.param" value="Modulation" />

                  </antcall>

           </target>

           <target name="testMacro">

                  <showModule test.param="Modulation" />

           </target>

    </project>

  • 相关阅读:
    JavaScript.how-to-debug-javascript
    iOS.mach_absolute_time
    Startup.国外新锐公司及其技术Blog
    Android.FamousBlogs
    iOS.PrototypeTools
    Android.API.Context.getFilesDir()
    Android.Tools.Ant
    Tools.OnlineAPIs
    Java.Class
    Android.StructureOfAndroidSourceCodeRootTree
  • 原文地址:https://www.cnblogs.com/balaamwe/p/2383385.html
Copyright © 2011-2022 走看看