allprojects { repositories { google() mavenCentral() maven { setUrl("https://jitpack.io") } maven { setUrl("https://developer.huawei.com/repo/") } maven { setUrl("https://developer.hihonor.com/repo") } maven { setUrl("https://maven.aliyun.com/repository/central") } maven { setUrl("https://maven.aliyun.com/repository/jcenter") } maven { setUrl("https://maven.aliyun.com/repository/public") } maven { setUrl("https://maven.aliyun.com/repository/google") } } } 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) } // 百度地图等第三方插件仍固定较低的 compileSdk,与其自身依赖的 AAR 元数据要求冲突, // 统一提升到应用的 compileSdk 版本。 subprojects { afterEvaluate { (extensions.findByName("android") as? com.android.build.api.dsl.CommonExtension)?.compileSdk = 37 } } subprojects { project.evaluationDependsOn(":app") } tasks.register("clean") { delete(rootProject.layout.buildDirectory) }