44 lines
1.0 KiB
Plaintext
44 lines
1.0 KiB
Plaintext
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")
|
|
}
|
|
|
|
tasks.register<Delete>("clean") {
|
|
delete(rootProject.layout.buildDirectory)
|
|
}
|
|
|
|
subprojects {
|
|
fun applyNamespace() {
|
|
if (project.hasProperty("android")) {
|
|
val extension = project.extensions.findByName("android")
|
|
if (extension is com.android.build.gradle.BaseExtension) {
|
|
if (extension.namespace == null) {
|
|
extension.namespace = project.group.toString()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
if (project.state.executed) {
|
|
applyNamespace()
|
|
} else {
|
|
afterEvaluate { applyNamespace() }
|
|
}
|
|
}
|