2023-10-03 19:38:48 +00:00
|
|
|
<?xml version="1.0"?>
|
2023-10-03 20:14:42 +00:00
|
|
|
<project name="HelloWorld" basedir="." default="main">
|
2023-10-03 19:38:48 +00:00
|
|
|
|
|
|
|
<property name="src.dir" value="src"/>
|
|
|
|
<property name="build.dir" value="build"/>
|
|
|
|
<property name="jar.dir" value="${build.dir}/jar"/>
|
|
|
|
<property name="classes.dir" value="${build.dir}/classes"/>
|
2023-10-03 20:14:42 +00:00
|
|
|
<property name="lib.dir" value="lib"/>
|
2023-10-03 19:38:48 +00:00
|
|
|
|
|
|
|
<property name="main-class" value="hbb.HelloWorld"/>
|
|
|
|
|
2023-10-03 20:14:42 +00:00
|
|
|
<path id="classpath">
|
|
|
|
<fileset dir="${lib.dir}" includes="**/*.jar"/>
|
|
|
|
</path>
|
|
|
|
<path id="application" location="${jar.dir}/${ant.project.name}.jar"/>
|
|
|
|
|
2023-10-03 19:38:48 +00:00
|
|
|
<target name="clean">
|
|
|
|
<delete dir="${build.dir}"/>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="compile">
|
|
|
|
<mkdir dir="${classes.dir}"/>
|
2023-10-03 20:14:42 +00:00
|
|
|
<javac srcdir="src" destdir="${classes.dir}" classpathref="classpath"/>
|
2023-10-03 19:38:48 +00:00
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="jar" depends="compile">
|
|
|
|
<mkdir dir="${jar.dir}"/>
|
|
|
|
<jar destfile="${jar.dir}/HelloWorld.jar" basedir="${classes.dir}">
|
|
|
|
<manifest>
|
|
|
|
<attribute name="Main-Class" value="${main-class}"/>
|
|
|
|
</manifest>
|
|
|
|
</jar>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="run" depends="jar">
|
2023-10-03 20:14:42 +00:00
|
|
|
<java fork="true" classname="${main-class}">
|
|
|
|
<classpath>
|
|
|
|
<path refid="classpath"/>
|
|
|
|
<path location="${jar.dir}/${ant.project.name}.jar"/>
|
|
|
|
</classpath>
|
|
|
|
</java>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="junit" depends="jar">
|
|
|
|
<junit printsummary="yes">
|
|
|
|
<classpath>
|
|
|
|
<path refid="classpath"/>
|
|
|
|
<path refid="application"/>
|
|
|
|
</classpath>
|
|
|
|
<batchtest fork="yes">
|
|
|
|
<fileset dir="${src.dir}" includes="**/*Test.java"/>
|
|
|
|
</batchtest>
|
|
|
|
</junit>
|
2023-10-03 19:38:48 +00:00
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="clean-build" depends="clean,jar"/>
|
|
|
|
|
|
|
|
<target name="main" depends="clean,run"/>
|
|
|
|
|
|
|
|
</project>
|
|
|
|
<!-- vim:set sts=2 sw=2 et: -->
|