Skip to content

Commit

Permalink
Fix gradle check with JDK17+ (#5735)
Browse files Browse the repository at this point in the history
The new version of the BND plugin does not have the same issue when running the `check` command, but the new version of the BND plugin requires JDK 17, so we can't use it when JDK 11 is being used to build the project.

See gh-5599
  • Loading branch information
ngocnhan-tran1996 authored Jan 22, 2025
1 parent fa620c6 commit 826166a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
7 changes: 6 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ buildscript {
classpath libs.plugin.japicmp
classpath libs.plugin.downloadTask
classpath libs.plugin.spotless
classpath libs.plugin.bnd

if (javaLanguageVersion.asInt() < 17) {
classpath libs.plugin.bnd
} else {
classpath libs.plugin.bndForJava17
}

constraints {
classpath(libs.asmForPlugins) {
Expand Down
1 change: 1 addition & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ plugin-japicmp = { module = "me.champeau.gradle:japicmp-gradle-plugin", version
plugin-downloadTask = { module = "de.undercouch:gradle-download-task", version = "5.6.0" }
plugin-spotless = { module = "com.diffplug.spotless:spotless-plugin-gradle", version = "6.25.0" }
plugin-bnd = "biz.aQute.bnd:biz.aQute.bnd.gradle:6.4.0"
plugin-bndForJava17 = "biz.aQute.bnd:biz.aQute.bnd.gradle:7.1.0"

[plugins]
kotlin19 = { id = "org.jetbrains.kotlin.jvm", version = "1.9.25" }
Expand Down
5 changes: 3 additions & 2 deletions micrometer-osgi-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ dependencies {
def testingBundle = tasks.register('testingBundle', Bundle) {
archiveClassifier = 'tests'
from sourceSets.test.output
sourceSet = sourceSets.test

if (javaLanguageVersion.asInt() < 17) {
sourceSet = sourceSets.test
}
bundle {
bnd """\
Bundle-SymbolicName: \${task.archiveBaseName}-\${task.archiveClassifier}
Expand Down

0 comments on commit 826166a

Please sign in to comment.