From b56164f545da9fd75bf1cb1ef445674786cb39de Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Fri, 13 Dec 2024 03:13:38 +0100 Subject: [PATCH] Add 'java.skipToolchainSpecification' option --- .forgejo/workflows/commit.yml | 4 ++-- build.gradle.kts | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.forgejo/workflows/commit.yml b/.forgejo/workflows/commit.yml index b1470b2..c5f660d 100644 --- a/.forgejo/workflows/commit.yml +++ b/.forgejo/workflows/commit.yml @@ -22,7 +22,7 @@ jobs: restore-keys: | gradle-${{ runner.os }}- - name: Compile - run: ./gradlew --no-daemon jar + run: ./gradlew --no-daemon -Pjava.skipToolchainSpecification=true jar - name: Save Gradle cache uses: actions/cache/save@v4 with: @@ -56,7 +56,7 @@ jobs: restore-keys: | gradle-${{ runner.os }}- - name: Compile - run: ./gradlew --no-daemon dokkaHtml dokkaHtmlMultiModule dokkaHtmlJar dokkaJavadocJar + run: ./gradlew --no-daemon -Pjava.skipToolchainSpecification=true dokkaHtml dokkaHtmlMultiModule dokkaHtmlJar dokkaJavadocJar - name: Save Gradle cache uses: actions/cache/save@v4 with: diff --git a/build.gradle.kts b/build.gradle.kts index ddb8f8f..22100b9 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -90,9 +90,10 @@ allprojects { sourceCompatibility = JavaVersion.valueOf("VERSION_${property("java") as String}") targetCompatibility = JavaVersion.valueOf("VERSION_${property("java") as String}") - toolchain { - languageVersion = JavaLanguageVersion.of(property("java") as String) - } + if (!(hasProperty("java.skipToolchainSpecification") && property("java.skipToolchainSpecification") as String == "true")) + toolchain { + languageVersion = JavaLanguageVersion.of(property("java") as String) + } } // Kotlin