Skip to content

Commit

Permalink
Update build and test to require Java 21
Browse files Browse the repository at this point in the history
  • Loading branch information
marcphilipp committed Nov 17, 2023
1 parent 6687a76 commit 8930313
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/actions/run-gradle/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ runs:
id: setup-gradle-jdk
with:
distribution: temurin
java-version: 17
java-version: 21
- uses: gradle/gradle-build-action@v2
env:
JAVA_HOME: ${{ steps.setup-gradle-jdk.outputs.path }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cross-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
fail-fast: false
matrix:
jdk: [21, 22]
jdk: [22]
name: "OpenJDK ${{ matrix.jdk }}"
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
uses: graalvm/setup-graalvm@v1
with:
version: 'latest'
java-version: '17'
java-version: '21'
components: 'native-image'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ task outputs from previous CI builds.

## Building from Source

You need [JDK 17] to build JUnit 5. [Gradle toolchains] are used to detect and
You need [JDK 21] to build JUnit 5. [Gradle toolchains] are used to detect and
potentially download additional JDKs for compilation and test execution.

All modules can be _built_ and _tested_ with the [Gradle Wrapper] using the following command.
Expand Down Expand Up @@ -100,7 +100,7 @@ See also <https://repo1.maven.org/maven2/org/junit/> for releases and
[Gradle Wrapper]: https://docs.gradle.org/current/userguide/gradle_wrapper.html#sec:using_wrapper
[JaCoCo]: https://www.eclemma.org/jacoco/
[Javadoc]: https://junit.org/junit5/docs/current/api/
[JDK 17]: https://foojay.io/almanac/java-17/
[JDK 21]: https://foojay.io/almanac/java-21/
[Release Notes]: https://junit.org/junit5/docs/current/release-notes/
[Samples]: https://github.com/junit-team/junit5-samples
[StackOverflow]: https://stackoverflow.com/questions/tagged/junit5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ import org.gradle.api.JavaVersion

open class JavaLibraryExtension {
var mainJavaVersion: JavaVersion = JavaVersion.VERSION_1_8
var testJavaVersion: JavaVersion = JavaVersion.VERSION_17
var testJavaVersion: JavaVersion = JavaVersion.VERSION_21
var configureRelease: Boolean = true
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
}

project.pluginManager.withPlugin("java") {
val defaultLanguageVersion = JavaLanguageVersion.of(17)
val defaultLanguageVersion = JavaLanguageVersion.of(21)
val javaLanguageVersion = buildParameters.javaToolchainVersion.map { JavaLanguageVersion.of(it) }.getOrElse(defaultLanguageVersion)

val extension = the<JavaPluginExtension>()
Expand Down
2 changes: 1 addition & 1 deletion gradle/plugins/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
val expectedJavaVersion = JavaVersion.VERSION_17
val expectedJavaVersion = JavaVersion.VERSION_21
val actualJavaVersion = JavaVersion.current()
require(actualJavaVersion == expectedJavaVersion) {
"The JUnit 5 build must be executed with Java ${expectedJavaVersion.majorVersion}. Currently executing with Java ${actualJavaVersion.majorVersion}."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ void convertsStringToCurrency() {
}

@Test
@SuppressWarnings("deprecation")
void convertsStringToLocale() {
assertConverts("en", Locale.class, Locale.ENGLISH);
assertConverts("en_us", Locale.class, new Locale(Locale.US.toString()));
Expand Down

0 comments on commit 8930313

Please sign in to comment.