diff --git a/build.gradle b/build.gradle index 148269db97..478fac2c83 100644 --- a/build.gradle +++ b/build.gradle @@ -11,7 +11,7 @@ buildscript { // changing them. Please note that, for using in Android-Components, the // versions below must match the ones in that repository. ext.versions = [ - android_gradle_plugin: '8.0.2', + android_gradle_plugin: '8.3.0-beta01', coroutines: '1.7.2', jna: '5.14.0', junit: '4.13.2', @@ -144,22 +144,10 @@ ext.rustTargets += ext.nativeRustTarget subprojects { apply plugin: 'maven-publish' - // Kotlin settings applicable to all modules. afterEvaluate { - if (it.hasProperty('android')) { - android { - // This shouldn't be needed anymore with AGP 8.1.0+ - // https://kotlinlang.org/docs/gradle-configure-project.html#gradle-java-toolchains-support - compileOptions { - sourceCompatibility rootProject.ext.build.jvmTargetCompatibility - targetCompatibility rootProject.ext.build.jvmTargetCompatibility - } - } - } tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { kotlinOptions.allWarningsAsErrors = true - kotlin.jvmToolchain(rootProject.ext.build.jvmTargetCompatibility) } } diff --git a/glean-core/android-native/build.gradle b/glean-core/android-native/build.gradle index fe95a840da..8a4ada67e1 100644 --- a/glean-core/android-native/build.gradle +++ b/glean-core/android-native/build.gradle @@ -8,8 +8,13 @@ import groovy.json.JsonOutput apply plugin: 'com.android.library' +apply plugin: 'kotlin-android' apply plugin: 'org.mozilla.rust-android-gradle.rust-android' +kotlin { + jvmToolchain(rootProject.ext.build.jvmTargetCompatibility) +} + android { namespace "mozilla.telemetry.glean_native" diff --git a/glean-core/android/build.gradle b/glean-core/android/build.gradle index 6a513a8f1d..1099134669 100644 --- a/glean-core/android/build.gradle +++ b/glean-core/android/build.gradle @@ -27,6 +27,10 @@ File GLEAN_PING_SCHEMA_PATH = file("$rootDir/glean.1.schema.json") ext.allowGleanInternal = true ext.gleanNamespace = "mozilla.telemetry.glean" +kotlin { + jvmToolchain(rootProject.ext.build.jvmTargetCompatibility) +} + android { compileSdkVersion rootProject.ext.build.compileSdkVersion namespace "mozilla.telemetry.glean" diff --git a/samples/android/app/build.gradle b/samples/android/app/build.gradle index 5d8bae83c2..2f8a9991fb 100644 --- a/samples/android/app/build.gradle +++ b/samples/android/app/build.gradle @@ -9,6 +9,10 @@ plugins { apply plugin: 'com.android.application' apply plugin: 'kotlin-android' +kotlin { + jvmToolchain(rootProject.ext.build.jvmTargetCompatibility) +} + android { namespace "org.mozilla.samples.gleancore" compileSdkVersion rootProject.ext.build.compileSdkVersion