Java/Ant/Delete Clean
Ant: Remove all generated files
<?xml version="1.0"?>
<project name="Template Buildfile" default="compile" basedir=".">
<property name="dir.src" value="src"/>
<property name="dir.build" value="build"/>
<property name="dir.dist" value="dist"/>
<!-- Creates the output directories -->
<target name="prepare">
<mkdir dir="${dir.build}"/>
<mkdir dir="${dir.dist}"/>
</target>
<target name="clean"
description="Remove all generated files.">
<delete dir="${dir.build}"/>
<delete dir="${dir.dist}"/>
</target>
<target name="compile" depends="prepare"
description="Compile all source code.">
<javac srcdir="${dir.src}" destdir="${dir.build}"/>
</target>
<target name="jar" depends="compile"
description="Generates jexp.jar in the "dist" directory.">
<jar jarfile="${dir.dist}/jexp.jar"
basedir="${dir.build}"/>
</target>
</project>
Ant target: clean
<?xml version="1.0"?>
<project name="sample" default="test" basedir=".">
<target name="compile">
<mkdir dir="build"/>
<javac destdir="build"
debug="on"
optimize="on">
<src path="src"/>
</javac>
</target>
<target name="test" depends="compile">
<java fork="no" failonerror="yes"
classname="test.TestSample"
classpath="build">
<arg line=""/>
</java>
</target>
<target name="clean">
<delete dir="build"/>
</target>
</project>