allprojects { repositories { google() mavenCentral() } } 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") } // receive_sharing_intent declares Java 11 for its Java sources but leaves // its Kotlin compilation to default to whatever JDK runs the build - with // JDK 17 that mismatch (Java 11 vs Kotlin 17) fails with "Inconsistent JVM // Target Compatibility". Pin just this plugin's Kotlin target down to match // its own declared Java target, rather than touching every subproject. project(":receive_sharing_intent") { afterEvaluate { tasks.withType().configureEach { compilerOptions { jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11) } } } } tasks.register("clean") { delete(rootProject.layout.buildDirectory) }