Skip to content

Commit ae06551

Browse files
ngocnhan-tran1996shakuzen
authored andcommitted
Fix gradle check with JDK17+ (#5735)
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 Closes gh-6515 (cherry picked from commit 826166a)
1 parent dfdb893 commit ae06551

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

build.gradle

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@ buildscript {
2020
classpath libs.plugin.japicmp
2121
classpath libs.plugin.downloadTask
2222
classpath libs.plugin.spotless
23-
classpath libs.plugin.bnd
23+
24+
if (javaLanguageVersion.asInt() < 17) {
25+
classpath libs.plugin.bnd
26+
} else {
27+
classpath libs.plugin.bndForJava17
28+
}
2429

2530
constraints {
2631
classpath(libs.asmForPlugins) {

gradle/libs.versions.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ plugin-japicmp = { module = "me.champeau.gradle:japicmp-gradle-plugin", version
225225
plugin-downloadTask = { module = "de.undercouch:gradle-download-task", version = "5.6.0" }
226226
plugin-spotless = { module = "com.diffplug.spotless:spotless-plugin-gradle", version = "6.25.0" }
227227
plugin-bnd = "biz.aQute.bnd:biz.aQute.bnd.gradle:6.4.0"
228+
plugin-bndForJava17 = "biz.aQute.bnd:biz.aQute.bnd.gradle:7.1.0"
228229

229230
[plugins]
230231
kotlin19 = { id = "org.jetbrains.kotlin.jvm", version = "1.9.24" }

micrometer-osgi-test/build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ dependencies {
2424
def testingBundle = tasks.register('testingBundle', Bundle) {
2525
archiveClassifier = 'tests'
2626
from sourceSets.test.output
27-
sourceSet = sourceSets.test
28-
27+
if (javaLanguageVersion.asInt() < 17) {
28+
sourceSet = sourceSets.test
29+
}
2930
bundle {
3031
bnd """\
3132
Bundle-SymbolicName: \${task.archiveBaseName}-\${task.archiveClassifier}

0 commit comments

Comments
 (0)