<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- $Id: releaseBuild.xml,v 1.2 2008/08/02 04:30:57 m31 Exp $ -->
<!-- $RCSfile: releaseBuild.xml,v $ -->
<!-- $Revision: 1.2 $ -->
<!-- author: mime -->
<!-- project: Hilbert II -->

<!-- This is the Ant build file for building the Se release of project Hilbert II -->
<project name="releaseBuild" default="all" basedir="../..">

    <description>
        Release build for Hilbert II.   
    </description>

    <import file="baseMacros.xml" />

    <!-- set global properties for this build -->
    <property file="${basedir}/QedeqBuild/scripts/build.properties" />
    <property name="qedeq.lib"             value="${basedir}/QedeqLib" />
    <property name="qedeq.gen"             value="${basedir}/../../qedeq_gen" />
    <property name="qedeq.directory"       value="qedeq" />
    <property name="qedeq.dest"            value="${basedir}/../../qedeq_gen/release/ant/${qedeq.directory}" />
    <property name="qedeq.dest.module"     value="${basedir}/../../qedeq_gen/release/ant/modules" />
    <property name="qedeq.dist"            value="${basedir}/../../qedeq_gen/release/ant/dist" />
    <property name="qedeq.temp"            value="${basedir}/../../qedeq_gen/release/ant/temp" />
    <property name="qedeq.webstart"        value="${basedir}/../../qedeq_gen/release/ant/webstart" />
    <property name="qedeq.resources"       value="${basedir}/QedeqBuild/resources" />

    <!-- Java2Html - java2html.de -->
    <taskdef name="java2html" classname="de.java2html.anttasks.Java2HtmlTask"
        classpath="${qedeq.lib}/java2html.jar" />
 <!--    
currently in ants classpath
    <taskdef name="junit" class="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask" 
        classpathref="classpath.common" />   
