Skip to content

Commit

Permalink
Add Provide-Capability OSGi header to engine bundles
Browse files Browse the repository at this point in the history
Fixes #2100. Closes #2544.
  • Loading branch information
kriegfrj authored and marcphilipp committed May 13, 2021
1 parent a02c62a commit 6359e51
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
14 changes: 14 additions & 0 deletions junit-jupiter-engine/junit-jupiter-engine.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import aQute.bnd.gradle.BundleTaskConvention
import org.gradle.api.tasks.PathSensitivity.RELATIVE

plugins {
Expand Down Expand Up @@ -28,3 +29,16 @@ tasks {
inputs.dir("src/test/resources").withPathSensitivity(RELATIVE)
}
}

tasks {
jar {
withConvention(BundleTaskConvention::class) {
bnd("""
Provide-Capability:\
org.junit.platform.engine;\
org.junit.platform.engine='junit-jupiter';\
version:Version="${'$'}{version_cleanup;${project.version}}"
""")
}
}
}
7 changes: 6 additions & 1 deletion junit-vintage-engine/junit-vintage-engine.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import aQute.bnd.gradle.BundleTaskConvention;
import aQute.bnd.gradle.BundleTaskConvention

plugins {
`java-library-conventions`
Expand Down Expand Up @@ -47,6 +47,11 @@ tasks {
org.junit.runner.*;version="[${junit4Min},5)",\
org.junit.runners.model;version="[${junit4Min},5)",\
*
Provide-Capability:\
org.junit.platform.engine;\
org.junit.platform.engine='junit-vintage';\
version:Version="${'$'}{version_cleanup;${project.version}}"
""")
}
}
Expand Down

0 comments on commit 6359e51

Please sign in to comment.