Ant 学习(二)

这是一个我自己写的Ant脚本,编绎7000多个源文件,大概就是一分钟吧。

<?xml version="1.0" encoding="UTF-8"?>

<project name="prpall" default="init" basedir=".">

<property name="src" value="component" />

<property name="dest" value="c://classes" />

<path id="dependlib">

<pathelement path="${ant.path}"/>

<fileset dir="webapps/WEB-INF/lib">

<include name="*.jar"/>

</fileset>

<pathelement path="${dest}"/>

</path>

 

<path id="jdk.path">

<pathelement location="E:\JavaWebServer\jdk142_05\jre\lib\rt.jar" />

<pathelement location="E:\JavaWebServer\jdk142_05\jre\libr" />

<pathelement location="E:\JavaWebServer\jdk142_05\lib\tools.jar" />

</path>

 

<path id="ant.path">

    <path refid="jdk.path" />

    <fileset dir="D:\apache-ant-1.8.2-bin\apache-ant-1.8.2\lib">

    <include name="*.jar"/>

    </fileset>

</path>

 

<target name="init">

<mkdir dir="${dest}" />

<echo message="${java.version}" />

</target>

 

<target name="build" depends="init">

<javac srcdir="${src}" destdir="${dest}" debug="true" source="1.4" target="1.4"

    fork="true" memoryMaximumSize="512M" includeantruntime="on" listfiles="true"

executable="E:\JavaWebServer\jdk142_05\bin\javac" compiler="javac1.4">

 

 <compilerarg line="-encoding GBK" />

 <classpath refid="dependlib"></classpath>

 </javac>

</target>

<target name="clean">

 <delete dir="${dest}" />

</target>

 

<target name="rebuild">

 <ant target="clean" />

 <ant target="build" />

</target>

</project>


posted on 2011-06-15 13:36  画一个圆圈  阅读(144)  评论(0编辑  收藏  举报

导航