Merge changes I29db4164,I90632cf4
[gigi.git] / build.xml
index b0c8ecef0646732e8b008f066f92719d8e46a1f4..3985412208147b097fcd58a24f117fc1d6769ebb 100644 (file)
--- a/build.xml
+++ b/build.xml
@@ -11,7 +11,7 @@
        <property name="debuglevel" value="source,lines,vars" />
        <property name="target" value="1.8" />
        <property name="source" value="1.8" />
-       <property name="mysqlconnector" value="/usr/share/java/mysql-connector-java.jar" />
+       <property name="sqlconnector" value="/usr/share/java/postgresql-jdbc4.jar" />
        <property name="juintexec" value="/usr/share/java" />
        <path id="JUnit 4.libraryclasspath">
                <pathelement location="${juintexec}/junit4.jar" />
        <path id="cacert-gigi.classpath">
                <pathelement location="bin" />
                <pathelement location="binutil" />
-               <pathelement location="${mysqlconnector}" />
+               <pathelement location="${sqlconnector}" />
        </path>
        <path id="cacert-gigi.test.classpath">
+               <pathelement location="bintest" />
                <pathelement location="bin" />
                <pathelement location="binutil" />
                <pathelement location="binutil-testing" />
-               <pathelement location="bintest" />
                <path refid="JUnit 4.libraryclasspath" />
-               <pathelement location="${mysqlconnector}" />
+               <pathelement location="${sqlconnector}" />
+       </path>
+       <path id="cacert-gigi.test.classpath.jdt">
+               <pathelement location="${jdt}" />
        </path>
        <target name="init">
                <mkdir dir="bin" />
                                <exclude name="**/*.launch" />
                                <exclude name="**/*.java" />
                        </fileset>
-               </copy>
-               <copy includeemptydirs="false" todir="bin">
                        <fileset dir="lib/jetty">
                                <exclude name="**/*.launch" />
                                <exclude name="**/*.java" />
                        </fileset>
-               </copy>
-               <copy includeemptydirs="false" todir="bin">
                        <fileset dir="src">
                                <exclude name="**/*.launch" />
                                <exclude name="**/*.java" />
                        </fileset>
-               </copy>
-               <copy includeemptydirs="false" todir="bin">
                        <fileset dir="util">
                                <exclude name="**/*.launch" />
                                <exclude name="**/*.java" />
        <target depends="build-project, build-testing, native" name="build" />
        <target depends="init" name="build-project">
                <echo message="${ant.project.name}: ${ant.file}" />
-               <javac debug="true" debuglevel="${debuglevel}" destdir="bin"
+               <javac encoding="UTF-8" debug="true" debuglevel="${debuglevel}" destdir="bin"
                        includeantruntime="false" source="${source}" target="${target}">
                        <compilerarg value="-XDignore.symbol.file"/>
                        <src path="lib/servlet-api" />
                        <src path="lib/jetty" />
                        <src path="lib/jtar" />
+                       <src path="lib/scrypt" />
                        <src path="src" />
                        <classpath refid="cacert-gigi.classpath" />
                </javac>
-               <javac debug="true" debuglevel="${debuglevel}" destdir="binutil"
+               <javac encoding="UTF-8" debug="true" debuglevel="${debuglevel}" destdir="binutil"
                        includeantruntime="false" source="${source}" target="${target}">
                        <compilerarg value="-XDignore.symbol.file"/>
                        <src path="util" />
                </javac>
        </target>
        <target depends="init, build-project" name="build-testing">
-               <javac debug="true" debuglevel="${debuglevel}" destdir="binutil-testing"
+               <javac encoding="UTF-8" debug="true" debuglevel="${debuglevel}" destdir="binutil-testing"
                        includeantruntime="false" source="${source}" target="${target}">
+                       <compilerarg value="-XDignore.symbol.file"/>
                        <src path="util-testing" />
+                       <exclude name="org/cacert/gigi/localisation/**"/>
                        <classpath refid="cacert-gigi.classpath" />
                </javac>
        </target>
+       <target depends="init, build-project" name="build-testing-l10n">
+               <javac encoding="UTF-8" debug="true" debuglevel="${debuglevel}" destdir="binutil-testing"
+                       includeantruntime="false" source="${source}" target="${target}">
+                       <compilerarg value="-XDignore.symbol.file"/>
+                       <src path="util-testing" />
+                       <include name="org/cacert/gigi/localisation/**"/>
+                       <classpath refid="cacert-gigi.classpath" />
+                       <classpath refid="cacert-gigi.test.classpath.jdt" />
+               </javac>
+               <java classname="org.cacert.gigi.localisation.TranslationCollector">
+                       <arg value="util-testing/org/cacert/gigi/localisation/conf.txt"/>
+                       <arg value="."/>
+                       <arg value="messages.po"/>
+                       <classpath refid="cacert-gigi.test.classpath" />
+                       <classpath refid="cacert-gigi.test.classpath.jdt" />
+               </java>
+       </target>
 
        <target name="native">
                <exec executable="make" dir="natives"/>
        </target>
 
-       <target depends="build-project" name="pack">
+       <target depends="build-project, update-effective-tlds" name="pack">
                <jar destfile="gigi.jar" basedir="bin" manifest="Gigi.MF" update="false"/>
                <jar destfile="gigi.jar" basedir="binutil" update="on"/>
        </target>
 
