1 | <project name="Census" >
|
---|
2 |
|
---|
3 | <property name="src.dir" value="src"/>
|
---|
4 | <property name="lib.dir" value="lib" />
|
---|
5 | <property name="build.dir" value="build"/>
|
---|
6 | <property name="classes.dir" value="${build.dir}/classes"/>
|
---|
7 | <property name="jar.dir" value="${build.dir}/jar"/>
|
---|
8 | <property name="report.dir" value="${build.dir}/junitreport"/>
|
---|
9 |
|
---|
10 | <property name="javac.includeAntRuntime" value="false" />
|
---|
11 | <property name="main-class" value="nl.rickvanderzwet.toos.assignment1.Census" />
|
---|
12 |
|
---|
13 |
|
---|
14 | <path id="classpath">
|
---|
15 | <fileset dir="${lib.dir}" includes="**/*.jar"/>
|
---|
16 | </path>
|
---|
17 | <path id="application" location="${jar.dir}/${ant.project.name}.jar" />
|
---|
18 |
|
---|
19 |
|
---|
20 | <target name="clean">
|
---|
21 | <delete dir="${build.dir}"/>
|
---|
22 | </target>
|
---|
23 |
|
---|
24 | <target name="compile">
|
---|
25 | <mkdir dir="${classes.dir}"/>
|
---|
26 | <javac srcdir="${src.dir}" destdir="${classes.dir}"
|
---|
27 | includeAntRuntime="${javac.includeAntRuntime}" classpathref="classpath">
|
---|
28 |
|
---|
29 | <compilerarg value="-Xlint:unchecked" />
|
---|
30 | </javac>
|
---|
31 | <copy todir="${classes.dir}">
|
---|
32 | <fileset dir="${src.dir}" excludes="**/*.java"/>
|
---|
33 | </copy>
|
---|
34 | </target>
|
---|
35 |
|
---|
36 | <target name="jar" depends="compile">
|
---|
37 | <mkdir dir="${jar.dir}"/>
|
---|
38 | <jar destfile="${jar.dir}/${ant.project.name}.jar" basedir="${classes.dir}">
|
---|
39 | <manifest>
|
---|
40 | <attribute name="Main-Class" value="${main-class}" />
|
---|
41 | </manifest>
|
---|
42 | </jar>
|
---|
43 | </target>
|
---|
44 |
|
---|
45 | <target name="run" depends="clean, jar">
|
---|
46 | <java fork="true" classname="${main-class}">
|
---|
47 | <classpath>
|
---|
48 | <path refid="classpath" />
|
---|
49 | <path refid="application"/>
|
---|
50 | </classpath>
|
---|
51 | </java>
|
---|
52 | </target>
|
---|
53 |
|
---|
54 | <target name="junit" depends="jar">
|
---|
55 | <mkdir dir="${report.dir}" />
|
---|
56 | <junit printsummary="yes">
|
---|
57 | <classpath>
|
---|
58 | <path refid="classpath"/>
|
---|
59 | <path refid="application"/>
|
---|
60 | </classpath>
|
---|
61 |
|
---|
62 | <formatter type="xml" />
|
---|
63 |
|
---|
64 | <batchtest fork="yes" todir="${report.dir}">
|
---|
65 | <fileset dir="${src.dir}" includes="*Test.java"/>
|
---|
66 | </batchtest>
|
---|
67 | </junit>
|
---|
68 | </target>
|
---|
69 |
|
---|
70 | <target name="junitreport">
|
---|
71 | <junitreport todir="${report.dir}">
|
---|
72 | <fileset dir="${report.dir}" includes="TEST-*.xml"/>
|
---|
73 | <report todir="${report.dir}"/>
|
---|
74 | </junitreport>
|
---|
75 | </target>
|
---|
76 |
|
---|
77 |
|
---|
78 | </project>
|
---|