]> WPIA git - gigi.git/blob - build.xml
Change classpath things for testing.
[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         <pathelement location="${mysqlconnector}"/>
16     </path>
17     <path id="cacert-gigi.test.classpath">
18         <pathelement location="bin"/>
19         <pathelement location="bintest"/>
20         <path refid="JUnit 4.libraryclasspath"/>
21         <pathelement location="${mysqlconnector}"/>
22     </path>
23     <target name="init">
24         <mkdir dir="bin"/>
25         <mkdir dir="bintest"/>
26         
27         <copy includeemptydirs="false" todir="bin">
28             <fileset dir="lib/servlet-api">
29                 <exclude name="**/*.launch"/>
30                 <exclude name="**/*.java"/>
31             </fileset>
32         </copy>
33         <copy includeemptydirs="false" todir="bin">
34             <fileset dir="lib/jetty">
35                 <exclude name="**/*.launch"/>
36                 <exclude name="**/*.java"/>
37             </fileset>
38         </copy>
39         <copy includeemptydirs="false" todir="bin">
40             <fileset dir="src">
41                 <exclude name="**/*.launch"/>
42                 <exclude name="**/*.java"/>
43             </fileset>
44         </copy>
45         <copy includeemptydirs="false" todir="bin">
46             <fileset dir="util">
47                 <exclude name="**/*.launch"/>
48                 <exclude name="**/*.java"/>
49             </fileset>
50         </copy>
51         <copy includeemptydirs="false" todir="bintest">
52             <fileset dir="tests">
53                 <exclude name="**/*.launch"/>
54                 <exclude name="**/*.java"/>
55             </fileset>
56         </copy>
57     </target>
58     <target name="clean">
59         <delete dir="bin"/>
60     </target>
61     <target depends="clean" name="cleanall"/>
62     <target depends="build-subprojects,build-project" name="build"/>
63     <target name="build-subprojects"/>
64     <target depends="init" name="build-project">
65         <echo message="${ant.project.name}: ${ant.file}"/>
66         <javac debug="true" debuglevel="${debuglevel}" destdir="bin" includeantruntime="false" source="${source}" target="${target}">
67             <src path="lib/servlet-api"/>
68             <src path="lib/jetty"/>
69             <src path="lib/jtar"/>
70             <src path="src"/>
71             <src path="util"/>
72             <classpath refid="cacert-gigi.classpath"/>
73         </javac>
74     </target>
75     <target depends="init" name="build-project-test">
76         <echo message="${ant.project.name}: ${ant.file}"/>
77         <javac debug="true" debuglevel="${debuglevel}" destdir="bintest" includeantruntime="false" source="${source}" target="${target}">
78             <src path="tests"/>
79             <classpath refid="cacert-gigi.test.classpath"/>
80         </javac>
81     </target>
82     <target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects"/>
83     <target name="FetchLocales">
84         <java classname="org.cacert.gigi.util.FetchLocales" failonerror="true" fork="yes">
85             <classpath refid="cacert-gigi.classpath"/>
86         </java>
87     </target>
88     <target name="Launcher">
89         <java classname="org.cacert.gigi.Launcher" failonerror="true" fork="yes">
90             <classpath refid="cacert-gigi.classpath"/>
91         </java>
92     </target>
93     <target name="test" depends="build-project-test">
94         <mkdir dir="${junit.output.dir}"/>
95         <junit fork="yes" printsummary="withOutAndErr">
96             <formatter type="xml"/>
97             <test name="org.cacert.gigi.TestSSL" todir="${junit.output.dir}"/>
98             <test name="org.cacert.gigi.pages.main.ResgisterPageTest" todir="${junit.output.dir}"/>
99             <classpath refid="cacert-gigi.classpath"/>
100         </junit>
101     </target>
102     <target name="junitreport">
103         <junitreport todir="${junit.output.dir}">
104             <fileset dir="${junit.output.dir}">
105                 <include name="TEST-*.xml"/>
106             </fileset>
107             <report format="frames" todir="${junit.output.dir}"/>
108         </junitreport>
109     </target>
110 </project>