Aggiunge il flavor Android collaudo installabile accanto all'app di produzione.

Usa un applicationId distinto, icona con fascia gialla e API su collaudo.matchlivetv.it.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-13 20:19:20 +02:00
co-authored by Cursor
parent 061b7fad8b
commit 9225318e1a
17 changed files with 103 additions and 14 deletions
+26 -8
View File
@@ -30,6 +30,7 @@ android {
val apiBaseUrl = project.findProperty("API_BASE_URL") as String?
?: "https://www.matchlivetv.it"
buildConfigField("String", "API_BASE_URL", "\"$apiBaseUrl\"")
buildConfigField("boolean", "IS_COLLAUDO", "false")
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
// Anche in defaultConfig: AGP estrae simboli se le .so non sono già stripped.
@@ -38,6 +39,23 @@ android {
}
}
flavorDimensions += "env"
productFlavors {
create("prod") {
dimension = "env"
isDefault = true
}
create("collaudo") {
dimension = "env"
applicationId = "com.matchlivetv.match_live_tv.collaudo"
versionNameSuffix = "-collaudo"
val collaudoApi = project.findProperty("API_BASE_URL") as String?
?: "https://collaudo.matchlivetv.it"
buildConfigField("String", "API_BASE_URL", "\"$collaudoApi\"")
buildConfigField("boolean", "IS_COLLAUDO", "true")
}
}
signingConfigs {
if (keystorePropertiesFile.exists()) {
create("release") {
@@ -138,31 +156,31 @@ fun findLlvmObjcopy(): File {
val injectNativeDebugSymbolsInReleaseBundle by tasks.registering {
description = "Embed native-debug-symbols.zip (.so.sym) into the release AAB intermediary"
val mergeNative = tasks.named("mergeReleaseNativeLibs")
val packageBundle = tasks.named("packageReleaseBundle")
val mergeNative = tasks.named("mergeProdReleaseNativeLibs")
val packageBundle = tasks.named("packageProdReleaseBundle")
dependsOn(mergeNative, packageBundle)
inputs.dir(
layout.buildDirectory.dir(
"intermediates/merged_native_libs/release/mergeReleaseNativeLibs/out/lib",
"intermediates/merged_native_libs/prodRelease/mergeProdReleaseNativeLibs/out/lib",
),
)
inputs.file(
layout.buildDirectory.file(
"intermediates/intermediary_bundle/release/packageReleaseBundle/intermediary-bundle.aab",
"intermediates/intermediary_bundle/prodRelease/packageProdReleaseBundle/intermediary-bundle.aab",
),
)
outputs.file(
layout.buildDirectory.file(
"intermediates/intermediary_bundle/release/packageReleaseBundle/intermediary-bundle.aab",
"intermediates/intermediary_bundle/prodRelease/packageProdReleaseBundle/intermediary-bundle.aab",
),
)
doLast {
val libsDir = layout.buildDirectory
.dir("intermediates/merged_native_libs/release/mergeReleaseNativeLibs/out/lib")
.dir("intermediates/merged_native_libs/prodRelease/mergeProdReleaseNativeLibs/out/lib")
.get()
.asFile
val aabFile = layout.buildDirectory
.file("intermediates/intermediary_bundle/release/packageReleaseBundle/intermediary-bundle.aab")
.file("intermediates/intermediary_bundle/prodRelease/packageProdReleaseBundle/intermediary-bundle.aab")
.get()
.asFile
require(libsDir.isDirectory) { "Native libs missing: $libsDir" }
@@ -234,6 +252,6 @@ val injectNativeDebugSymbolsInReleaseBundle by tasks.registering {
}
}
tasks.matching { it.name == "signReleaseBundle" }.configureEach {
tasks.matching { it.name == "signProdReleaseBundle" }.configureEach {
dependsOn(injectNativeDebugSymbolsInReleaseBundle)
}