HelloWorld_build_ant.xml
- click here to view the contents so you can view the contents and
cut-n-paste if needed. Here is a repeat of the contents of the
file for your viewing, but I suggest clicking the link above!
<project name="HelloWorld" basedir="."
default="main">
<property name="src.dir" value="src"/>
<property name="srcfp_firststeps.dir" value="src/firststeps/_vti_cnf"
description="FrontPage publishing directory."/>
<property name="build.dir" value="build"/>
<property name="classes.dir" value="${build.dir}/classes"/>
<property name="jar.dir" value="${build.dir}/jar"/>
<property name="main-class" value="firststeps.HelloWorld1"/>
<target name="clean" description="Deletes directories that
the build will create.">
<delete dir="${build.dir}"/>
<delete dir="${srcfp_firststeps.dir}" description="FrontPage
publishing directory. Errors if it's not deleted!" />
</target>
<target name="compile" description="Compiles all .java
files.">
<mkdir dir="${classes.dir}"/>
<javac srcdir="${src.dir}" destdir="${classes.dir}"/>
</target>
<target name="jar" depends="compile"
description="Creates the JAR file with a Main-Class.">
<mkdir dir="${jar.dir}"/>
<jar destfile="${jar.dir}/${ant.project.name}.jar" basedir="${classes.dir}">
<manifest>
<attribute name="Main-Class"
value="${main-class}"/>
</manifest>
</jar>
</target>
<target name="run" depends="jar" description="Runs
the main-class in the JAR file.">
<java jar="${jar.dir}/${ant.project.name}.jar" fork="true"/>
</target>
<target name="clean-build" depends="clean,jar"
description="Could clean up!"/>
<target name="main" depends="clean,run"/>
</project>
|