Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ tasks.withType<Jar>().named {

val importAPIGuardian by extra { "org.apiguardian.*;resolution:=\"optional\"" }
val importJSpecify by extra { "org.jspecify.*;resolution:=\"optional\"" }
val importJdkJfr by extra { "jdk.jfr;resolution:=\"optional\"" }

extensions.create<BundleTaskExtension>(BundleTaskExtension.NAME, this).apply {
properties.set(projectDescription.map {
Expand All @@ -38,6 +39,7 @@ tasks.withType<Jar>().named {
Import-Package: \
${importAPIGuardian},\
${importJSpecify},\
${importJdkJfr},\
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move these changes to the build script of junit-platform-launcher as they're specific to that module/bundle (see junit-platform-commons for an example).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marcphilipp I'm sadly not very familiar with gradle build scripts and looking at that build-script I'm not completely sure how to archive this, as that one adds an additional header and here we want to modify an existing definition. I could repeat the definition there but it seems a bit odd to maintain then.

Any suggestion?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries! I pushed a few commits. I agree that modifying an existing definition is not as DRY as one would wish.

org.junit.platform.commons.logging;status=INTERNAL,\
kotlin.*;resolution:="optional",\
*
Expand All @@ -47,6 +49,7 @@ tasks.withType<Jar>().named {
-fixupmessages.kotlin.import: "Unused Import-Package instructions: \\[kotlin.*\\]";is:=ignore
-fixupmessages.apiguardian.import: "Unused Import-Package instructions: \\[org.apiguardian.*\\]";is:=ignore
-fixupmessages.jspecify.import: "Unused Import-Package instructions: \\[org.jspecify.*\\]";is:=ignore
-fixupmessages.jdkjfr.import: "Unused Import-Package instructions: \\[jdk.jfr\\]";is:=ignore

# Don't scan for Class.forName package imports.
# See https://bnd.bndtools.org/instructions/noclassforname.html
Expand Down Expand Up @@ -86,8 +89,8 @@ val osgiProperties by tasks.registering(WriteProperties::class) {
property("-runee", Callable { "JavaSE-${javaLibrary.mainJavaVersion.get()}" })
}
property("-runrequires", "osgi.identity;filter:='(osgi.identity=${project.name})'")
property("-runsystempackages", "jdk.internal.misc,jdk.jfr,sun.misc")
// API Guardian should be optional -> instruct resolver to ignore it
property("-runsystempackages", "jdk.internal.misc,sun.misc")
// API Guardian and JDK JFR should be optional -> instruct resolver to ignore them
// during resolution. Resolve should still pass.
property("-runblacklist", "org.apiguardian.api")
}
Expand Down
Loading