build.xml模板

来源:互联网 发布:剿灭伊斯兰国 知乎 编辑:程序博客网 时间:2024/05/16 01:08
 
<?xml version="1.0" encoding="UTF-8"?>

<project name="Test" default="dist" basedir="."> 

<!-- set global properties for this build -->
<property name="src" value="."/>
<property name="build" value="build"/>
<property name="dist" value="dist"/> 

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

<target name="compile" depends="init">
<!-- Compile the java code from ${src} into ${build} -->
<javac srcdir="${src}" destdir="${build}">
<!-- the libraries needed  -->    
    
<classpath>
    
<fileset dir="lib">
     
<include name="**/*.jar"/>
    
</fileset>
    
</classpath>    
</javac>
</target>

<target name="dist" depends="compile">
<!-- Create the distribution directory -->
<mkdir dir="${dist}/lib"/>
<!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file -->
<jar jarfile="${dist}/lib/MyProject-${DSTAMP}.jar" basedir="${build}"/>
</target>

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

</target>

</project>


原创粉丝点击