1 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 <project basedir="." default="develop" name="cacert-gigi" xmlns:jacoco="antlib:org.jacoco.ant">
4 <taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml">
5 <classpath path="/usr/share/java/jacocoant.jar" />
8 <property environment="env" />
9 <property name="junit.output.dir" value="junit" />
10 <property name="debuglevel" value="source,lines,vars" />
11 <property name="target" value="1.8" />
12 <property name="source" value="1.8" />
13 <property name="mysqlconnector" value="/usr/share/java/mysql-connector-java.jar" />
14 <property name="juintexec" value="/usr/share/java" />
15 <path id="JUnit 4.libraryclasspath">
16 <pathelement location="${juintexec}/junit4.jar" />
17 <pathelement location="${juintexec}/hamcrest-core.jar" />
19 <path id="cacert-gigi.classpath">
20 <pathelement location="bin" />
21 <pathelement location="${mysqlconnector}" />
23 <path id="cacert-gigi.test.classpath">
24 <pathelement location="bin" />
25 <pathelement location="bintest" />
26 <path refid="JUnit 4.libraryclasspath" />
27 <pathelement location="${mysqlconnector}" />
31 <mkdir dir="bintest" />
33 <copy includeemptydirs="false" todir="bin">
34 <fileset dir="lib/servlet-api">
35 <exclude name="**/*.launch" />
36 <exclude name="**/*.java" />
39 <copy includeemptydirs="false" todir="bin">
40 <fileset dir="lib/jetty">
41 <exclude name="**/*.launch" />
42 <exclude name="**/*.java" />
45 <copy includeemptydirs="false" todir="bin">
47 <exclude name="**/*.launch" />
48 <exclude name="**/*.java" />
51 <copy includeemptydirs="false" todir="bin">
53 <exclude name="**/*.launch" />
54 <exclude name="**/*.java" />
57 <copy includeemptydirs="false" todir="bintest">
59 <exclude name="**/*.launch" />
60 <exclude name="**/*.java" />
67 <target name="clean-test">
68 <delete dir="bintest" />
69 <delete dir="cocoReport" failonerror="false"/>
72 <target depends="clean,clean-test" name="cleanall" />
73 <target depends="build-project, native" name="build" />
74 <target depends="init" name="build-project">
75 <echo message="${ant.project.name}: ${ant.file}" />
76 <javac debug="true" debuglevel="${debuglevel}" destdir="bin"
77 includeantruntime="false" source="${source}" target="${target}">
78 <compilerarg value="-XDignore.symbol.file"/>
79 <src path="lib/servlet-api" />
80 <src path="lib/jetty" />
81 <src path="lib/jtar" />
84 <classpath refid="cacert-gigi.classpath" />
88 <target name="native">
89 <exec executable="make" dir="natives"/>
92 <target depends="build" name="pack">
93 <jar destfile="gigi.jar" basedir="bin" manifest="Gigi.MF" />
96 <target depends="test,native" name="bundle">
97 <zip destfile="gigi-linux_amd64.zip" basedir="."
98 includes="gigi.jar,native/*.so,doc/tableStructure.sql,static/**,templates/**" />
100 <target name="static-bundle">
102 <mkdir dir="work/static"/>
103 <copy todir="work/static">
104 <fileset dir="static"/>
106 <move file="work/static/static/images/cacert4-test.png" tofile="work/static/static/images/cacert4.png"/>
107 <delete file="work/static/static/image/cacert4-test.png"/>
108 <tar destfile="static.tar.gz" compression="gzip" basedir="work"
109 includes="../doc/tableStructure.sql,**,templates/**" />
112 <target name="static-bundle-release">
114 <mkdir dir="work/static"/>
115 <copy todir="work/static">
116 <fileset dir="static"/>
118 <delete file="work/static/static/image/cacert4-test.png"/>
119 <tar destfile="static.tar.gz" compression="gzip" basedir="work"
120 includes="../doc/tableStructure.sql,**,templates/**" />
123 <target name="develop" depends="bundle,static-bundle" />
125 <target name="release" depends="bundle,static-bundle-release" />
127 <target depends="init,build-project" name="build-project-test">
128 <echo message="${ant.project.name}: ${ant.file}" />
129 <javac debug="true" debuglevel="${debuglevel}" destdir="bintest"
130 includeantruntime="false" source="${source}" target="${target}">
131 <compilerarg value="-XDignore.symbol.file"/>
133 <classpath refid="cacert-gigi.test.classpath" />
136 <target name="check-locale">
137 <available file="locale/de.xml" property="locale.present" />
139 <target name="FetchLocales" depends="check-locale" unless="locale.present">
140 <java classname="org.cacert.gigi.util.FetchLocales" failonerror="true"
142 <classpath refid="cacert-gigi.classpath" />
145 <target name="check-generateKeys">
146 <available file="config/keystore.pkcs12" property="keystore.present" />
148 <target name="generateKeys" depends="check-generateKeys" unless="keystore.present">
149 <exec executable="./generateKeys.sh" dir="keys" />
150 <exec executable="./generateTruststore.sh" dir="keys">
151 <arg value="-noprompt" />
154 <target name="reset-db">
155 <copy file="config/test.properties" tofile="config/gigi.properties"/>
156 <java classname="org.cacert.gigi.util.DatabaseManager">
157 <classpath refid="cacert-gigi.classpath" />
160 <target name="test" depends="build-project-test,generateKeys,FetchLocales,pack,reset-db">
161 <delete failonerror="false">
163 <include name="jacoco.exec"/>
164 <include name="tester.exec"/>
167 <mkdir dir="${junit.output.dir}" />
168 <junit fork="yes" printsummary="withOutAndErr">
169 <jvmarg value="-javaagent:/usr/share/java/jacocoagent.jar=destfile=tester.exec"/>
170 <formatter type="xml" />
171 <batchtest fork="yes" todir="${junit.output.dir}">
172 <fileset dir="tests">
173 <include name="**/*.java" />
174 <exclude name="**/testUtils/**" />
177 <classpath refid="cacert-gigi.test.classpath" />
180 <target name="junitreport">
181 <junitreport todir="${junit.output.dir}">
182 <fileset dir="${junit.output.dir}">
183 <include name="TEST-*.xml" />
185 <report format="frames" todir="${junit.output.dir}" />
188 <target name="generatecoco">
189 <jacoco:merge destfile="merged.exec">
190 <fileset dir="." includes="*.exec"/>
194 <file file="jacoco.exec" />
195 <file file="tester.exec" />
198 <structure name="CAcert gigi">
199 <group name="Server">
201 <fileset dir="bin/org/cacert/gigi" />
203 <sourcefiles encoding="UTF-8">
204 <fileset dir="src/org/cacert/gigi" />
207 <group name="Testcases">
209 <fileset dir="bintest/org/cacert/gigi" />
211 <sourcefiles encoding="UTF-8">
212 <fileset dir="tests/org/cacert/gigi" />
217 <html destdir="cocoReport"/>