Intended for Windows users taking Java EIM related courses. Also refer to the original Ant installation instruction.
c:\temp>ant -version
build.xml
<project name="testproject" default="usage" basedir=".">
<target name="usage" description="Message on how to use Ant buildfiles">
<echo>Please use the 'build -projecthelp' to see a list of available build targets.</echo>
</target>
<target name="clean" description="Removes build artifacts">
<delete dir="build" failonerror = "false"/>
</target>
<target name="init" depends="clean" description="Creates the directory structure for a simple Java project">
<mkdir dir="build"/>
</target>
<target name="compile" depends="init"
description="Compiles the sources">
<echo level="info">Compiling files</echo>
<javac srcdir="src"
destdir="build"
debug="true"
source="1.5"
target="1.5"/>
</target>
<target name="run">
<java classname="Hello"
fork="true"
classpath="build">
</java>
</target>
</project>
Run the following commands in a DOS window:
c:\temp>ant ... c:\temp>ant -projecthelp ... c:\temp>ant compile ... c:\temp>ant run ...
These should display