]> WPIA git - gigi.git/blob - build.xml
Better ant test target
[gigi.git] / build.xml
1 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 <project basedir="." default="build" name="cacert-gigi">
3     <property environment="env"/>
4     <property name="junit.output.dir" value="junit"/>
5     <property name="debuglevel" value="source,lines,vars"/>
6     <property name="target" value="1.8"/>
7     <property name="source" value="1.8"/>
8     <property name="mysqlconnector" value="mysql-connector-java-5.1.31-bin.jar"/>
9     <property name="juintexec" value="junit.jar"/>
10     <path id="JUnit 4.libraryclasspath">
11         <pathelement location="${juintexec}"/>
12     </path>
13     <path id="cacert-gigi.classpath">
14         <pathelement location="bin"/>
15         <path refid="JUnit 4.libraryclasspath"/>
16         <pathelement location="${mysqlconnector}"/>
17     </path>
18     <target name="init">
19         <mkdir dir="bin"/>
20         <copy includeemptydirs="false" todir="bin">
21             <fileset dir="lib/servlet-api">
22                 <exclude name="**/*.launch"/>
23                 <exclude name="**/*.java"/>
24             </fileset>
25         </copy>
26         <copy includeemptydirs="false" todir="bin">
27             <fileset dir="lib/jetty">
28                 <exclude name="**/*.launch"/>
29                 <exclude name="**/*.java"/>
30             </fileset>
31         </copy>
32         <copy includeemptydirs="false" todir="bin">
33             <fileset dir="src">
34                 <exclude name="**/*.launch"/>
35                 <exclude name="**/*.java"/>
36             </fileset>
37         </copy>
38         <copy includeemptydirs="false" todir="bin">
39             <fileset dir="util">
40                 <exclude name="**/*.launch"/>
41                 <exclude name="**/*.java"/>
42             </fileset>
43         </copy>
44         <copy includeemptydirs="false" todir="bin">
45             <fileset dir="tests">
46                 <exclude name="**/*.launch"/>
47                 <exclude name="**/*.java"/>
48             </fileset>
49         </copy>
50     </target>
51     <target name="clean">
52         <delete dir="bin"/>
53     </target>
54     <target depends="clean" name="cleanall"/>
55     <target depends="build-subprojects,build-project" name="build"/>
56     <target name="build-subprojects"/>
57     <target depends="init" name="build-project">
58         <echo message="${ant.project.name}: ${ant.file}"/>
59         <javac debug="true" debuglevel="${debuglevel}" destdir="bin" includeantruntime="false" source="${source}" target="${target}">
60             <src path="lib/servlet-api"/>
61             <src path="lib/jetty"/>
62             <src path="src"/>
63             <src path="util"/>
64             <src path="tests"/>
65             <classpath refid="cacert-gigi.classpath"/>
66         </javac>
67     </target>
68     <target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects"/>
69     <target name="FetchLocales">
70         <java classname="org.cacert.gigi.util.FetchLocales" failonerror="true" fork="yes">
71             <classpath refid="cacert-gigi.classpath"/>
72         </java>
73     </target>
74     <target name="Launcher">
75         <java classname="org.cacert.gigi.Launcher" failonerror="true" fork="yes">
76             <classpath refid="cacert-gigi.classpath"/>
77         </java>
78     </target>
79     <target name="test">
80         <mkdir dir="${junit.output.dir}"/>
81         <junit fork="yes" printsummary="withOutAndErr">
82             <formatter type="xml"/>
83             <test name="org.cacert.gigi.TestSSL" todir="${junit.output.dir}"/>
84             <test name="org.cacert.gigi.pages.main.ResgisterPageTest" todir="${junit.output.dir}"/>
85             <classpath refid="cacert-gigi.classpath"/>
86         </junit>
87     </target>
88     <target name="junitreport">
89         <junitreport todir="${junit.output.dir}">
90             <fileset dir="${junit.output.dir}">
91                 <include name="TEST-*.xml"/>
92             </fileset>
93             <report format="frames" todir="${junit.output.dir}"/>
94         </junitreport>
95     </target>
96 </project>