allprojects { repositories { google() mavenCentral() } } // 统一 JVM 版本配置 allprojects { tasks.withType { sourceCompatibility = "17" targetCompatibility = "17" } tasks.withType { kotlinOptions { jvmTarget = "17" } } } // 为 audioplayers_android 模块单独设置 Java 1.8 project(":audioplayers_android") { tasks.withType { sourceCompatibility = "1.8" targetCompatibility = "1.8" } tasks.withType { kotlinOptions { jvmTarget = "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) }