From 05e18feb74682dcec7eb93f3e04aa6a9880bad4c Mon Sep 17 00:00:00 2001 From: nicholasdoglio Date: Fri, 1 Nov 2024 19:24:22 -0400 Subject: [PATCH] Use same JDK everywhere --- app/build.gradle.kts | 2 +- build-logic/build.gradle.kts | 5 ++++- build-logic/gradle/gradle-daemon-jvm.properties | 2 ++ build.gradle.kts | 4 ++++ gradle/gradle-daemon-jvm.properties | 2 ++ gradle/libs.versions.toml | 1 + 6 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 build-logic/gradle/gradle-daemon-jvm.properties create mode 100644 gradle/gradle-daemon-jvm.properties diff --git a/app/build.gradle.kts b/app/build.gradle.kts index bca4561..974a9a8 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -41,7 +41,7 @@ licensee { allow("MIT") } -kotlin { jvmToolchain(21) } +kotlin { jvmToolchain(libs.versions.jdk.get().toInt()) } tasks.withType().configureEach { notCompatibleWithConfigurationCache("https://github.com/diffplug/spotless/issues/987") diff --git a/build-logic/build.gradle.kts b/build-logic/build.gradle.kts index 71dd83d..a84fe3a 100644 --- a/build-logic/build.gradle.kts +++ b/build-logic/build.gradle.kts @@ -30,7 +30,7 @@ plugins { `java-gradle-plugin` } -kotlin { jvmToolchain(21) } +kotlin { jvmToolchain(libs.versions.jdk.get().toInt()) } spotless { format("misc") { @@ -65,6 +65,9 @@ gradlePlugin { } } +// https://docs.gradle.org/8.9/userguide/gradle_daemon.html#daemon_jvm_criteria +tasks.updateDaemonJvm.configure { jvmVersion = JavaVersion.toVersion(libs.versions.jdk.get()) } + dependencies { implementation(libs.android.gradle) implementation(libs.detekt.gradle) diff --git a/build-logic/gradle/gradle-daemon-jvm.properties b/build-logic/gradle/gradle-daemon-jvm.properties new file mode 100644 index 0000000..63e5bbd --- /dev/null +++ b/build-logic/gradle/gradle-daemon-jvm.properties @@ -0,0 +1,2 @@ +#This file is generated by updateDaemonJvm +toolchainVersion=21 diff --git a/build.gradle.kts b/build.gradle.kts index 6ed7221..be67971 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -34,3 +34,7 @@ plugins { alias(libs.plugins.doctor) alias(libs.plugins.gradle.versions) } + + +// https://docs.gradle.org/8.9/userguide/gradle_daemon.html#daemon_jvm_criteria +tasks.updateDaemonJvm.configure { jvmVersion = JavaVersion.toVersion(libs.versions.jdk.get()) } diff --git a/gradle/gradle-daemon-jvm.properties b/gradle/gradle-daemon-jvm.properties new file mode 100644 index 0000000..63e5bbd --- /dev/null +++ b/gradle/gradle-daemon-jvm.properties @@ -0,0 +1,2 @@ +#This file is generated by updateDaemonJvm +toolchainVersion=21 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 516c2e9..c2876b4 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -19,6 +19,7 @@ sort = "0.12" inject = "0.7.2" sqldelight = "2.0.2" ktor = "3.0.1" +jdk="21" [plugins] detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" }