buildscript { repositories { mavenCentral() google() maven { url = uri("https://developer.huawei.com/repo/") } maven { url = uri("https://api.mapbox.com/downloads/v2/releases/maven") credentials { username = "mapbox" password = "sk.eyJ1IjoicndhaWQiLCJhIjoiY2x6NWo0bTMzMWZodzJrcGZpemYzc3Z4dSJ9.uSSZuwNSGCcCdPAiORECmg" if (password.isNullOrEmpty()) { throw GradleException("MAPBOX_DOWNLOADS_TOKEN isn't set. Set it to the project properties or to the environment variables.") } } authentication { create("basic") } } } dependencies { classpath("com.android.tools.build:gradle:8.1.0") classpath("com.huawei.agconnect:agcp:1.9.1.304") } } allprojects { repositories { google() mavenCentral() maven { url = uri("https://developer.huawei.com/repo/") } maven { url = uri("https://artifactory.ess-dev.com/artifactory/gradle-dev-local") } maven { url = uri("https://api.mapbox.com/downloads/v2/releases/maven") credentials { username = "mapbox" password = "sk.eyJ1IjoicndhaWQiLCJhIjoiY2x6NWo0bTMzMWZodzJrcGZpemYzc3Z4dSJ9.uSSZuwNSGCcCdPAiORECmg" if (password.isNullOrEmpty()) { throw GradleException("MAPBOX_DOWNLOADS_TOKEN isn't set. Set it to the project properties or to the environment variables.") } } authentication { create("basic") } } } configurations.all { exclude(group = "org.bouncycastle", module = "bcprov-jdk16") } tasks.withType().configureEach { sourceCompatibility = JavaVersion.VERSION_21.toString() targetCompatibility = JavaVersion.VERSION_21.toString() } tasks.withType().configureEach { // kotlinOptions { // jvmTarget = "21" // } compilerOptions { jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_21) } } subprojects { project.buildscript.repositories { google() mavenCentral() } project.repositories { google() mavenCentral() } afterEvaluate { if (project.hasProperty("android")) { project.extensions.findByName("android")?.let { androidExt -> val android = androidExt as com.android.build.gradle.BaseExtension if (android.namespace == null) { android.namespace = project.group.toString() } android.buildFeatures.apply { if (buildConfig == null) { buildConfig = true } } android.compileOptions.apply { sourceCompatibility = JavaVersion.VERSION_21 targetCompatibility = JavaVersion.VERSION_21 } if (project.name == "myfatoorah_flutter") { android.defaultConfig.consumerProguardFiles.clear() android.buildTypes.all { consumerProguardFiles.clear() } } } } project.tasks.matching { it.name.contains("ConsumerProguardFiles") }.configureEach { doLast { outputs.files.forEach { dirOrFile -> dirOrFile.walkTopDown() .filter { it.isFile && (it.name.endsWith(".txt") || it.name.endsWith(".pro")) } .forEach { proFile -> val content = proFile.readText() val sanitized = content .replace(Regex("""(?m)^\s*-keep\s+class\s+\*\s*\{.*$"""), "# stripped -keep class *") .replace(Regex("""(?m)^\s*-keep\s+class\s+androidx\.\*\*\s*\{.*$"""), "# stripped -keep class androidx.**") .replace(Regex("""(?m)^\s*-keep\s+class\s+android\.\*\*\s*\{.*$"""), "# stripped -keep class android.**") .replace(Regex("""(?m)^\s*-keep\s+class\s+com\.google\.\*\*\s*\{.*$"""), "# stripped -keep class com.google.**") if (sanitized != content) { proFile.writeText(sanitized) } } } } } project.tasks.withType().configureEach { sourceCompatibility = JavaVersion.VERSION_21.toString() targetCompatibility = JavaVersion.VERSION_21.toString() } project.tasks.withType().configureEach { // kotlinOptions { // jvmTarget = "21" // } compilerOptions { jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_21) } } } } } rootProject.buildDir = File("../build") subprojects { project.buildDir = File("${rootProject.buildDir}/${project.name}") } subprojects { project.evaluationDependsOn(":app") } tasks.register("clean") { delete(rootProject.layout.buildDirectory) }