-->    
    <taskdef name="xsddoc" classname="net.sf.xframe.xsddoc.Task" classpath="${qedeq.lib}/xsddoc.jar" />
    <taskdef resource="checkstyletask.properties" classpath="${qedeq.lib}/checkstyle-all-4.4.jar" />
    
    <tstamp>
        <format property="qedeq.se.timestamp" pattern="yyyy-MM-dd HH:mm:ss" timezone="GMT"/>
        <format property="qedeq.se.buildId" pattern="yyyyMMddHHmmss" timezone="GMT"/>
    </tstamp>

    <filterset id="qedeq_filter" begintoken="@" endtoken="@">
        <filter token="QEDEQ_VERSION"     value="${qedeq.release.version}" />
        <filter token="QEDEQ_CODENAME"    value="${qedeq.release.codename}" />
        <filter token="QEDEQ_DIRECTORY"   value="${qedeq.release.directory}" />
        <filter token="QEDEQ_TIMESTAMP"   value="${qedeq.se.timestamp}" />
        <filter token="QEDEQ_BUILD_ID"    value="${qedeq.se.buildId}" />
        <filter token="trace_file_path"   value="./log/trace.txt" />
    </filterset>

    <path id="classpath.lib">
        <pathelement location="${qedeq.lib}/junit.jar"/>
        <pathelement location="${qedeq.lib}/xercesImpl.jar" />
        <pathelement location="${qedeq.lib}/xml-apis.jar" />
        <pathelement location="${qedeq.lib}/xalan.jar" />
        <pathelement location="${qedeq.lib}/commons-io-1.4.jar" />
        <pathelement location="${qedeq.lib}/commons-lang-2.4.jar" />
        <pathelement location="${qedeq.lib}/commons-logging-1.1.1.jar" />
        <pathelement location="${qedeq.lib}/log4j-1.2.14.jar" />
        <pathelement location="${qedeq.lib}/forms-1.1.0.jar" />
        <pathelement location="${qedeq.lib}/looks-2.1.4.jar" />
        <pathelement location="${qedeq.lib}/clover-2.3.1.jar" />
    </path>
    
    <path id="classpath.common">
        <path refid="classpath.lib" ></path>     
        <pathelement location="${qedeq.dest.module}/QedeqBase/target/classes" />
        <pathelement location="${qedeq.dest.module}/QedeqBase/src/main/resources" />
        <pathelement location="${qedeq.dest.module}/QedeqBase/src/test/resources" />
        <pathelement location="${qedeq.dest.module}/QedeqBase/target/test-classes" />
        <pathelement location="${qedeq.dest.module}/QedeqKernelSe/target/classes" />
        <pathelement location="${qedeq.dest.module}/QedeqKernelSe/src/main/resources" />
        <pathelement location="${qedeq.dest.module}/QedeqKernelSe/src/test/resources" />
        <pathelement location="${qedeq.dest.module}/QedeqKernelSe/target/test-classes" />
        <pathelement location="${qedeq.dest.module}/QedeqKernelBo/target/classes" />
        <pathelement location="${qedeq.dest.module}/QedeqKernelBo/src/main/resources" />
        <pathelement location="${qedeq.dest.module}/QedeqKernelBo/src/test/resources" />
        <pathelement location="${qedeq.dest.module}/QedeqKernelBo/target/test-classes" />
        <pathelement location="${qedeq.dest.module}/QedeqKernelXml/target/classes" />
        <pathelement location="${qedeq.dest.module}/QedeqKernelXml/src/main/resources" />
        <pathelement location="${qedeq.dest.module}/QedeqKernelXml/src/test/resources" />
        <pathelement location="${qedeq.dest.module}/QedeqKernelXml/target/test-classes" />
        <pathelement location="${qedeq.dest.module}/qedeq_gui_se/target/classes" />
        <pathelement location="${qedeq.dest.module}/qedeq_gui_se/src/main/resources" />
    </path>   
    <path id="classpath.aggregate">
        <path refid="classpath.lib" ></path>     
        <pathelement location="${qedeq.dest.module}/qedeq_kernel/target/classes" />
        <pathelement location="${qedeq.dest.module}/qedeq_kernel/src/main/resources" />
        <pathelement location="${qedeq.dest.module}/qedeq_kernel/src/test/resources" />
        <pathelement location="${qedeq.dest.module}/qedeq_kernel/target/test-classes" />
        <pathelement location="${qedeq.dest.module}/qedeq_gui_se/target/classes" />
        <pathelement location="${qedeq.dest.module}/qedeq_gui_se/src/main/resources" />
    </path>

   
    <taskdef resource="cloverlib.xml" classpath="${qedeq.lib}/clover-2.3.1.jar" />

    <target name="clean">
        <delete dir="${qedeq.dest.module}" failonerror="true" />
        <mkdir dir="${qedeq.dest.module}" />
        <delete dir="${qedeq.dist}" failonerror="true"/>
        <mkdir dir="${qedeq.dist}" />
        <delete dir="${qedeq.temp}" failonerror="true" />
        <mkdir dir="${qedeq.temp}"/>
        <delete dir="${qedeq.dest.module}" failonerror="true" />
        <mkdir dir="${qedeq.dest.module}"/>
        <clean name="QedeqBase"      dir="${qedeq.dest.module}/QedeqBase" />
        <clean name="QedeqKernelSe"  dir="${qedeq.dest.module}/QedeqKernelSe" />
        <clean name="QedeqKernelBo"  dir="${qedeq.dest.module}/QedeqKernelBo" />
        <clean name="QedeqKernelXml" dir="${qedeq.dest.module}/QedeqKernelXml" />
        <clean name="qedeq_kernel"   dir="${qedeq.dest.module}/qedeq_kernel" />
        <clean name="qedeq_kernel"   dir="${qedeq.dest.module}/qedeq_gui_se" />
    </target>

    <target name="source" depends="clean">
    	<copySource     name="QedeqBase"      dir="${qedeq.dest.module}/QedeqBase" />
    	<copyTestSource name="QedeqBase"      dir="${qedeq.dest.module}/QedeqBase"/>
        <copySource     name="QedeqKernelSe"  dir="${qedeq.dest.module}/QedeqKernelSe" />
        <copyTestSource name="QedeqKernelSe"  dir="${qedeq.dest.module}/QedeqKernelSe" />
        <copySource     name="QedeqKernelBo"  dir="${qedeq.dest.module}/QedeqKernelBo" />
        <copyTestSource name="QedeqKernelBo"  dir="${qedeq.dest.module}/QedeqKernelBo" />
        <copySource     name="QedeqKernelXml" dir="${qedeq.dest.module}/QedeqKernelXml" />
        <copyTestSource name="QedeqKernelXml" dir="${qedeq.dest.module}/QedeqKernelXml" />
        <copySource     name="QedeqGuiSe"     dir="${qedeq.dest.module}/qedeq_gui_se" />
        
        <!-- generate complete kernel sources out of all sub modules -->   
        <mkdir dir="${qedeq.dest.module}/qedeq_kernel/src" />
        <copy todir="${qedeq.dest.module}/qedeq_kernel" >
          <fileset dir="${qedeq.dest.module}/QedeqBase" />
          <fileset dir="${qedeq.dest.module}/QedeqKernelSe" />
          <fileset dir="${qedeq.dest.module}/QedeqKernelBo" />
          <fileset dir="${qedeq.dest.module}/QedeqKernelXml" />
        </copy>
    </target>  
    
    <target name="compile" description="compiles all modules" depends="source" >
        <compile     name="QedeqBase"      dir="${qedeq.dest.module}/QedeqBase"      classpath="classpath.common" />
        <compile     name="QedeqKernelSe"  dir="${qedeq.dest.module}/QedeqKernelSe"  classpath="classpath.common" />
        <compile     name="QedeqKernelBo"  dir="${qedeq.dest.module}/QedeqKernelBo"  classpath="classpath.common" />
        <compile     name="QedeqKernelXml" dir="${qedeq.dest.module}/QedeqKernelXml" classpath="classpath.common" />
        <compile     name="qedeq_kernel"   dir="${qedeq.dest.module}/qedeq_kernel"   classpath="classpath.common" />
        <compile     name="qedeq_gui_se"   dir="${qedeq.dest.module}/qedeq_gui_se"   classpath="classpath.common" />
    </target>
	
    <target name="testCompile" description="compile all test classes" depends="compile">
        <testCompile name="QedeqBase"      dir="${qedeq.dest.module}/QedeqBase"      classpath="classpath.common" />
        <testCompile name="QedeqKernelSe"  dir="${qedeq.dest.module}/QedeqKernelSe"  classpath="classpath.common" />
        <testCompile name="QedeqKernelBo"  dir="${qedeq.dest.module}/QedeqKernelBo"  classpath="classpath.common" />
        <testCompile name="QedeqKernelXml" dir="${qedeq.dest.module}/QedeqKernelXml" classpath="classpath.common" />
        <testCompile name="qedeq_kernel"   dir="${qedeq.dest.module}/qedeq_kernel"   classpath="classpath.aggregate" />
    </target>
        
    <target name="test" description="run all tests" depends="testCompile">
        <cloverTest  name="QedeqBase"      dir="${qedeq.dest.module}/QedeqBase"      classpath="classpath.common"/>
        <cloverTest  name="QedeqKernelSe"  dir="${qedeq.dest.module}/QedeqKernelSe"  classpath="classpath.common"/>
        <cloverTest  name="QedeqKernelBo"  dir="${qedeq.dest.module}/QedeqKernelBo"  classpath="classpath.common"/>
        <cloverTest  name="QedeqKernelXml" dir="${qedeq.dest.module}/QedeqKernelXml" classpath="classpath.common"/>
        <cloverTest  name="qedeq_kernel"   dir="${qedeq.dest.module}/qedeq_kernel"   classpath="classpath.aggregate"/>
    </target>
 
    <target name="pest" description="run all pest tests" depends="test">
        <pest        name="QedeqBase"      dir="${qedeq.dest.module}/QedeqBase"      classpath="classpath.common"/>
        <pest        name="QedeqKernelSe"  dir="${qedeq.dest.module}/QedeqKernelSe"  classpath="classpath.common"/>
        <pest        name="QedeqKernelBo"  dir="${qedeq.dest.module}/QedeqKernelBo"  classpath="classpath.common"/>
        <pest        name="QedeqKernelXml" dir="${qedeq.dest.module}/QedeqKernelXml" classpath="classpath.common"/>
        <pest        name="qedeq_kernel"   dir="${qedeq.dest.module}/qedeq_kernel"   classpath="classpath.aggregate"/>
    </target>
        
    <target name="sourceHtml" description="generate HTML for java" depends="test">
        <sourceHtml  name="QedeqBase"      dir="${qedeq.dest.module}/QedeqBase"      />
        <sourceHtml  name="QedeqKernelSe"  dir="${qedeq.dest.module}/QedeqKernelSe"  />
        <sourceHtml  name="QedeqKernelBo"  dir="${qedeq.dest.module}/QedeqKernelBo"  />
        <sourceHtml  name="QedeqKernelXml" dir="${qedeq.dest.module}/QedeqKernelXml" />
        <sourceHtml  name="qedeq_kernel"   dir="${qedeq.dest.module}/qedeq_kernel"   />
        <sourceHtml  name="qedeq_gui_se"   dir="${qedeq.dest.module}/qedeq_gui_se"   />
    </target>
        
    <target name="checkstyle" description="run checkstyle" depends="">
        <checkstyleReport  name="QedeqBase"      dir="${qedeq.dest.module}/QedeqBase"      classpath="classpath.common"    checks="${qedeq.resources}/checkstyle/QedeqFormalChecks.xml" style="${qedeq.resources}/checkstyle/checkstyle-no-frames-detailed.xsl" />
        <checkstyleReport  name="QedeqKernelSe"  dir="${qedeq.dest.module}/QedeqKernelSe"  classpath="classpath.common"    checks="${qedeq.resources}/checkstyle/QedeqFormalChecks.xml" style="${qedeq.resources}/checkstyle/checkstyle-no-frames-detailed.xsl" />
        <checkstyleReport  name="QedeqKernelBo"  dir="${qedeq.dest.module}/QedeqKernelBo"  classpath="classpath.common"    checks="${qedeq.resources}/checkstyle/QedeqFormalChecks.xml" style="${qedeq.resources}/checkstyle/checkstyle-no-frames-detailed.xsl" />
        <checkstyleReport  name="QedeqKernelXml" dir="${qedeq.dest.module}/QedeqKernelXml" classpath="classpath.common"    checks="${qedeq.resources}/checkstyle/QedeqFormalChecks.xml" style="${qedeq.resources}/checkstyle/checkstyle-no-frames-detailed.xsl" />
        <checkstyleReport  name="qedeq_kernel"   dir="${qedeq.dest.module}/qedeq_kernel"   classpath="classpath.aggregate" checks="${qedeq.resources}/checkstyle/QedeqFormalChecks.xml" style="${qedeq.resources}/checkstyle/checkstyle-no-frames-detailed.xsl" /> 
        <checkstyleReport  name="qedeq_gui_se"   dir="${qedeq.dest.module}/qedeq_gui_se"   classpath="classpath.aggregate" checks="${qedeq.resources}/checkstyle/QedeqFormalChecks.xml" style="${qedeq.resources}/checkstyle/checkstyle-no-frames-detailed.xsl" />
    </target>
                
    <target name="package" description="generate jars" depends="compile">
        <delete dir="${qedeq.temp}" />
        <mkdir dir="${qedeq.temp}" />
        <copy todir="${qedeq.temp}">
          <fileset dir="${qedeq.resources}/jar" includes="readme.txt,manifest.txt,gpl.txt" />
          <fileset dir="${qedeq.resources}/licenses" includes="gpl.txt" />
          <filterset refid="qedeq_filter" />        
        </copy>
        <fileset id="qedeq.jar.includes" dir="${qedeq.temp}" 
            includes="readme.txt,gpl.txt" />
        <package     name="qedeq_kernel"   dir="${qedeq.dest.module}/qedeq_kernel"
                     version="${qedeq.release.version}"   
                     manifest="${qedeq.temp}/manifest.txt" includes="qedeq.jar.includes" />
        
        <package     name="qedeq_gui_se"   dir="${qedeq.dest.module}/qedeq_gui_se"
                     version="${qedeq.release.version}"
                     manifest="${qedeq.temp}/manifest.txt" includes="qedeq.jar.includes" />
    </target>

    <target name="makePdfs" description="create PDF files out of certain *.tex test results" depends="test">
        <property name="qedeq.texdir" value="${qedeq.dest.module}/QedeqKernelBo/target/test-outdir/doc" />
        <makePdf dir="${qedeq.texdir}/math"    file="qedeq_logic_v1_en.tex" />
        <makePdf dir="${qedeq.texdir}/math"    file="qedeq_logic_v1_de.tex" />
        <makePdf dir="${qedeq.texdir}/math"    file="qedeq_set_theory_v1_en.tex" />
        <makePdf dir="${qedeq.texdir}/math"    file="qedeq_set_theory_v1_de.tex" />
        <makePdf dir="${qedeq.texdir}/project" file="qedeq_basic_concept_en.tex" />
        <makePdf dir="${qedeq.texdir}/project" file="qedeq_basic_concept_de.tex" />
        <makePdf dir="${qedeq.texdir}/project" file="qedeq_logic_language_en.tex" />
    </target>
                            
    <target name="doc" description="generate project documentation" depends="source,test,makePdfs">
        <delete dir="${qedeq.dest}/xml" />
        <mkdir dir="${qedeq.dest}/doc" />
        <mkdir dir="${qedeq.dest}/doc/project" />
        <delete dir="${qedeq.dest}/xml" />
        <mkdir dir="${qedeq.dest}/xml" />
        
        <!-- generate XSD documentation -->   
        <mkdir dir="${qedeq.dest}/xml/qedeq"/>
        <xsddoc file="${qedeq.dest.module}/qedeq_kernel/src/main/resources/org/qedeq/kernel/xml/schema/qedeq.xsd"
                 out="${qedeq.dest}/xml/qedeq"
            doctitle="XML QEDEQ Schema "
             verbose="false"/>
        <attrib archive="true">
          <fileset dir="${qedeq.dest}/xml/qedeq" includes="**/*" />
        </attrib>
        <xslt basedir="${qedeq.dest.module}/qedeq_kernel/src/main/resources/org/qedeq/kernel/xml/schema" destdir="${qedeq.dest}/xml"
                extension=".html" style="${qedeq.resources}/xsd/xs3p.xsl">
            <param name="searchImportedSchemas" expression="true"/>
            <param name="searchIncludedSchemas" expression="true"/>
            <param name="linksFile" expression="${qedeq.resources}/xsd/links.xml"/>
            <include name="*.xsd"/>
        </xslt>
        <copy todir="${qedeq.dest}/xml">
            <fileset dir="${qedeq.dest.module}/qedeq_kernel/src/main/resources/org/qedeq/kernel/xml/schema/">
                <include name="*.xsd"/>
            </fileset>
        </copy>

        <copy todir="${qedeq.dest}">
          <fileset dir="${qedeq.resources}"
            includes="index.html"
          >
          </fileset>
          <filterset refid="qedeq_filter" />
        </copy>
        <mkdir dir="${qedeq.dest}/res" />
        <copy todir="${qedeq.dest}/res">
          <fileset dir="${qedeq.resources}/clover"
            includes="*.gif"
          >
          </fileset>
        </copy>
        
        <copy todir="${qedeq.dest}/doc/project">
          <fileset dir="${qedeq.resources}"
            includes="changes.txt"
          >
          </fileset>
          <filterset refid="qedeq_filter" />
        </copy>
        <copy todir="${qedeq.dest}/doc">
          <fileset dir="${qedeq.dest.module}/QedeqKernelBo/target/test-outdir/doc"
            includes="math/**.xml,math/**.tex,math/**.pdf,project/**.xml,project/**.tex,project/**.pdf"
            excludes="**/qedeq_sample1*"
          >
          </fileset>
        </copy>
        <copy todir="${qedeq.dest}/doc/math">
          <fileset dir="${basedir}/doc/description"
            includes="axiomatic_set_theory.txt"
          >
    <!-- outdated:        includes="mengenlehre_1.tex,mengenlehre_1.pdf,axiomatic_set_theory.txt" -->
          </fileset>
        </copy>
        <copy todir="${qedeq.dest}/doc/project">
          <fileset dir="${basedir}/doc/description"
            includes="projektbeschreibung.tex,projektbeschreibung.pdf"
          >
          </fileset>
        </copy>
    </target>

    <target name="assemble" depends="doc,package,test,pest,sourceHtml,checkstyle">
        <!-- copy libraries -->   
        <delete dir="${qedeq.dest}/lib" />
        <mkdir dir="${qedeq.dest}/lib" />
        <copy todir="${qedeq.dest}/lib">
            <!-- fileset file="${qedeq.lib}/xalan.jar" / -->
            <fileset file="${qedeq.lib}/xercesImpl.jar" />
            <fileset file="${qedeq.lib}/xml-apis.jar" />
            <fileset file="${qedeq.lib}/commons-io-1.4.jar" />
            <fileset file="${qedeq.lib}/commons-lang-2.4.jar" />
            <fileset file="${qedeq.lib}/commons-logging-1.1.1.jar" />
            <fileset file="${qedeq.lib}/log4j-1.2.14.jar" />
            <fileset file="${qedeq.lib}/forms-1.1.0.jar" />
            <fileset file="${qedeq.lib}/looks-2.1.4.jar" />
            <fileset file="${qedeq.dest.module}/qedeq_kernel/qedeq_kernel-${qedeq.release.version}.jar" />
            <fileset file="${qedeq.dest.module}/qedeq_gui_se/qedeq_gui_se-${qedeq.release.version}.jar" />
        </copy>
       
        <!-- copy licenses --> 
        <delete dir="${qedeq.dest}/license"/>
        <mkdir dir="${qedeq.dest}/license"/>
        <copy todir="${qedeq.dest}/license">
            <fileset dir="${qedeq.resources}/licenses" includes="gpl.html,fdl.html,*license.txt" />
            <filterset refid="qedeq_filter" />
        </copy>
        <delete dir="${qedeq.dest}/sample"/>
        <mkdir dir="${qedeq.dest}/sample"/>
        <copy todir="${qedeq.dest}/sample" flatten="true"> 
            <fileset dir="${qedeq.dest.module}/QedeqKernelBo/target/test-outdir/doc/"
                includes="**/*.xml"
            />
            <fileset dir="${qedeq.dest.module}/QedeqKernelBo/src/test/resources/data"
                includes="*_error.xml,qedeq_error_sample_*.xml,predlogic.xml,proplogic.xml"
            />
            <fileset dir="${basedir}/QedeqDoc"
                includes="**/*.xml"
            />
        </copy>
       
        <!-- copy binaries --> 
        <delete dir="${qedeq.dest}/bin"/>
        <mkdir dir="${qedeq.dest}/bin"/>
        <copy todir="${qedeq.dest}/bin">
            <fileset dir="${qedeq.resources}/bin/" includes="*.bat,*.sh" excludes="qedeq_se.*,xml2*.*"/>
            <filterset refid="qedeq_filter" />
        </copy>
        <copy todir="${qedeq.dest}">
            <fileset dir="${qedeq.resources}/bin/" includes="qedeq_se.*"/>
            <filterset refid="qedeq_filter" />
        </copy>
        <copy todir="${qedeq.dest}">
            <fileset dir="${qedeq.resources}/pictures" includes="qedeq.png" />
        </copy>
     
        <!-- create log directory -->   
        <delete dir="${qedeq.dest}/log" />
        <mkdir dir="${qedeq.dest}/log" />

        <!-- create config directory -->   
        <delete dir="${qedeq.dest}/config" />
        <mkdir dir="${qedeq.dest}/config" />
        <copy todir="${qedeq.dest}/config">
            <fileset file="${qedeq.dest.module}/qedeq_gui_se/src/main/resources/config/*" 
                excludes="**/log4j.properties" />
            <filterset refid="qedeq_filter" />
        </copy>
     
        <!-- create buffer directory -->   
        <delete dir="${qedeq.dest}/buffer" />
        <mkdir dir="${qedeq.dest}/buffer" />
     
        <!-- create source directory -->
        <delete dir="${qedeq.dest}/src" failonerror="false"/>
        <mkdir dir="${qedeq.dest}/src/eclipse" />
        <copy todir="${qedeq.dest}/src/eclipse">
            <fileset dir="${basedir}">
                <include name="QedeqBase/**/*" />
                <include name="QedeqBaseTest/**/*" />
                <include name="QedeqKernelSe/**/*" />
                <include name="QedeqKernelSeTest/**/*" />
                <include name="QedeqKernelBo/**/*" />
                <include name="QedeqKernelBoTest/**/*" />
                <include name="QedeqKernelXml/**/*" />
                <include name="QedeqKernelXmlTest/**/*" />
                <include name="QedeqGuiSe/**/*" />
                <include name="QedeqLib/**/*" />
                <include name="QedeqBuild/**/*" />
                <exclude name="*/bin/**/*" />
                <exclude name="**/trace*.log" />
            </fileset>
        </copy>
        
        <!-- copy various reports -->
        <assembleReports  name="QedeqBase"      dir="${qedeq.dest.module}/QedeqBase"      />
        <assembleReports  name="QedeqKernelSe"  dir="${qedeq.dest.module}/QedeqKernelSe"  />
        <assembleReports  name="QedeqKernelBo"  dir="${qedeq.dest.module}/QedeqKernelBo"  />
        <assembleReports  name="QedeqKernelXml" dir="${qedeq.dest.module}/QedeqKernelXml" />
        <assembleReports  name="qedeq_kernel"   dir="${qedeq.dest.module}/qedeq_kernel"   />
        <assembleReports  name="qedeq_gui_se"   dir="${qedeq.dest.module}/qedeq_gui_se"   />

        <!-- create also maven structure with POM s -->   
        <delete dir="${qedeq.dest}/src/maven" failonerror="false" />
        <mkdir dir="${qedeq.dest}/src/maven" />
        <copy todir="${qedeq.dest}/src/maven">
            <fileset dir="${qedeq.dest.module}">
                <include name="qedeq_kernel/src/**/*" />
                <include name="qedeq_gui_se/**/*" />
            </fileset>
        </copy>
        <copy todir="${qedeq.dest}/src/maven/qedeq_kernel" file="${qedeq.resources}/pom/qedeq_kernel/pom.xml" />
        <copy todir="${qedeq.dest}/src/maven/qedeq_gui_se" file="${qedeq.resources}/pom/qedeq_gui_se/pom.xml" />

        <fail message="JUnit tests had errors" if="qedeq.junitfailure" />
    </target>
             
    <target name="release" depends="assemble">
        <!-- we exclude "xml/qedeq/*" because xsddoc seems to hold a lock on these files -->
        <!-- Windows -->
        <fixcrlf srcdir="${qedeq.dest}"
            eol="dos" 
            eof="remove"
            includes="**/*.sh,**/*.java,**/*.html,**/*.txt,**/*.properties,**/*.tex,**/*.xml,**/*.xsd"
            excludes="xml/qedeq/**"   
        />
        <zip whenempty="create"
          zipfile="${qedeq.dist}/qedeq_${qedeq.release.version}_win.zip"
        >
          <fileset dir="${qedeq.dest}/.." 
            includes="${qedeq.directory}/**"
          />
        </zip>
        
        <!-- Unix -->
        <fixcrlf srcdir="${qedeq.dest}"
             eol="unix" 
             eof="remove"
            includes="**/*.sh,**/*.java,**/*.html,**/*.txt,**/*.properties,**/*.tex,**/*.xml,**/*.xsd"
            excludes="xml/qedeq/**"   
        />
        <tar
          destfile="${qedeq.dist}/qedeq_${qedeq.release.version}_unx.tar.bz2"
          defaultexcludes="no"
          compression="bzip2"
        >
          <tarfileset dir="${qedeq.dest}/.." 
            includes="${qedeq.directory}/**/*" 
            excludes="**/*.sh" 
          />
          <tarfileset dir="${qedeq.dest}/.."
            mode="755"
            includes="${qedeq.directory}/**/*.sh" 
          />
        </tar>

        <!-- mac -->
    <!--
        <fixcrlf srcdir="${qedeq.dest}"
             eol="mac" 
             eof="remove"
             includes="**/*.sh,**/*.java,**/*.html,**/*.txt,**/*.properties,**/*.tex,**/*.xml,**/*.xsd"
        />
        <zip whenempty="create"
          zipfile="${qedeq.dist}/qedeq_${qedeq.release.version}_mac.zip"
        >
          <fileset dir="${qedeq.dest}" 
          />
        </zip>
     -->
      </target>
        
    <target name="webstart" depends="assemble" description="sign jars to be able to webstart">
        <delete dir="${qedeq.webstart}" />
        <mkdir dir="${qedeq.webstart}" />
        <copy todir="${qedeq.webstart}">
            <fileset dir="${qedeq.dest}/lib" />
        </copy>
        <signjar jar="${qedeq.webstart}/qedeq_kernel-${qedeq.release.version}.jar" alias="qedeqkey"
            storepass="Iewsss#WhadUg" keystore="${qedeq.resources}/webstart/qedeqKey.bin"/>
        <signjar jar="${qedeq.webstart}/qedeq_gui_se-${qedeq.release.version}.jar" alias="qedeqkey"
            storepass="Iewsss#WhadUg" keystore="${qedeq.resources}/webstart/qedeqKey.bin"/>
        <signjar jar="${qedeq.webstart}/commons-io-1.4.jar" alias="qedeqkey"
            storepass="Iewsss#WhadUg" keystore="${qedeq.resources}/webstart/qedeqKey.bin"/>
        <signjar jar="${qedeq.webstart}/commons-lang-2.4.jar" alias="qedeqkey"
            storepass="Iewsss#WhadUg" keystore="${qedeq.resources}/webstart/qedeqKey.bin"/>
        <signjar jar="${qedeq.webstart}/commons-logging-1.1.1.jar" alias="qedeqkey"
            storepass="Iewsss#WhadUg" keystore="${qedeq.resources}/webstart/qedeqKey.bin"/>
        <signjar jar="${qedeq.webstart}/log4j-1.2.14.jar" alias="qedeqkey"
            storepass="Iewsss#WhadUg" keystore="${qedeq.resources}/webstart/qedeqKey.bin"/>
        <signjar jar="${qedeq.webstart}/forms-1.1.0.jar" alias="qedeqkey"
            storepass="Iewsss#WhadUg" keystore="${qedeq.resources}/webstart/qedeqKey.bin"/>
        <signjar jar="${qedeq.webstart}/looks-2.1.4.jar" alias="qedeqkey"
            storepass="Iewsss#WhadUg" keystore="${qedeq.resources}/webstart/qedeqKey.bin"/>
        <signjar jar="${qedeq.webstart}/xercesImpl.jar" alias="qedeqkey"
            storepass="Iewsss#WhadUg" keystore="${qedeq.resources}/webstart/qedeqKey.bin"/>
        <signjar jar="${qedeq.webstart}/xml-apis.jar" alias="qedeqkey"
            storepass="Iewsss#WhadUg" keystore="${qedeq.resources}/webstart/qedeqKey.bin"/>
        <copy todir="${qedeq.webstart}">
            <fileset file="${qedeq.resources}/webstart/qedeq.jnlp" />
            <filterset refid="qedeq_filter" />
        </copy>
        <copy todir="${qedeq.webstart}">
            <fileset file="${qedeq.resources}/pictures/splash.gif" />
            <fileset file="${qedeq.resources}/pictures/qedeq.png" />
        </copy>
    </target>
 
    <target name="maven" description="start maven build"> <!-- depends="release"-->
        <antcall target="execMaven">
            <param name="PomDir" value="${qedeq.dest}/src/maven/qedeq_kernel"/>
            <param name="MvnArguments" value="install"/>
