<?xml version="1.0" encoding="UTF-8" ?>
<project name="AntTestDemo" default="run" basedir=".">
<property name="src" value="src"/>
<property name="dest" value="classes"/>
<property name="helloant_jar" value="helloant.jar"/>
<target name="init">
<mkdir dir="${dest}"/>
</target>
<target name="compile" depends="init">
<javac srcdir="${src}" destdir="${dest}"/>
</target>
<target name="build" depends="compile">
<jar jarfile="${helloant_jar}" basedir="${dest}"/>
</target>
<target name="run" depends="build">
<java classname="com.zdz.ant.test.HelloAnt" classpath="${helloant_jar}"/>
</target>
<target name="clean">
<delete dir="${dest}" />
<delete file="${helloant_jar}" />
</target>
<target name="rerun" depends="clean,run">
<ant target="clean" />
<ant target="run" />
</target>
</project>
<project name="AntTestDemo" default="run" basedir=".">
<property name="src" value="src"/>
<property name="dest" value="classes"/>
<property name="helloant_jar" value="helloant.jar"/>
<target name="init">
<mkdir dir="${dest}"/>
</target>
<target name="compile" depends="init">
<javac srcdir="${src}" destdir="${dest}"/>
</target>
<target name="build" depends="compile">
<jar jarfile="${helloant_jar}" basedir="${dest}"/>
</target>
<target name="run" depends="build">
<java classname="com.zdz.ant.test.HelloAnt" classpath="${helloant_jar}"/>
</target>
<target name="clean">
<delete dir="${dest}" />
<delete file="${helloant_jar}" />
</target>
<target name="rerun" depends="clean,run">
<ant target="clean" />
<ant target="run" />
</target>
</project>