From 3ba15e561ce6f0ed4d0069db22ce8e8c2a5b9ef1 Mon Sep 17 00:00:00 2001 From: Daniel Frett Date: Mon, 2 Dec 2024 11:21:36 -0700 Subject: [PATCH] Bump Java to 21 --- .java-version | 2 +- build-logic/build.gradle.kts | 2 +- build-logic/src/main/kotlin/AndroidConfiguration.kt | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.java-version b/.java-version index 414a3cb7ec..0c4e17bc16 100644 --- a/.java-version +++ b/.java-version @@ -1 +1 @@ -temurin-17.0.7+7 +temurin-21.0.4+7.0.LTS diff --git a/build-logic/build.gradle.kts b/build-logic/build.gradle.kts index acdd273de5..707a8437df 100644 --- a/build-logic/build.gradle.kts +++ b/build-logic/build.gradle.kts @@ -4,7 +4,7 @@ plugins { } kotlin.jvmToolchain { - languageVersion.set(JavaLanguageVersion.of(17)) + languageVersion.set(JavaLanguageVersion.of(21)) } dependencies { diff --git a/build-logic/src/main/kotlin/AndroidConfiguration.kt b/build-logic/src/main/kotlin/AndroidConfiguration.kt index bf5b59583a..94a59d0c56 100644 --- a/build-logic/src/main/kotlin/AndroidConfiguration.kt +++ b/build-logic/src/main/kotlin/AndroidConfiguration.kt @@ -67,14 +67,14 @@ private fun BaseExtension.configureSdk() { private fun BaseExtension.configureCompilerOptions(project: Project) { project.extensions.findByType()?.apply { - jvmToolchain(17) + jvmToolchain(21) } compileOptions { // HACK: workaround a kotlin.jvmToolchain bug // see: https://issuetracker.google.com/issues/260059413 - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 } (this as ExtensionAware).extensions.findByType()?.apply { freeCompilerArgs += "-Xjvm-default=all"