java Source

            BlogJava :: 首頁 :: 聯系 :: 聚合  :: 管理
            14 Posts :: 24 Stories :: 8 Comments :: 0 Trackbacks
          ANT
           Ant的構建文件是用XML編寫的與大多數實際應用中的構建文件相比,它要簡單一些,但確實能夠說明幾乎每個Java 工程所需的一些核心概念。

          <?xml version="1.0"?>
          <!-- build.xml - a simple Ant buildfile -->
          <project name="Simple Buildfile" default="compile" basedir=".">
          <!-- The directory containing source code -->
          <property name="src.dir" value="src"/>
          <!-- Temporary build directories -->
          <property name="build.dir" value="build"/>
          <property name="build.classes" value="${build.dir}/classes"/>
          <property name="build.lib" value="${build.dir}/lib"/>
          <!-- Target to create the build directories prior to the -->
          <!-- compile target. -->
          <target name="prepare">
          <mkdir dir="${build.dir}"/>
          <mkdir dir="${build.classes}"/>
          <mkdir dir="${build.lib}"/>
          </target>
          <target name="clean" description="Removes all generated files.">
          <delete dir="${build.dir}"/>
          </target>
          <target name="compile" depends="prepare"
          description="Compiles all source code.">
          <javac srcdir="${src.dir}" destdir="${build.classes}"/>
          </target>
          <target name="jar" depends="compile"
          description="Generates test.jar in the 'dist' directory.">
          <!-- Exclude unit tests from the final JAR file -->
          <jar jarfile="${build.lib}/oreilly.jar"
          basedir="${build.classes}"
          excludes="**/*Test.class"/>
          </target>
          <target name="all" depends="clean,jar"
          description="Cleans, compiles, then builds the JAR file."/>
          </project>
          posted on 2005-11-15 14:12 JustinLei 閱讀(301) 評論(0)  編輯  收藏 所屬分類: Java
          主站蜘蛛池模板: 泰兴市| 镇坪县| 会同县| 东丽区| 务川| 文登市| 翼城县| 西吉县| 宣城市| 富顺县| 开阳县| 达尔| 万荣县| 泗洪县| 新安县| 布拖县| 泸西县| 玉田县| 庄河市| 巴彦淖尔市| 赣州市| 黄山市| 三河市| 社会| 贵州省| 雅江县| 彭州市| 禹城市| 昌黎县| 博客| 南华县| 修水县| 徐水县| 茌平县| 呼伦贝尔市| 理塘县| 三江| 隆化县| 浮梁县| 从江县| 吉木乃县|