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

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

Some more usefull tests and debugging

File size: 2.3 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}"
[209]27 includeAntRuntime="${javac.includeAntRuntime}"
28 classpathref="classpath"
29 debug="true">
[205]30 <compilerarg value="-Xlint:unchecked" />
31 </javac>
[206]32 <copy todir="${classes.dir}">
33 <fileset dir="${src.dir}" excludes="**/*.java"/>
34 </copy>
[204]35 </target>
36
37 <target name="jar" depends="compile">
[206]38 <mkdir dir="${jar.dir}"/>
39 <jar destfile="${jar.dir}/${ant.project.name}.jar" basedir="${classes.dir}">
[204]40 <manifest>
[206]41 <attribute name="Main-Class" value="${main-class}" />
[204]42 </manifest>
43 </jar>
44 </target>
45
[206]46 <target name="run" depends="clean, jar">
47 <java fork="true" classname="${main-class}">
[205]48 <classpath>
49 <path refid="classpath" />
[207]50 <path refid="application"/>
[205]51 </classpath>
52 </java>
[204]53 </target>
[207]54
[209]55 <target name="junit" depends="clean, jar">
[207]56 <mkdir dir="${report.dir}" />
[208]57 <junit printsummary="no">
[207]58 <classpath>
59 <path refid="classpath"/>
60 <path refid="application"/>
61 </classpath>
62
63 <formatter type="xml" />
[208]64 <formatter type="brief" usefile="false" />
[207]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
[204]80</project>
Note: See TracBrowser for help on using the repository browser.