Source

ultraesb / build.xml

<?xml version="1.0" encoding="UTF-8"?>
<project name="ultraesb">

    <path id="classpath">
        <fileset dir="${user.home}/java/jars"> <!--Create this path by extracting the Zip before running Ant-->
            <include name="**/*.jar"/>          <!--Also copy commons-discovery-0.2.jar which is a unit test dependency into lib/samples-->
        </fileset>
        <fileset dir="${user.home}/java/libs/cobertura-1.9.4.1">                       <!--Ensure presence of cobertura-->
            <include name="cobertura.jar"/>
            <include name="lib/**/*.jar"/>
        </fileset>
        <fileset dir="${user.home}/java/libs/saxon">                           <!--Ensure presence of Saxon HE-->
            <include name="*.jar"/>
        </fileset>
        <fileset dir="${user.home}/.m2/repository/commons-discovery/commons-discovery/0.2">
            <include name="*.jar"/>                          <!--Ensure presence of Commons Discovery for WS-Sec testing-->
        </fileset>
        <fileset dir="${user.home}/.m2/repository/org/codehaus/groovy/groovy/1.7.5">
            <include name="*.jar"/>                          <!--Ensure presence of Groovy for test-->
        </fileset>
        <fileset dir="${user.home}/.m2/repository/antlr/antlr/2.7.7">
            <include name="*.jar"/>                          <!--Ensure presence of Antlr-->
        </fileset>
        <fileset dir="/opt/jdk/lib">
            <include name="tools.jar"/>
        </fileset>
    </path>

    <taskdef classpathref="classpath" resource="tasks.properties" />

    <target name="javadoc" description="Generate Javadocs">
        <javadoc destdir="resources/docs/javadocs" author="false" doclet="ExcludeDoclet" docletpath="resources/lib/exclude-doclet.jar"
                 footer="Copyright (c) 2010-2013 AdroitLogic Private Ltd. All rights reserved."
                 header="&lt;b&gt;AdroitLogic UltraESB v2.0.0-SNAPSHOT&lt;/b&gt;">
            <classpath location="modules/api/src/main/java"/>
            <classpath location="modules/core/src/main/java"/>
            <classpath refid="classpath"/>
            <packageset dir="modules/api/src/main/java"/>
            <fileset dir="modules/core/src/main/java" defaultexcludes="yes">
                <include name="org/adroitlogic/ultraesb/core/work/SimpleQueueWorkManager.java"/>
                <include name="org/adroitlogic/ultraesb/core/work/WorkManager.java"/>
                <exclude name="org/adroitlogic/ultraesb/transport/base/*.java"/>
                <include name="org/adroitlogic/ultraesb/core/work/SimpleQueueWorkManager.java"/>
                <include name="org/adroitlogic/ultraesb/core/work/WorkManager.java"/>
                <include name="org/adroitlogic/ultraesb/core/Configuration.java"/>
                <include name="org/adroitlogic/ultraesb/core/FileCache.java"/>
                <include name="org/adroitlogic/ultraesb/core/PooledMessageFileCache.java"/>
                <include name="org/adroitlogic/ultraesb/ServerManager.java"/>
                <include name="org/adroitlogic/ultraesb/transport/**/*Listener.java"/>
                <include name="org/adroitlogic/ultraesb/transport/**/*Sender.java"/>
                <include name="org/adroitlogic/ultraesb/transport/http/RequestFilter.java"/>
                <include name="org/adroitlogic/ultraesb/transport/http/ServiceResourceRequestFilter.java"/>
                <include name="org/adroitlogic/ultraesb/transport/http/URLAuthenticator.java"/>
                <include name="org/adroitlogic/soapbox/WSSecurityManager.java"/>
                <include name="org/adroitlogic/as2/manager/AS2Manager.java"/>
                <include name="org/adroitlogic/as2/util/KeystoreManager.java"/>
            </fileset>
        </javadoc>
    </target>

    <property name="build-root" value="."/>
    <property name="instrumented" value="${build-root}/target/instrumented"/>
    <property name="build" value="${build-root}/target/classes"/>

