source: liacs/TOOS/assignment1/build.xml@ 207

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

Some basic Testing classes

File size: 2.2 KB
RevLine 
[206]1<project name="Census" >
2
3 <property name="src.dir" value="src"/>
[205]4 <property name="lib.dir" value="lib" />
[206]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"/>
[207]8 <property name="report.dir" value="${build.dir}/junitreport"/>
9
[205]10 <property name="javac.includeAntRuntime" value="false" />
[206]11 <property name="main-class" value="nl.rickvanderzwet.toos.assignment1.Census" />
[204]12
[207]13
[205]14 <path id="classpath">
15 <fileset dir="${lib.dir}" includes="**/*.jar"/>
16 </path>
[207]17 <path id="application" location="${jar.dir}/${ant.project.name}.jar" />
[205]18
19
[204]20 <target name="clean">
[206]21 <delete dir="${build.dir}"/>
[204]22 </target>
23
[205]24 <target name="compile">
[206]25 <mkdir dir="${classes.dir}"/>
26 <javac srcdir="${src.dir}" destdir="${classes.dir}"
[205]27 includeAntRuntime="${javac.includeAntRuntime}" classpathref="classpath">
28
29 <compilerarg value="-Xlint:unchecked" />
30 </javac>
[206]31 <copy todir="${classes.dir}">
32 <fileset dir="${src.dir}" excludes="**/*.java"/>
33 </copy>
[204]34 </target>
35
36 <target name="jar" depends="compile">
[206]37 <mkdir dir="${jar.dir}"/>
38 <jar destfile="${jar.dir}/${ant.project.name}.jar" basedir="${classes.dir}">
[204]39 <manifest>
[206]40 <attribute name="Main-Class" value="${main-class}" />
[204]41 </manifest>
42 </jar>
43 </target>
44
[206]45 <target name="run" depends="clean, jar">
46 <java fork="true" classname="${main-class}">
[205]47 <classpath>
48 <path refid="classpath" />
[207]49 <path refid="application"/>
[205]50 </classpath>
51 </java>
[204]52 </target>
[207]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
[204]78</project>
Note: See TracBrowser for help on using the repository browser.