Skip to content

Commit 6359e51

Browse files
kriegfrjmarcphilipp
authored andcommitted
Add Provide-Capability OSGi header to engine bundles
Fixes #2100. Closes #2544.
1 parent a02c62a commit 6359e51

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

junit-jupiter-engine/junit-jupiter-engine.gradle.kts

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import aQute.bnd.gradle.BundleTaskConvention
12
import org.gradle.api.tasks.PathSensitivity.RELATIVE
23

34
plugins {
@@ -28,3 +29,16 @@ tasks {
2829
inputs.dir("src/test/resources").withPathSensitivity(RELATIVE)
2930
}
3031
}
32+
33+
tasks {
34+
jar {
35+
withConvention(BundleTaskConvention::class) {
36+
bnd("""
37+
Provide-Capability:\
38+
org.junit.platform.engine;\
39+
org.junit.platform.engine='junit-jupiter';\
40+
version:Version="${'$'}{version_cleanup;${project.version}}"
41+
""")
42+
}
43+
}
44+
}

junit-vintage-engine/junit-vintage-engine.gradle.kts

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import aQute.bnd.gradle.BundleTaskConvention;
1+
import aQute.bnd.gradle.BundleTaskConvention
22

33
plugins {
44
`java-library-conventions`
@@ -47,6 +47,11 @@ tasks {
4747
org.junit.runner.*;version="[${junit4Min},5)",\
4848
org.junit.runners.model;version="[${junit4Min},5)",\
4949
*
50+
51+
Provide-Capability:\
52+
org.junit.platform.engine;\
53+
org.junit.platform.engine='junit-vintage';\
54+
version:Version="${'$'}{version_cleanup;${project.version}}"
5055
""")
5156
}
5257
}

0 commit comments

Comments
 (0)