<property name="default.javac.source" value="1.6"/>
<property name="default.javac.target" value="1.6"/> 

    <target name="clean" description="Cleanup all">
        <delete dir="${build-root}/target"/>
        <delete dir="${build-root}/resources/docs/javadocs"/>
    </target>

    <target name="init" depends="clean" description="Initialize">
        <mkdir dir="${build}"/>
        <mkdir dir="${instrumented}"/>
        <mkdir dir="${build-root}/target/junit"/>
        <mkdir dir="${build-root}/modules/core/target/site/cobertura"/> <!--This is a hack due to MCOBERTURA-65-->
    </target>

    <target name="compile" depends="init">
        <javac source="1.6" target="1.6" srcdir="${build-root}/modules/api/src/main/java"    destdir="${build}" classpathref="classpath" debug="true" debuglevel="vars,lines,source" includeantruntime="false"/>
        <javac source="1.6" target="1.6" srcdir="${build-root}/modules/jmx/src/main/java"    destdir="${build}" classpathref="classpath" debug="true" debuglevel="vars,lines,source" includeantruntime="false"/>
        <javac source="1.6" target="1.6" srcdir="${build-root}/modules/core/src/main/java"   destdir="${build}" classpathref="classpath" debug="true" debuglevel="vars,lines,source" includeantruntime="false"/>
        <javac source="1.6" target="1.6" srcdir="${build-root}/modules/core/src/test/java"   destdir="${build}" classpathref="classpath" debug="true" debuglevel="vars,lines,source" includeantruntime="false"/>
        <javac source="1.6" target="1.6" srcdir="${build-root}/modules/sample/src/main/java" destdir="${build}" classpathref="classpath" debug="true" debuglevel="vars,lines,source" includeantruntime="false"/>
        <javac source="1.6" target="1.6" srcdir="${build-root}/modules/sample/src/test/java" destdir="${build}" classpathref="classpath" debug="true" debuglevel="vars,lines,source" includeantruntime="false"/>
        <!--<copy file="${src}/org/adroitlogic/ultraesb/core/spring/ultraesb-1.0.xsd"
              tofile="${build}/org/adroitlogic/ultraesb/core/spring/ultraesb-1.0.xsd"/>-->
        <copy todir="${build}">
            <fileset dir="${build-root}/modules/sample/src/test/resources" includes="*.properties"/>
        </copy>
    </target>

    <target name="instrument" depends="compile">
        <cobertura-instrument todir="${instrumented}" datafile="${build-root}/target/cobertura.ser">
            <fileset dir="${build}">
                <include name="**/*.class"/>
                <exclude name="**/*Test.class"/>
            </fileset>
            <ignore regex="org.apache.log4j.*"/>
        </cobertura-instrument>
    </target>

    <target name="coverage" depends="instrument">
        <junit printsummary="on" fork="true" haltonfailure="false" failureproperty="tests.failed" showoutput="no" dir="${build-root}/resources/">
            <sysproperty key="net.sourceforge.cobertura.datafile" file="${build-root}/target/cobertura.ser" />
            <sysproperty key="unittest" value="true"/>
            <classpath location="${instrumented}"/>
            <classpath location="${build}"/>
            <classpath refid="classpath"/>
            <formatter type="xml"/>
            <batchtest todir="${build-root}/target/junit">
                <fileset dir="${build-root}/modules/core/src/test/java">
                    <include name="**/*Test.java"/>
                </fileset>
                <fileset dir="${build-root}/modules/sample/src/test/java">
                    <include name="**/*Test.java"/>
                </fileset>
            </batchtest>
        </junit>
    </target>

    <target name="report" depends="coverage">
        <cobertura-report datafile="${build-root}/target/cobertura.ser" srcdir="${build-root}" destdir="${build-root}/modules/core/target/site/cobertura" format="xml">
            <!--The above destination directory is a hack due to MCOBERTURA-65-->
            <fileset dir="${build-root}/modules/core/src/main/java">
                <include name="**/*.java"/>
            </fileset>
            <fileset dir="${build-root}/modules/sample/src/main/java">
                <include name="**/*.java"/>
            </fileset>
        </cobertura-report>
    </target>

    <!--<target name="pmd">
        <taskdef classpathref="classpath" name="pmd" classname="net.sourceforge.pmd.ant.PMDTask"/>
        <pmd rulesetfiles="imports">
            <formatter type="html" toFile="/tmp/pmd_report.html" toConsole="true"/>
            <fileset dir="${src}">
                <include name="**/*.java"/>
            </fileset>
        </pmd>
    </target>

    <target name="cpd">
        <taskdef name="cpd" classpathref="classpath" classname="net.sourceforge.pmd.cpd.CPDTask"/>
        <cpd minimumTokenCount="100" outputFile="/tmp/cpd.txt">
            <fileset dir="${src}">
                <include name="**/*.java"/>
            </fileset>
        </cpd>
    </target>-->

</project>