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 閱讀(306) 評論(0)  編輯  收藏 所屬分類: Java
          主站蜘蛛池模板: 巫山县| 保德县| 丹凤县| 蛟河市| 阳曲县| 囊谦县| 巢湖市| 叙永县| 合江县| 瑞丽市| 工布江达县| 凤阳县| 盐源县| 元谋县| 邻水| 新疆| 蓬莱市| 祁东县| 衢州市| 湖口县| 黔南| 达孜县| 广安市| 永丰县| 忻州市| 千阳县| 高州市| 左权县| 桂东县| 扬州市| 武定县| 深州市| 祁阳县| 拜城县| 宜丰县| 许昌市| 白河县| 清河县| 建湖县| 屏南县| 颍上县|