<!--            
            <param name="MvnArguments" value="-Dmaven.test.skip=true site"/>
-->            
        </antcall>
        <antcall target="execMaven">
            <param name="PomDir" value="${qedeq.dest}/src/maven/qedeq_kernel"/>
            <param name="MvnArguments" value="site"/>
<!--            
            <param name="MvnArguments" value="-Dmaven.test.skip=true site"/>
-->            
        </antcall>
        <antcall target="execMaven">
            <param name="PomDir" value="${qedeq.dest}/src/maven/qedeq_gui_se"/>
            <param name="MvnArguments" value="install"/>
<!--            
            <param name="MvnArguments" value="-Dmaven.test.skip=true site"/>
-->            
        </antcall>
        <antcall target="execMaven">
            <param name="PomDir" value="${qedeq.dest}/src/maven/qedeq_gui_se"/>
            <param name="MvnArguments" value="site"/>
<!--            
            <param name="MvnArguments" value="-Dmaven.test.skip=true site"/>
-->            
        </antcall>
    </target>   

    <!-- for antcalls with parameters ${PomDir} and ${MvnArguments}-->
    <target name="execMaven">
        <echo>++++++++++++++++++++++++++++++++++</echo>
        <echo>${PomDir} mvn ${MvnArguments}</echo>
        <!-- FIXME only windows!!!! -->
        <exec dir="${PomDir}" executable="cmd">
            <arg line="/c mvn ${MvnArguments}"/>
        </exec> 
        <echo>----------------------------------</echo>
    </target>
    
    <target name="all"
        depends="clean,compile,test,package,doc,assemble,release,webstart,maven">
    </target>

</project>


