forked from qos-ch/logback
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathosgi-build.xml
executable file
·112 lines (84 loc) · 3.93 KB
/
osgi-build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<project name="osgi-test" default="testAll">
<!--
This build file is intended for testing purposes. It does not
actually package or create any files with a lifespan beyond that
of the current test cycle.
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
See test results in target/unit-reports
-->
<!-- We skip the test if the maven.test.skip system property is set
to true. See also http://jira.qos.ch/browse/LBCLASSIC-191 -->
<!--
<property name="slf4j.version" value="1.7.20"/>
<property name="org.slf4j:slf4j-api:jar" value="c:/Users/ceki/.m2/repository/org/slf4j/slf4j-api/1.7.20/slf4j-api-1.7.20.jar"/>
<property name="org.apache.felix:org.apache.felix.main:jar" value="c:/Users/ceki/.m2/repository/org/apache/felix/org.apache.felix.main/2.0.2/org.apache.felix.main-2.0.2.jar" />
-->
<echo message="currentVersion: ${currentVersion}" />
<echo message="slfj4: ${org.slf4j:slf4j-api:jar}" />
<echo message="felix: ${org.apache.felix:org.apache.felix.main:jar}" />
<property name="iBundleJar" value="target/iBundle.jar"/>
<!-- jar in the folder named "bundle" are auto-deployed by Felix -->
<property name="bundlesDir" value="bundle"/>
<echo message="===============================" />
<echo message="basedir:${basedir}" />
<echo message="===============================" />
<path id="basicCP">
<pathelement location="${org.apache.felix:org.apache.felix.main:jar}" />
<pathelement location="target/classes/" />
<pathelement location="target/test-classes" />
</path >
<path id="minimal">
<pathelement location="target/test-classes/" />
</path >
<target name="copySLF4J_JAR">
<echo>Making lib/ folder in case it does not already exist.</echo>
<mkdir dir="lib/"/>
<echo>Copying ${org.slf4j:slf4j-api:jar} to lib/</echo>
<!-- sneak in a clean up procedure of the ../logback-examples/lib/ folder-->
<delete quiet="true">
<fileset dir="../logback-examples/lib/" includes="slf4j-*SNAPSHOT.jar" />
</delete>
<copy file="${org.slf4j:slf4j-api:jar}" todir="lib/" />
</target>
<target name="init" depends="copySLF4J_JAR">
<echo message="in init"/>
<mkdir dir="target/unit-reports" />
</target>
<target name="createIBundle" unless="maven.test.skip">
<echo message="Making folder ${bundlesDir}"/>
<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, logback" unless="maven.test.skip">
</target>
<macrodef name="prepareOSGiHarness">
<attribute name="binding"/>
<sequential>
<delete>
<fileset dir="${bundlesDir}" includes="*.jar"/>
</delete>
<copy file="${iBundleJar}" todir="${bundlesDir}"/>
<copy file="lib/slf4j-api-${slf4j.version}.jar" todir="${bundlesDir}"/>
<copy file="../logback-core/target/logback-core-${currentVersion}.jar" todir="${bundlesDir}"/>
<copy file="target/logback-classic-${currentVersion}.jar" todir="${bundlesDir}"/>
<echo>value of binding = @{binding}</echo>
</sequential>
</macrodef>
<!-- for some reason if mvn is invoked from the parent directory, junit gets
invoked from the parent dir, which messes up theseg tests. Hence, the
fork="yes" dir="${basedir}" -->
<target name="logback" unless="maven.test.skip">
<prepareOSGiHarness binding="logback"/>
<junit printsummary="yes" fork="yes" dir="${basedir}" haltonfailure="yes">
<classpath refid="basicCP"/>
<formatter type="plain" />
<test fork="yes" todir="target/unit-reports" name="org.slf4j.test_osgi.BundleTest" />
</junit>
</target>
</project>