diff --git a/build.gradle b/build.gradle index a787c74bf4..61ce33bc30 100644 --- a/build.gradle +++ b/build.gradle @@ -144,12 +144,10 @@ ext.rustTargets += ext.nativeRustTarget subprojects { apply plugin: 'maven-publish' - // Kotlin settings applicable to all modules. afterEvaluate { 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