ant copy move
<?xml version="1.0" encoding="GB2312"?>
<project default="jar" basedir=".">
<property name="complie" value="complie"></property>
<property name="dist" value="dist"></property>
<property name="xiaolei" value="xiaolei"></property>
<target name="mk">
<mkdir dir="${complie}"/>
<mkdir dir="${dist}"/>
<mkdir dir="${xiaolei}"/>
</target>
<target name="myComplie" depends="mk">
<javac srcdir="src" destdir="${complie}" debug="true"></javac>
</target>
<target name="jar" depends="myComplie">
<!--获取当前时间-->
<tstamp/>
<!--引用时间-->
<jar destfile="${dist}/user-${TSTAMP}.jar" basedir="${complie}">
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Main-Class" value="cn.lxl.innerclass.test3"/>
</manifest>
</jar>
</target>
<target name="del">
<!--删除单个文件-->
<delete file="${dist}/user.jar"></delete>
</target>
<target name="copy" depends="mk">
<!--copy文件到另一个目录下面,指定文件名-->
<copy file="src/cn/lxl/innerclass/Test3.java" tofile="${xiaolei}/Test3.java"></copy>
<!--在源路径中修改文件名-->
<move file="src/cn/lxl/innerclass/Test3.java" tofile="src/cn/lxl/innerclass/Test13.java"></move>
<!--移动文件到另一个目录-->
<copy file="src/cn/lxl/innerclass/Test13.java" todir="${xiaolei}"></copy>
</target>
</project>
本文出自 “Jxiaolei” 博客
补充:软件开发 , Java ,