Make the PUSHER_APP_ID configurable at build time.

This commit is contained in:
Benoit Marty
2026-08-19 14:20:31 +02:00
parent 7341feeed8
commit 7adbd3941a
7 changed files with 40 additions and 26 deletions
+29
View File
@@ -1,3 +1,5 @@
import config.BuildTimeConfig
import extension.buildConfigFieldStr
import extension.setupDependencyInjection
import extension.testCommonDependencies
@@ -17,6 +19,33 @@ plugins {
android {
namespace = "io.element.android.libraries.push.impl"
buildFeatures {
buildConfig = true
}
buildTypes {
val defaultPusherAppId = "im.vector.app.android"
getByName("release") {
buildConfigFieldStr(
name = "PUSHER_APP_ID",
value = BuildTimeConfig.PUSHER_APP_ID_RELEASE ?: defaultPusherAppId,
)
}
getByName("debug") {
buildConfigFieldStr(
name = "PUSHER_APP_ID",
value = BuildTimeConfig.PUSHER_APP_ID_DEBUG ?: defaultPusherAppId,
)
}
register("nightly") {
matchingFallbacks += listOf("release")
buildConfigFieldStr(
name = "PUSHER_APP_ID",
value = BuildTimeConfig.PUSHER_APP_ID_NIGHTLY ?: defaultPusherAppId,
)
}
}
testOptions {
unitTests {
isIncludeAndroidResources = true