|
|
|
@@ -24,10 +24,7 @@
|
|
|
|
|
<property name="build.outputDir" value="${build.dir}/classes"/>
|
|
|
|
|
<property name="build.srcDir" value="src/main/java"/>
|
|
|
|
|
<property name="build.resourceDir" value="src/main/resources"/>
|
|
|
|
|
<property name="build.testOutputDir" value="${build.dir}/test-classes"/>
|
|
|
|
|
<property name="build.testDir" value="src/test/java"/>
|
|
|
|
|
<property name="build.testResourceDir" value="src/test/resources"/>
|
|
|
|
|
<property name="test.reports" value="${build.dir}/test-reports"/>
|
|
|
|
|
|
|
|
|
|
<property name="reporting.outputDirectory" value="${build.dir}/site"/>
|
|
|
|
|
|
|
|
|
|
<property name="build.mdoDir" value="src/main/mdo"/>
|
|
|
|
@@ -39,15 +36,11 @@
|
|
|
|
|
|
|
|
|
|
<path id="build.classpath">
|
|
|
|
|
<fileset dir="lib">
|
|
|
|
|
<!-- plexus-utils-3.1.1 plexus-cipher-1.4 classworlds-1.1-alpha-2
|
|
|
|
|
plexus-container-default-1.0-alpha-9-stable-1.jar -->
|
|
|
|
|
<include name="**/*.jar"/>
|
|
|
|
|
</fileset>
|
|
|
|
|
</path>
|
|
|
|
|
<path id="build.test.classpath">
|
|
|
|
|
<fileset dir="lib">
|
|
|
|
|
<!-- plexus-utils-3.1.1 plexus-cipher-1.4 classworlds-1.1-alpha-2
|
|
|
|
|
plexus-container-default-1.0-alpha-9-stable-1.jar junit-3.8.2 -->
|
|
|
|
|
<include name="**/*.jar"/>
|
|
|
|
|
</fileset>
|
|
|
|
|
</path>
|
|
|
|
@@ -119,118 +112,25 @@
|
|
|
|
|
</target>
|
|
|
|
|
|
|
|
|
|
<!-- ====================================================================== -->
|
|
|
|
|
<!-- Plexus component.xml generation target -->
|
|
|
|
|
<!-- Sisu javax.inject.Named generation target -->
|
|
|
|
|
<!-- ====================================================================== -->
|
|
|
|
|
|
|
|
|
|
<target name="gen-meta"
|
|
|
|
|
<target name="sisu"
|
|
|
|
|
depends="compile"
|
|
|
|
|
description="Generate Plexus component.xml">
|
|
|
|
|
<mkdir dir="${build.outputDir}/META-INF/plexus"/>
|
|
|
|
|
<exec executable="plexus-metadata-generator" failonerror="true">
|
|
|
|
|
<env key="CLASSPATH" value="${build.outputDir}"/>
|
|
|
|
|
<arg value="-s"/>
|
|
|
|
|
<arg value="${build.srcDir}"/>
|
|
|
|
|
<arg value="-c"/>
|
|
|
|
|
<arg value="${build.outputDir}"/>
|
|
|
|
|
<arg value="-m"/>
|
|
|
|
|
<arg value="${build.outputDir}/META-INF/plexus"/>
|
|
|
|
|
<arg value="-o"/>
|
|
|
|
|
<arg value="${build.outputDir}/META-INF/plexus/components.xml"/>
|
|
|
|
|
</exec>
|
|
|
|
|
</target>
|
|
|
|
|
|
|
|
|
|
<!-- ====================================================================== -->
|
|
|
|
|
<!-- Test-compilation target -->
|
|
|
|
|
<!-- ====================================================================== -->
|
|
|
|
|
|
|
|
|
|
<target name="compile-tests"
|
|
|
|
|
depends="gen-meta"
|
|
|
|
|
description="Compile the test code"
|
|
|
|
|
unless="test.skip">
|
|
|
|
|
<mkdir dir="${build.testOutputDir}"/>
|
|
|
|
|
<javac destdir="${build.testOutputDir}"
|
|
|
|
|
nowarn="false"
|
|
|
|
|
debug="true"
|
|
|
|
|
optimize="false"
|
|
|
|
|
deprecation="true"
|
|
|
|
|
target="${compiler.target}"
|
|
|
|
|
verbose="false"
|
|
|
|
|
fork="false"
|
|
|
|
|
source="${compiler.source}">
|
|
|
|
|
<src>
|
|
|
|
|
<pathelement location="${build.testDir}"/>
|
|
|
|
|
</src>
|
|
|
|
|
<classpath>
|
|
|
|
|
<path refid="build.test.classpath"/>
|
|
|
|
|
<pathelement location="${build.outputDir}"/>
|
|
|
|
|
</classpath>
|
|
|
|
|
</javac>
|
|
|
|
|
<copy todir="${build.testOutputDir}">
|
|
|
|
|
<fileset dir="${build.testResourceDir}"/>
|
|
|
|
|
</copy>
|
|
|
|
|
</target>
|
|
|
|
|
|
|
|
|
|
<!-- ====================================================================== -->
|
|
|
|
|
<!-- Run all tests -->
|
|
|
|
|
<!-- ====================================================================== -->
|
|
|
|
|
|
|
|
|
|
<target name="test"
|
|
|
|
|
depends="compile-tests, junit-missing"
|
|
|
|
|
unless="junit.skipped"
|
|
|
|
|
description="Run the test cases">
|
|
|
|
|
<mkdir dir="${test.reports}"/>
|
|
|
|
|
<junit printSummary="yes" haltonerror="true" haltonfailure="true" fork="true" dir=".">
|
|
|
|
|
<sysproperty key="basedir" value="."/>
|
|
|
|
|
<formatter type="xml"/>
|
|
|
|
|
<formatter type="plain" usefile="false"/>
|
|
|
|
|
<classpath>
|
|
|
|
|
<path refid="build.test.classpath"/>
|
|
|
|
|
<pathelement location="${build.outputDir}"/>
|
|
|
|
|
<pathelement location="${build.testOutputDir}"/>
|
|
|
|
|
</classpath>
|
|
|
|
|
<batchtest todir="${test.reports}" unless="test">
|
|
|
|
|
<fileset dir="${build.testDir}">
|
|
|
|
|
<include name="**/Test*.java"/>
|
|
|
|
|
<include name="**/*Test.java"/>
|
|
|
|
|
<include name="**/*TestCase.java"/>
|
|
|
|
|
<exclude name="**/*Abstract*Test.java"/>
|
|
|
|
|
</fileset>
|
|
|
|
|
</batchtest>
|
|
|
|
|
<batchtest todir="${test.reports}" if="test">
|
|
|
|
|
<fileset dir="${build.testDir}">
|
|
|
|
|
<include name="**/${test}.java"/>
|
|
|
|
|
<exclude name="**/*Abstract*Test.java"/>
|
|
|
|
|
</fileset>
|
|
|
|
|
</batchtest>
|
|
|
|
|
</junit>
|
|
|
|
|
</target>
|
|
|
|
|
|
|
|
|
|
<target name="test-junit-present">
|
|
|
|
|
<available classname="junit.framework.Test" property="junit.present" classpathref="build.test.classpath"/>
|
|
|
|
|
</target>
|
|
|
|
|
|
|
|
|
|
<target name="test-junit-status"
|
|
|
|
|
depends="test-junit-present">
|
|
|
|
|
<condition property="junit.missing">
|
|
|
|
|
<and>
|
|
|
|
|
<isfalse value="${junit.present}"/>
|
|
|
|
|
<isfalse value="${test.skip}"/>
|
|
|
|
|
</and>
|
|
|
|
|
</condition>
|
|
|
|
|
<condition property="junit.skipped">
|
|
|
|
|
<or>
|
|
|
|
|
<isfalse value="${junit.present}"/>
|
|
|
|
|
<istrue value="${test.skip}"/>
|
|
|
|
|
</or>
|
|
|
|
|
</condition>
|
|
|
|
|
</target>
|
|
|
|
|
|
|
|
|
|
<target name="junit-missing"
|
|
|
|
|
depends="test-junit-status"
|
|
|
|
|
if="junit.missing">
|
|
|
|
|
<echo>=================================== WARNING ===================================</echo>
|
|
|
|
|
<echo> JUnit is not present in the test classpath or your $ANT_HOME/lib directory. Tests not executed.</echo>
|
|
|
|
|
<echo>===============================================================================</echo>
|
|
|
|
|
description="Generate javax.inject.Name index">
|
|
|
|
|
<sequential>
|
|
|
|
|
<java classname="org.eclipse.sisu.space.SisuIndex"
|
|
|
|
|
failonerror="true"
|
|
|
|
|
fork="true">
|
|
|
|
|
<classpath>
|
|
|
|
|
<path refid="build.classpath"/>
|
|
|
|
|
</classpath>
|
|
|
|
|
<arg value="${build.outputDir}"/>
|
|
|
|
|
</java>
|
|
|
|
|
<move todir="${build.outputDir}/META-INF">
|
|
|
|
|
<fileset dir="META-INF"/>
|
|
|
|
|
</move>
|
|
|
|
|
</sequential>
|
|
|
|
|
</target>
|
|
|
|
|
|
|
|
|
|
<!-- ====================================================================== -->
|
|
|
|
@@ -272,7 +172,7 @@
|
|
|
|
|
<!-- Package target -->
|
|
|
|
|
<!-- ====================================================================== -->
|
|
|
|
|
|
|
|
|
|
<target name="package" depends="gen-meta,test" description="Package the application">
|
|
|
|
|
<target name="package" depends="sisu" description="Package the application">
|
|
|
|
|
<jar jarfile="${build.dir}/${build.finalName}.jar"
|
|
|
|
|
compress="true"
|
|
|
|
|
index="false"
|
|
|
|
|