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="mysql-connector-java-5.1.31-bin.jar" />
9 <property name="juintexec" value="." />
10 <path id="JUnit 4.libraryclasspath">
11 <pathelement location="${juintexec}/junit.jar" />
12 <pathelement location="${juintexec}/org.hamcrest.core.jar" />
14 <path id="cacert-gigi.classpath">
15 <pathelement location="bin" />
16 <pathelement location="${mysqlconnector}" />
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}" />
26 <mkdir dir="bintest" />
28 <copy includeemptydirs="false" todir="bin">
29 <fileset dir="lib/servlet-api">
30 <exclude name="**/*.launch" />
31 <exclude name="**/*.java" />
34 <copy includeemptydirs="false" todir="bin">
35 <fileset dir="lib/jetty">
36 <exclude name="**/*.launch" />
37 <exclude name="**/*.java" />
40 <copy includeemptydirs="false" todir="bin">
42 <exclude name="**/*.launch" />
43 <exclude name="**/*.java" />
46 <copy includeemptydirs="false" todir="bin">
48 <exclude name="**/*.launch" />
49 <exclude name="**/*.java" />
52 <copy includeemptydirs="false" todir="bintest">
54 <exclude name="**/*.launch" />
55 <exclude name="**/*.java" />
62 <target depends="clean" name="cleanall" />
63 <target depends="build-project, native" name="build" />
64 <target depends="init" name="build-project">
65 <echo message="${ant.project.name}: ${ant.file}" />
66 <javac debug="true" debuglevel="${debuglevel}" destdir="bin"
67 includeantruntime="false" source="${source}" target="${target}">
68 <compilerarg value="-XDignore.symbol.file"/>
69 <src path="lib/servlet-api" />
70 <src path="lib/jetty" />
71 <src path="lib/jtar" />
74 <classpath refid="cacert-gigi.classpath" />
78 <target name="native">
79 <exec executable="make" dir="natives"/>
82 <target depends="build" name="pack">
83 <jar destfile="gigi.jar" basedir="bin" manifest="Gigi.MF" />
86 <target depends="test,native" name="bundle">
87 <zip destfile="gigi-linux_amd64.zip" basedir="."
88 includes="gigi.jar,native/*.so,doc/tableStructure.sql,static/**,templates/**" />
90 <target name="static-bundle">
92 <mkdir dir="work/static"/>
93 <copy todir="work/static">
94 <fileset dir="static"/>
96 <move file="work/static/static/images/cacert4-test.png" tofile="work/static/static/images/cacert4.png"/>
97 <delete file="work/static/static/image/cacert4-test.png"/>
98 <tar destfile="static.tar.gz" compression="gzip" basedir="work"
99 includes="../doc/tableStructure.sql,**,templates/**" />
102 <target name="static-bundle-release">
104 <mkdir dir="work/static"/>
105 <copy todir="work/static">
106 <fileset dir="static"/>
108 <delete file="work/static/static/image/cacert4-test.png"/>
109 <tar destfile="static.tar.gz" compression="gzip" basedir="work"
110 includes="../doc/tableStructure.sql,**,templates/**" />
113 <target name="develop" depends="bundle,static-bundle" />
115 <target name="release" depends="bundle,static-bundle-release" />
117 <target depends="init,build-project" name="build-project-test">
118 <echo message="${ant.project.name}: ${ant.file}" />
119 <javac debug="true" debuglevel="${debuglevel}" destdir="bintest"
120 includeantruntime="false" source="${source}" target="${target}">
121 <compilerarg value="-XDignore.symbol.file"/>
123 <classpath refid="cacert-gigi.test.classpath" />
126 <target name="check-locale">
127 <available file="locale/de.xml" property="locale.present" />
129 <target name="FetchLocales" depends="check-locale" unless="locale.present">
130 <java classname="org.cacert.gigi.util.FetchLocales" failonerror="true"
132 <classpath refid="cacert-gigi.classpath" />
135 <target name="check-generateKeys">
136 <available file="config/keystore.pkcs12" property="keystore.present" />
138 <target name="generateKeys" depends="check-generateKeys" unless="keystore.present">
139 <exec executable="./generateKeys.sh" dir="keys" />
140 <exec executable="./generateTruststore.sh" dir="keys">
141 <arg value="-noprompt" />
144 <target name="test" depends="build-project-test,generateKeys,FetchLocales,pack">
145 <mkdir dir="${junit.output.dir}" />
146 <junit fork="yes" printsummary="withOutAndErr">
147 <formatter type="xml" />
148 <batchtest fork="yes" todir="${junit.output.dir}">
149 <fileset dir="tests">
150 <include name="**/*.java" />
151 <exclude name="**/testUtils/**" />
154 <classpath refid="cacert-gigi.test.classpath" />
157 <target name="junitreport">
158 <junitreport todir="${junit.output.dir}">
159 <fileset dir="${junit.output.dir}">
160 <include name="TEST-*.xml" />
162 <report format="frames" todir="${junit.output.dir}" />