diff --git a/android/build.gradle.kts b/android/build.gradle.kts index dbee657..b95b87c 100644 --- a/android/build.gradle.kts +++ b/android/build.gradle.kts @@ -5,6 +5,15 @@ allprojects { } } +fun Project.configureAndroidJvmCompatibility() { + extensions.configure("android") { + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + } +} + val newBuildDir: Directory = rootProject.layout.buildDirectory .dir("../../build") @@ -14,6 +23,18 @@ rootProject.layout.buildDirectory.value(newBuildDir) subprojects { val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name) project.layout.buildDirectory.value(newSubprojectBuildDir) + + afterEvaluate { + if (plugins.hasPlugin("com.android.application") || plugins.hasPlugin("com.android.library")) { + configureAndroidJvmCompatibility() + } + } + + tasks.withType().configureEach { + compilerOptions { + jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17) + } + } } subprojects { project.evaluationDependsOn(":app")