]> WPIA git - gigi.git/blobdiff - build.xml
ADD: A step towards a more friendly SQL API.
[gigi.git] / build.xml
index 057c6881623ea77dfa40d9b2aaee337e07c1066c..fa99b2ad50e9066cdd48a517c25a23b0e9982c7f 100644 (file)
--- a/build.xml
+++ b/build.xml
@@ -1,15 +1,20 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<project basedir="." default="all" name="cacert-gigi">
+<project basedir="." default="develop" name="cacert-gigi" xmlns:jacoco="antlib:org.jacoco.ant">
+
+       <taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml">
+               <classpath path="/usr/share/java/jacocoant.jar" />
+       </taskdef>
+
        <property environment="env" />
        <property name="junit.output.dir" value="junit" />
        <property name="debuglevel" value="source,lines,vars" />
        <property name="target" value="1.8" />
        <property name="source" value="1.8" />
-       <property name="mysqlconnector" value="mysql-connector-java-5.1.31-bin.jar" />
-       <property name="juintexec" value="." />
+       <property name="mysqlconnector" value="/usr/share/java/mysql-connector-java.jar" />
+       <property name="juintexec" value="/usr/share/java" />
        <path id="JUnit 4.libraryclasspath">
-               <pathelement location="${juintexec}/junit.jar" />
-               <pathelement location="${juintexec}/org.hamcrest.core.jar" />
+               <pathelement location="${juintexec}/junit4.jar" />
+               <pathelement location="${juintexec}/hamcrest-core.jar" />
        </path>
        <path id="cacert-gigi.classpath">
                <pathelement location="bin" />
        <target name="clean">
                <delete dir="bin" />
        </target>
-       <target depends="clean" name="cleanall" />
+       <target name="clean-test">
+               <delete dir="bintest" />
+               <delete dir="cocoReport" failonerror="false"/>
+
+       </target>
+       <target depends="clean,clean-test" name="cleanall" />
        <target depends="build-project, native" name="build" />
        <target depends="init" name="build-project">
                <echo message="${ant.project.name}: ${ant.file}" />
                <javac 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" />
        </target>
 
        <target name="native">
-               <exec executable="make" dir="natives">
-                       <arg value="clean" />
-                       <arg value="all" />
-               </exec>
+               <exec executable="make" dir="natives"/>
        </target>
 
        <target depends="build" name="pack">
                        includes="gigi.jar,native/*.so,doc/tableStructure.sql,static/**,templates/**" />
        </target>
        <target name="static-bundle">
-               <tar destfile="static.tar.gz" compression="gzip" basedir="."
-                       includes="doc/tableStructure.sql,static/**,templates/**" />
+               <mkdir dir="work"/>
+               <mkdir dir="work/static"/>
+               <copy todir="work/static">
+                       <fileset dir="static"/>
+               </copy>
+               <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/**" />
+       </target>
+
+       <target name="static-bundle-release">
+               <mkdir dir="work"/>
+               <mkdir dir="work/static"/>
+               <copy todir="work/static">
+                       <fileset dir="static"/>
+               </copy>
+               <delete file="work/static/static/image/cacert4-test.png"/>
+               <tar destfile="static.tar.gz" compression="gzip" basedir="work"
+                       includes="../doc/tableStructure.sql,**,templates/**" />
        </target>
 
-       <target name="all" depends="bundle,static-bundle" />
+       <target name="develop" depends="bundle,static-bundle" />
 
+       <target name="release" depends="bundle,static-bundle-release" />
 
        <target depends="init,build-project" name="build-project-test">
                <echo message="${ant.project.name}: ${ant.file}" />
                <javac 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>
                </exec>
        </target>
        <target name="test" depends="build-project-test,generateKeys,FetchLocales,pack">
+               <delete failonerror="false">
+                       <fileset dir=".">
+                               <include name="jacoco.exec"/>
+                               <include name="tester.exec"/>
+                       </fileset>
+               </delete>
                <mkdir dir="${junit.output.dir}" />
                <junit 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">
                        <report format="frames" todir="${junit.output.dir}" />
                </junitreport>
        </target>
+       <target name="generatecoco">
+               <jacoco:merge destfile="merged.exec">
+                       <fileset dir="." includes="*.exec"/>
+               </jacoco:merge>
+               <jacoco:report>
+                       <executiondata>
+                               <file file="jacoco.exec" />
+                               <file file="tester.exec" />
+                       </executiondata>
+
+                       <structure name="CAcert gigi">
+                               <group name="Server">
+                                       <classfiles>
+                                               <fileset dir="bin/org/cacert/gigi" />
+                                       </classfiles>
+                                       <sourcefiles encoding="UTF-8">
+                                               <fileset dir="src/org/cacert/gigi" />
+                                       </sourcefiles>
+                               </group>
+                               <group name="Testcases">
+                                       <classfiles>
+                                               <fileset dir="bintest/org/cacert/gigi" />
+                                       </classfiles>
+                                       <sourcefiles encoding="UTF-8">
+                                               <fileset dir="tests/org/cacert/gigi" />
+                                       </sourcefiles>
+                               </group>
+                       </structure>
+
+                       <html destdir="cocoReport"/>
+
+               </jacoco:report>
+       </target>
 </project>