2026-06-10 13:29:04 +05:30
|
|
|
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)
|
2026-06-10 14:47:50 +05:30
|
|
|
|
|
|
|
|
afterEvaluate {
|
|
|
|
|
if (extensions.findByName("android") != null) {
|
|
|
|
|
val android = extensions.findByName("android") as com.android.build.gradle.BaseExtension
|
|
|
|
|
if (android.namespace == null) {
|
|
|
|
|
var manifestPackage: String? = null
|
|
|
|
|
val manifestFile = project.projectDir.resolve("src/main/AndroidManifest.xml")
|
|
|
|
|
if (manifestFile.exists()) {
|
|
|
|
|
val content = manifestFile.readText()
|
|
|
|
|
val match = Regex("package=\"([^\"]+)\"").find(content)
|
|
|
|
|
if (match != null) {
|
|
|
|
|
manifestPackage = match.groupValues[1]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (manifestPackage != null) {
|
|
|
|
|
android.namespace = manifestPackage
|
|
|
|
|
} else {
|
|
|
|
|
android.namespace = "co.gittouch." + project.name.replace("-", "_")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-06-10 13:29:04 +05:30
|
|
|
}
|
|
|
|
|
subprojects {
|
|
|
|
|
project.evaluationDependsOn(":app")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tasks.register<Delete>("clean") {
|
|
|
|
|
delete(rootProject.layout.buildDirectory)
|
|
|
|
|
}
|