-       <target depends="build-testing" name="pack-testing">
+       <target depends="build-testing,update-effective-tlds" name="pack-testing">
                <jar destfile="gigi-testing.jar" basedir="bin" manifest="Gigi.MF" update="false"/>
                <jar destfile="gigi-testing.jar" basedir="binutil" update="on"/>
                <jar destfile="gigi-testing.jar" basedir="binutil-testing" update="on"/>
 
        <target depends="test,native" name="bundle">
                <zip destfile="gigi-linux_amd64.zip" basedir="."
-                       includes="gigi.jar,native/*.so,doc/tableStructure.sql,static/**,templates/**" />
+                       includes="gigi.jar,native/*.so,src/org/cacert/gigi/database/tableStructure.sql,static/**,templates/**" />
        </target>
        <target name="static-bundle">
                <mkdir dir="work"/>
                <move file="work/static/static/images/cacert4-test.png" tofile="work/static/static/images/cacert4.png"/>
                <delete file="work/static/static/image/cacert4-test.png"/>
                <tar destfile="static.tar.gz" compression="gzip" basedir="work"
-                       includes="../doc/tableStructure.sql,**,templates/**" />
+                       includes="../src/org/cacert/gigi/database/tableStructure.sql,**,templates/**" />
        </target>
 
        <target name="static-bundle-release">
                </copy>
                <delete file="work/static/static/image/cacert4-test.png"/>
                <tar destfile="static.tar.gz" compression="gzip" basedir="work"
-                       includes="../doc/tableStructure.sql,**,templates/**" />
+                       includes="../src/org/cacert/gigi/database/tableStructure.sql,**,templates/**" />
        </target>
 
        <target name="develop" depends="bundle,static-bundle" />
 
        <target name="release" depends="bundle,static-bundle-release" />
 
-       <target depends="init,build-testing" name="build-project-test">
+       <target depends="init,build-testing,update-effective-tlds" name="build-project-test">
                <echo message="${ant.project.name}: ${ant.file}" />
-               <javac debug="true" debuglevel="${debuglevel}" destdir="bintest"
+               <javac encoding="UTF-8" debug="true" debuglevel="${debuglevel}" destdir="bintest"
                        includeantruntime="false" source="${source}" target="${target}">
                        <compilerarg value="-XDignore.symbol.file"/>
                        <src path="tests" />
                        <classpath refid="cacert-gigi.test.classpath" />
                </javac>
+               <concat destfile="bintest/org/cacert/gigi/util/effective_tld_names.dat">
+                       <path path="bin/org/cacert/gigi/util/effective_tld_names.dat"/>
+                       <path path="publicSuffixFooter.dat"/>
+               </concat>
        </target>
        <target name="check-locale">
                <available file="locale/de.xml" property="locale.present" />
                        <classpath refid="cacert-gigi.test.classpath" />
                </java>
        </target>
-       <target name="test" depends="build-project-test,generateKeys,FetchLocales,pack-testing,pack,reset-db">
+       <target name="test" depends="build-project-test,FetchLocales,pack-testing,pack,reset-db">
                <delete failonerror="false">
                        <fileset dir=".">
                                <include name="jacoco.exec"/>
                        </fileset>
                </delete>
                <mkdir dir="${junit.output.dir}" />
-               <junit fork="yes" printsummary="withOutAndErr">
+               <junit maxmemory="2g" fork="yes" printsummary="withOutAndErr">
                        <jvmarg value="-javaagent:/usr/share/java/jacocoagent.jar=destfile=tester.exec"/>
                        <formatter type="xml" />
                        <batchtest fork="yes" todir="${junit.output.dir}">
                                <fileset dir="tests">
                                        <include name="**/*.java" />
                                        <exclude name="**/testUtils/**" />
+                                       <exclude name="**/com/lambdaworks/crypto/test/CryptoTestUtil.java"/>
                                </fileset>
                        </batchtest>
                        <classpath refid="cacert-gigi.test.classpath" />
                </junitreport>
        </target>
        <target name="generatecoco">
+               <delete file="merged.exec"/>
+
                <jacoco:merge destfile="merged.exec">
                        <fileset dir="." includes="*.exec"/>
                </jacoco:merge>
 
                <chmod file="${env.DESTDIR}/usr/bin/gigi" perm="+x"/>
                <mkdir dir="${env.DESTDIR}/usr/share/dbconfig-common/data/${PACKAGE}/install/"/>
-               <copy file="doc/tableStructure.sql" tofile="${env.DESTDIR}/usr/share/dbconfig-common/data/${PACKAGE}/install/mysql.sql"/>
+               <copy file="src/org/cacert/gigi/database/tableStructure.sql" tofile="${env.DESTDIR}/usr/share/dbconfig-common/data/${PACKAGE}/install/mysql.sql"/>
 
                <mkdir dir="${env.DESTDIR}/var/lib/cacert-gigi/doc"/>
                <exec executable="ln">
                        <arg value="${env.DESTDIR}/var/lib/cacert-gigi/natives/libsetuid.so"/>
                </exec>
 
-               <mkdir dir="${env.DESTDIR}/etc/cacert-gigi"/>
+               <mkdir dir="${env.DESTDIR}/etc/cacert/gigi"/>
                <!--<copy todir="${env.DESTDIR}/DEBIAN">
                        <fileset dir="debian">
                        </fileset>
                </copy>-->
        </target>
+       <target name="update-effective-tlds">
+               <mkdir dir="bin/org/cacert/gigi/util"/>
+               <exec executable="wget" dir="bin/org/cacert/gigi/util">
+                       <arg value="-N"/>
+                       <arg value="-q"/>
+                       <arg value="https://publicsuffix.org/list/effective_tld_names.dat"/>
+               </exec>
+       </target>
 </project>