]> WPIA git - gigi.git/blob - build.xml
Updated this files with defaults for debs
[gigi.git] / build.xml
1 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 <project basedir="." default="develop" 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="/usr/share/java/mysql-connector-java.jar" />
9         <property name="juintexec" value="/usr/share/java" />
10         <path id="JUnit 4.libraryclasspath">
11                 <pathelement location="${juintexec}/junit4.jar" />
12                 <pathelement location="${juintexec}/hamcrest-core.jar" />
13         </path>
14         <path id="cacert-gigi.classpath">
15                 <pathelement location="bin" />
16                 <pathelement location="${mysqlconnector}" />
17         </path>
18         <path id="cacert-gigi.test.classpath">
19                 <pathelement location="bin" />
20                 <pathelement location="bintest" />
21                 <path refid="JUnit 4.libraryclasspath" />
22                 <pathelement location="${mysqlconnector}" />
23         </path>
24         <target name="init">
25                 <mkdir dir="bin" />
26                 <mkdir dir="bintest" />
27
28                 <copy includeemptydirs="false" todir="bin">
29                         <fileset dir="lib/servlet-api">
30                                 <exclude name="**/*.launch" />
31                                 <exclude name="**/*.java" />
32                         </fileset>
33                 </copy>
34                 <copy includeemptydirs="false" todir="bin">
35                         <fileset dir="lib/jetty">
36                                 <exclude name="**/*.launch" />
37                                 <exclude name="**/*.java" />
38                         </fileset>
39                 </copy>
40                 <copy includeemptydirs="false" todir="bin">
41                         <fileset dir="src">
42                                 <exclude name="**/*.launch" />
43                                 <exclude name="**/*.java" />
44                         </fileset>
45                 </copy>
46                 <copy includeemptydirs="false" todir="bin">
47                         <fileset dir="util">
48                                 <exclude name="**/*.launch" />
49                                 <exclude name="**/*.java" />
50                         </fileset>
51                 </copy>
52                 <copy includeemptydirs="false" todir="bintest">
53                         <fileset dir="tests">
54                                 <exclude name="**/*.launch" />
55                                 <exclude name="**/*.java" />
56                         </fileset>
57                 </copy>
58         </target>
59         <target name="clean">
60                 <delete dir="bin" />
61         </target>
62         <target name="clean-test">
63                 <delete dir="bintest" />
64         </target>
65         <target depends="clean,clean-test" name="cleanall" />
66         <target depends="build-project, native" name="build" />
67         <target depends="init" name="build-project">
68                 <echo message="${ant.project.name}: ${ant.file}" />
69                 <javac debug="true" debuglevel="${debuglevel}" destdir="bin"
70                         includeantruntime="false" source="${source}" target="${target}">
71                         <compilerarg value="-XDignore.symbol.file"/>
72                         <src path="lib/servlet-api" />
73                         <src path="lib/jetty" />
74                         <src path="lib/jtar" />
75                         <src path="src" />
76                         <src path="util" />
77                         <classpath refid="cacert-gigi.classpath" />
78                 </javac>
79         </target>
80
81         <target name="native">
82                 <exec executable="make" dir="natives"/>
83         </target>
84
85         <target depends="build" name="pack">
86                 <jar destfile="gigi.jar" basedir="bin" manifest="Gigi.MF" />
87         </target>
88
89         <target depends="test,native" name="bundle">
90                 <zip destfile="gigi-linux_amd64.zip" basedir="."
91                         includes="gigi.jar,native/*.so,doc/tableStructure.sql,static/**,templates/**" />
92         </target>
93         <target name="static-bundle">
94             <mkdir dir="work"/>
95             <mkdir dir="work/static"/>
96             <copy todir="work/static">
97                 <fileset dir="static"/>
98                 </copy>
99                 <move file="work/static/static/images/cacert4-test.png" tofile="work/static/static/images/cacert4.png"/>
100             <delete file="work/static/static/image/cacert4-test.png"/>
101                 <tar destfile="static.tar.gz" compression="gzip" basedir="work"
102                         includes="../doc/tableStructure.sql,**,templates/**" />
103         </target>
104         
105         <target name="static-bundle-release">
106                 <mkdir dir="work"/>
107             <mkdir dir="work/static"/>
108             <copy todir="work/static">
109                 <fileset dir="static"/>
110                 </copy>
111                 <delete file="work/static/static/image/cacert4-test.png"/>
112                 <tar destfile="static.tar.gz" compression="gzip" basedir="work"
113                         includes="../doc/tableStructure.sql,**,templates/**" />
114         </target>
115
116         <target name="develop" depends="bundle,static-bundle" />
117
118         <target name="release" depends="bundle,static-bundle-release" />
119         
120         <target depends="init,build-project" name="build-project-test">
121                 <echo message="${ant.project.name}: ${ant.file}" />
122                 <javac debug="true" debuglevel="${debuglevel}" destdir="bintest"
123                         includeantruntime="false" source="${source}" target="${target}">
124                         <compilerarg value="-XDignore.symbol.file"/>
125                         <src path="tests" />
126                         <classpath refid="cacert-gigi.test.classpath" />
127                 </javac>
128         </target>
129         <target name="check-locale">
130                 <available file="locale/de.xml" property="locale.present" />
131         </target>
132         <target name="FetchLocales" depends="check-locale" unless="locale.present">
133                 <java classname="org.cacert.gigi.util.FetchLocales" failonerror="true"
134                         fork="yes">
135                         <classpath refid="cacert-gigi.classpath" />
136                 </java>
137         </target>
138         <target name="check-generateKeys">
139                 <available file="config/keystore.pkcs12" property="keystore.present" />
140         </target>
141         <target name="generateKeys" depends="check-generateKeys" unless="keystore.present">
142                 <exec executable="./generateKeys.sh" dir="keys" />
143                 <exec executable="./generateTruststore.sh" dir="keys">
144                         <arg value="-noprompt" />
145                 </exec>
146         </target>
147         <target name="test" depends="build-project-test,generateKeys,FetchLocales,pack">
148                 <mkdir dir="${junit.output.dir}" />
149                 <junit fork="yes" printsummary="withOutAndErr">
150                         <formatter type="xml" />
151                         <batchtest fork="yes" todir="${junit.output.dir}">
152                                 <fileset dir="tests">
153                                         <include name="**/*.java" />
154                                         <exclude name="**/testUtils/**" />
155                                 </fileset>
156                         </batchtest>
157                         <classpath refid="cacert-gigi.test.classpath" />
158                 </junit>
159         </target>
160         <target name="junitreport">
161                 <junitreport todir="${junit.output.dir}">
162                         <fileset dir="${junit.output.dir}">
163                                 <include name="TEST-*.xml" />
164                         </fileset>
165                         <report format="frames" todir="${junit.output.dir}" />
166                 </junitreport>
167         </target>
168 </project>