source: liacs/TOOS2010/assignment2/build.xml@ 273

Last change on this file since 273 was 209, checked in by Rick van der Zwet, 14 years ago

Some more usefull tests and debugging

File size: 2.3 KB
Line 
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}"
28 classpathref="classpath"
29 debug="true">
30 <compilerarg value="-Xlint:unchecked" />
31 </javac>
32 <copy todir="${classes.dir}">
33 <fileset dir="${src.dir}" excludes="**/*.java"/>
34 </copy>
35 </target>
36
37 <target name="jar" depends="compile">
38 <mkdir dir="${jar.dir}"/>
39 <jar destfile="${jar.dir}/${ant.project.name}.jar" basedir="${classes.dir}">
40 <manifest>
41 <attribute name="Main-Class" value="${main-class}" />
42 </manifest>
43 </jar>
44 </target>
45
46 <target name="run" depends="clean, jar">
47 <java fork="true" classname="${main-class}">
48 <classpath>
49 <path refid="classpath" />
50 <path refid="application"/>
51 </classpath>
52 </java>
53 </target>
54
55 <target name="junit" depends="clean, jar">
56 <mkdir dir="${report.dir}" />
57 <junit printsummary="no">
58 <classpath>
59 <path refid="classpath"/>
60 <path refid="application"/>
61 </classpath>
62
63 <formatter type="xml" />
64 <formatter type="brief" usefile="false" />
65
66 <batchtest fork="yes" todir="${report.dir}">
67 <fileset dir="${src.dir}" includes="*Test.java"/>
68 </batchtest>
69 </junit>
70 </target>
71
72 <target name="junitreport">
73 <junitreport todir="${report.dir}">
74 <fileset dir="${report.dir}" includes="TEST-*.xml"/>
75 <report todir="${report.dir}"/>
76 </junitreport>
77 </target>
78
79
80</project>
Note: See TracBrowser for help on using the repository browser.