2026-09-12 11:22:07 +05:30
|
|
|
buildscript {
|
2026-09-14 10:23:00 +00:00
|
|
|
ext.kotlin_version = '1.9.22'
|
2026-09-12 11:22:07 +05:30
|
|
|
repositories {
|
|
|
|
|
google()
|
|
|
|
|
mavenCentral()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
allprojects {
|
|
|
|
|
repositories {
|
|
|
|
|
google()
|
|
|
|
|
mavenCentral()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
rootProject.buildDir = '../build'
|
|
|
|
|
subprojects {
|
|
|
|
|
project.buildDir = "${rootProject.buildDir}/${project.name}"
|
|
|
|
|
}
|
|
|
|
|
subprojects {
|
|
|
|
|
project.evaluationDependsOn(':app')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tasks.register("clean", Delete) {
|
|
|
|
|
delete rootProject.buildDir
|
|
|
|
|
}
|
2026-09-14 12:23:04 +00:00
|
|
|
subprojects { proj ->
|
|
|
|
|
def fixNamespace = {
|
|
|
|
|
if (proj.hasProperty('android')) {
|
|
|
|
|
def androidExt = proj.extensions.findByName('android')
|
2026-09-14 11:54:58 +00:00
|
|
|
if (androidExt != null && androidExt.hasProperty('namespace') && (androidExt.namespace == null || androidExt.namespace == '')) {
|
2026-09-14 12:23:04 +00:00
|
|
|
def manifestFile = proj.file('src/main/AndroidManifest.xml')
|
2026-09-14 11:54:58 +00:00
|
|
|
if (manifestFile.exists()) {
|
|
|
|
|
def manifestText = manifestFile.text
|
|
|
|
|
def matcher = manifestText =~ /package="([^"]+)"/
|
|
|
|
|
if (matcher.find()) {
|
|
|
|
|
androidExt.namespace = matcher.group(1)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-09-14 12:23:04 +00:00
|
|
|
if (proj.state.executed) {
|
|
|
|
|
fixNamespace()
|
|
|
|
|
} else {
|
|
|
|
|
proj.afterEvaluate { fixNamespace() }
|
|
|
|
|
}
|
2026-09-14 11:54:58 +00:00
|
|
|
}
|