mirror of https://github.com/qos-ch/slf4j
111 lines
3.5 KiB
XML
Executable File
111 lines
3.5 KiB
XML
Executable File
<project name="osgi-test" default="testAll">
|
|
|
|
<!--
|
|
This build file is usually run indirectly via Maven.
|
|
|
|
When running this build file through Ant directly, you must
|
|
define the currentVersion property on the command line, e.g.:
|
|
|
|
ant -DcurrentVersion=1.5.4-SNAPSHOT
|
|
-->
|
|
|
|
<echo message="compile classpath: ${currentVersion}" />
|
|
<echo message="test classpath: ${test_classpath}" />
|
|
<echo message="basedir: ${basedir}" />
|
|
|
|
<echo message="ant.java.version: ${ant.java.version}" />
|
|
|
|
<property name="iBundleJar" value="target/iBundle.jar"/>
|
|
<property name="bundlesDir" value="bundle"/>
|
|
|
|
|
|
<!-- this is really very ugly, but it's the only way to circumvent
|
|
http://jira.codehaus.org/browse/MANTRUN-95
|
|
|
|
<taskdef name="junit" classpath="${test_classpath}"
|
|
classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask" />
|
|
-->
|
|
|
|
<condition property="jdk9">
|
|
<matches pattern="9.*" string="${ant.java.version}" />
|
|
</condition>
|
|
|
|
<path id="minimal">
|
|
<pathelement location="target/test-classes/" />
|
|
</path >
|
|
|
|
<target name="init">
|
|
<mkdir dir="target/unit-reports" />
|
|
</target>
|
|
|
|
<target name="createIBundle">
|
|
<mkdir dir="${bundlesDir}"/>
|
|
<jar destFile="${iBundleJar}"
|
|
manifest="src/IBUNDLE-META-INF/MANIFEST.MF"
|
|
basedir="target/test-classes/"
|
|
includes="integrator/**.class"/>
|
|
|
|
</target>
|
|
|
|
<target name="testAll" depends="init, createIBundle, nop, simple, jdk14">
|
|
</target>
|
|
|
|
|
|
<macrodef name="prepareOSGiHarness">
|
|
<attribute name="binding"/>
|
|
<sequential>
|
|
<delete>
|
|
<fileset dir="${bundlesDir}" includes="*.jar"/>
|
|
</delete>
|
|
<copy file="${iBundleJar}" todir="${bundlesDir}"/>
|
|
<copy file="../slf4j-api/target/slf4j-api-${currentVersion}.jar" todir="${bundlesDir}"/>
|
|
<copy file="../slf4j-@{binding}/target/slf4j-@{binding}-${currentVersion}.jar" todir="${bundlesDir}"/>
|
|
<echo>value of t = @{t}</echo>
|
|
</sequential>
|
|
</macrodef>
|
|
|
|
|
|
<!-- for some reason if mvn is invoked from the parent directory, junit gets
|
|
invoked from the parent dir, which messes up these tests. Hence, the
|
|
fork="yes" dir="${basedir}" -->
|
|
|
|
<!--
|
|
<jvmarg line="MINUS_MINUSadd-opens java.base/java.net=ALL-UNNAMED"/>
|
|
<jvmarg line="MINUS_MINUSadd-opens java.base/java.security=ALL-UNNAMED"/>
|
|
-->
|
|
|
|
<target name="nop" unless="jdk9">
|
|
<prepareOSGiHarness binding="nop"/>
|
|
<junit printsummary="yes" fork="yes" dir="${basedir}" haltonfailure="yes">
|
|
<classpath path="${test_classpath}"/>
|
|
<formatter type="plain" />
|
|
<test todir="target/unit-reports"
|
|
name="org.slf4j.test_osgi.BundleTest"
|
|
outfile="OSGI-nop" />
|
|
</junit>
|
|
</target>
|
|
|
|
<target name="simple" unless="jdk9">
|
|
<prepareOSGiHarness binding="simple"/>
|
|
<junit printsummary="yes" fork="yes" dir="${basedir}" haltonfailure="yes">
|
|
<classpath path="${test_classpath}"/>
|
|
<formatter type="plain" />
|
|
<test fork="yes" todir="target/unit-reports"
|
|
name="org.slf4j.test_osgi.BundleTest"
|
|
outfile="OSGI-simple" />
|
|
</junit>
|
|
</target>
|
|
|
|
<target name="jdk14" unless="jdk9">
|
|
<prepareOSGiHarness binding="jdk14"/>
|
|
<junit printsummary="yes" fork="yes" dir="${basedir}" haltonfailure="yes">
|
|
<classpath path="${test_classpath}"/>
|
|
<formatter type="plain" />
|
|
<test fork="yes" todir="target/unit-reports"
|
|
name="org.slf4j.test_osgi.BundleTest"
|
|
outfile="OSGI-jdk14"/>
|
|
</junit>
|
|
</target>
|
|
|
|
</project>
|