From 4a64e3a60a96b52dec4da1cee08da9c58546a83e Mon Sep 17 00:00:00 2001 From: Abel Salgado Romero Date: Wed, 22 Mar 2023 12:12:36 +0100 Subject: [PATCH] Enable Java 19 for Windows in CI --- .github/workflows/continuous-integration.yaml | 3 ++- build.gradle | 13 ++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/continuous-integration.yaml b/.github/workflows/continuous-integration.yaml index 34634b4ee..c0dac1bb8 100644 --- a/.github/workflows/continuous-integration.yaml +++ b/.github/workflows/continuous-integration.yaml @@ -43,11 +43,12 @@ jobs: runs-on: windows-latest strategy: fail-fast: false - max-parallel: 2 + max-parallel: 3 matrix: java: - '11' - '17' + - '19' steps: - uses: actions/checkout@v3 with: diff --git a/build.gradle b/build.gradle index a847f294a..b3e91e23b 100644 --- a/build.gradle +++ b/build.gradle @@ -199,8 +199,19 @@ configure(subprojects.findAll { !it.name.endsWith('-distribution') && ! it.name. withJavadocJar() withSourcesJar() toolchain { - languageVersion.set(JavaLanguageVersion.of(11)) + languageVersion.set(JavaLanguageVersion.of(getToolchainVersion())) } } } + +// Windows workaround to fix invalid toolchain detection +def getToolchainVersion() { + if (OperatingSystem.isWindows()) { + if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_19)) + return 19 + if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_17)) + return 17 + } + return 11 +}