import org.jetbrains.kotlin.gradle.dsl.KotlinVersion import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { id("org.jetbrains.kotlin.android") version "2.2.20" apply false } allprojects { repositories { google() mavenCentral() } } // Some plugin deps (e.g. sentry_flutter) still pin an old Kotlin // languageVersion in their own android/build.gradle that the pinned // Kotlin Gradle Plugin (2.2.20) refuses to compile. Force every // subproject's Kotlin compile tasks to a supported language/API version. subprojects { afterEvaluate { tasks.withType().configureEach { compilerOptions { languageVersion.set(KotlinVersion.KOTLIN_1_8) apiVersion.set(KotlinVersion.KOTLIN_1_8) } } } } val newBuildDir: Directory = rootProject.layout.buildDirectory .dir("../../build") .get() rootProject.layout.buildDirectory.value(newBuildDir) subprojects { val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name) project.layout.buildDirectory.value(newSubprojectBuildDir) } subprojects { project.evaluationDependsOn(":app") } tasks.register("clean") { delete(rootProject.layout.buildDirectory) }