Ant入门

<?xml version="1.0" encoding="UTF-8"?>
<project name="myAnt" default="init" basedir=".">

<target name="init">
</target>

<target name="preprocess">
<mkdir dir="compileFile"/>
</target>

<!-- 自定义标签 -->
<taskdef name="fileSorter" classname="com.kk.ant.FileSorter" classpath="."></taskdef>

<target name="package" depends="preprocess,myCompile">
<!--获取当前时间-->
<tstamp></tstamp>
<jar destfile="package-${DSTAMP}.jar" basedir="compileFile"></jar>
<delete dir="compileFile"></delete>
<move file="s.zx" tofile="vm.sz"></move>
</target>


<target name="myCompile">
<javac srcdir="com" destdir="compileFile"></javac>
</target>

<target name="zip">
<zip destfile="package.zip" basedir="com"></zip>
<unzip dest="com2" src="package.zip"></unzip>
</target>

<target name="copy2">
<copy todir="zx">
<fileset dir="com">
<!--递归复制文件夹下的所有.java文件-->
<include name="**/*.java"/>
</fileset>
</copy>
</target>

<target name="sort">
<fileSorter srcfile="1.txt" destfile="2.txt"/>
</target>

</project>



posted @ 2011-12-28 14:59  microsoft_kk  阅读(255)  评论(0编辑  收藏  举报