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