最基础的 ant build 脚本,根据项目,自行进行修改
<?xml version="1.0" encoding="UTF-8" ?> <project name="xstreamTest" default="run" basedir="."> <property name="src" value="src" /> <property name="lib" value="lib" /> <property name="dest" value="bin" /> <property name="jar" value="xstreamTest.jar" /> <target name="init"> </target> <target name="compile" depends="init"> <javac srcdir="${src}" destdir="${dest}" /> </target> <target name="build" depends="compile"> <jar jarfile="${jar}" basedir="${dest}" /> </target> <target name="run" depends="build"> </target> <target name="clean"> <delete dir="${dest}" /> <delete file="${jar}" /> </target> <target name="rerun" depends="clean,run"> <ant target="clean" /> <ant target="run" /> </target> </project>