Skip to content

Commit

Permalink
Compile and run with java 11, but require java 17 to run gradle
Browse files Browse the repository at this point in the history
The bnd (osgi) plugin requires 17 or above. The Gradle toolchain will
ensure that java 11 is installed (automatically if absent), compile,
and the class version will be 11 based. The build tool alone will
require 17 or above. This is how the github action is already set up,
so there is zero change except for local dev and jitpack snapshots.
  • Loading branch information
ben-manes committed Nov 6, 2023
1 parent 7aab3aa commit fb9dc5a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .java-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
11.0
17
2 changes: 2 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ plugins {
id("root-caffeine-conventions")
}

require(Runtime.version().feature() >= 17) { "Please use Java 17 or above to run the build" }

allprojects {
description = "A high performance caching library"
group = "com.github.ben-manes.caffeine"
Expand Down
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ asm = "9.6"
auto-value = "1.10.4"
awaitility = "4.2.0"
bcel = "6.6.1"
bnd = "6.4.0"
bnd = "7.0.0"
bouncycastle = "1.70"
cache2k = "2.6.1.Final"
caffeine = "3.1.8"
Expand Down Expand Up @@ -60,7 +60,7 @@ json-bind = "1.0"
jsoup = "1.16.2"
junit-testng = "1.0.4"
junit4 = "4.13.2"
junit5 = "5.10.0"
junit5 = "5.10.1"
kotlin = "1.9.20"
lincheck = "2.18.1"
mockito = "5.7.0"
Expand Down
1 change: 0 additions & 1 deletion gradle/plugins/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ tasks.withType<DependencyUpdatesTask> {
}
}
}
force(libs.bnd)
}
}

Expand Down
5 changes: 3 additions & 2 deletions jitpack.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
before_install:
- source "$HOME/.sdkman/bin/sdkman-init.sh"
- sdk update
- sdk install java 11.0.13-zulu
- sdk use java 11.0.13-zulu
- sdk install java 11.0.13-zulu # gradle toolchain
- sdk install java 17.0.9-zulu # gradle build
- sdk use java 17.0.9-zulu

0 comments on commit fb9dc5a

Please sign in to comment.