首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > XML SOAP >

ant击jar包的xml示例

2012-10-29 
ant打jar包的xml示例project namewztTest defaultdist basedir.??? description??????? simp

ant打jar包的xml示例

<project name="wztTest" default="dist" basedir=".">
??? <description>
??????? simple example build file
??? </description>
? <!-- set global properties for this build -->
? <property name="src" location="src"/>
? <property name="build" location="build"/>
? <property name="bin" location="bin"/>
? <property name="dist"? location="dist"/>

?<!-- 引用用到的jar -->
?<path id="classpath">?
??????? <fileset dir="lib">
????????? <include name="*.jar"/>
??????? </fileset>
??? </path>

?
? <target name="init">
??? <!-- Create the build directory structure used by compile -->
??? <mkdir dir="${build}"/>

? </target>

? <target name="compile" depends="init" description="compile the source " >
? ?<!-- 这里拷贝bin目录下所有文件,目的是将除class之外的文件都拷贝(因为打jar包时ant只会拷贝class文件),如xml文件,properties文件等 -->
? ?<copy todir="${build}">
?? ?<fileset dir="${bin}">
?? ?</fileset>
? ?</copy>
? ?
? ?<!-- Compile the java code from ${src} into ${build} -->
??? <javac srcdir="${src}" destdir="${build}">
??? ?<classpath refid="classpath"/>??
? ?</javac>
? ?
? </target>

? <target name="dist" depends="compile"
??????? description="generate the distribution" >

??? <!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file -->
??? <jar jarfile="wztTest.jar" basedir="${build}"/>
? </target>

?

<target name="clean" description="clean up" >
???? <!-- Delete the ${build} and ${dist} directory trees -->
???? <delete dir="${build}"/>
?</target>


</project>

?

热点排行