diff --git a/app/build.gradle.kts b/app/build.gradle.kts index d4a8945d5d..89181cf9cf 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -10,6 +10,7 @@ import com.android.build.api.variant.FilterConfiguration.FilterType.ABI import com.android.build.gradle.internal.tasks.factory.dependsOn import com.android.build.gradle.tasks.GenerateBuildConfig +import config.BuildTimeConfig import extension.AssetCopyTask import extension.ComponentMergingStrategy import extension.GitBranchNameValueSource @@ -43,11 +44,7 @@ android { namespace = "io.element.android.x" defaultConfig { - applicationId = if (isEnterpriseBuild) { - "io.element.enterprise" - } else { - "io.element.android.x" - } + applicationId = BuildTimeConfig.APPLICATION_ID targetSdk = Versions.TARGET_SDK versionCode = Versions.VERSION_CODE versionName = Versions.VERSION_NAME @@ -97,11 +94,7 @@ android { } } - val baseAppName = if (isEnterpriseBuild) { - "Element Enterprise" - } else { - "Element X" - } + val baseAppName = BuildTimeConfig.APPLICATION_NAME logger.warnInBox("Building $baseAppName") buildTypes { diff --git a/libraries/pushproviders/firebase/build.gradle.kts b/libraries/pushproviders/firebase/build.gradle.kts index 619db35282..044b930572 100644 --- a/libraries/pushproviders/firebase/build.gradle.kts +++ b/libraries/pushproviders/firebase/build.gradle.kts @@ -7,6 +7,7 @@ @file:Suppress("UnstableApiUsage") +import config.BuildTimeConfig import extension.setupAnvil plugins { @@ -22,22 +23,14 @@ android { resValue( type = "string", name = "google_app_id", - value = if (isEnterpriseBuild) { - "1:912726360885:android:d273c2077ec3291500427c" - } else { - "1:912726360885:android:d097de99a4c23d2700427c" - } + value = BuildTimeConfig.GOOGLE_APP_ID_RELEASE, ) } getByName("debug") { resValue( type = "string", name = "google_app_id", - value = if (isEnterpriseBuild) { - "1:912726360885:android:f8de9126a94143d300427c" - } else { - "1:912726360885:android:def0a4e454042e9b00427c" - } + value = BuildTimeConfig.GOOGLE_APP_ID_DEBUG, ) } register("nightly") { @@ -46,11 +39,7 @@ android { resValue( type = "string", name = "google_app_id", - value = if (isEnterpriseBuild) { - "1:912726360885:android:3f7e1fe644d99d5a00427c" - } else { - "1:912726360885:android:e17435e0beb0303000427c" - } + value = BuildTimeConfig.GOOGLE_APP_ID_NIGHTLY, ) } } diff --git a/plugins/src/main/kotlin/config/BuildTimeConfig.kt b/plugins/src/main/kotlin/config/BuildTimeConfig.kt new file mode 100644 index 0000000000..f8512ab956 --- /dev/null +++ b/plugins/src/main/kotlin/config/BuildTimeConfig.kt @@ -0,0 +1,16 @@ +/* + * Copyright 2025 New Vector Ltd. + * + * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial + * Please see LICENSE files in the repository root for full details. + */ + +package config + +object BuildTimeConfig { + const val APPLICATION_ID = "io.element.android.x" + const val APPLICATION_NAME = "Element X" + const val GOOGLE_APP_ID_RELEASE = "1:912726360885:android:d097de99a4c23d2700427c" + const val GOOGLE_APP_ID_DEBUG = "1:912726360885:android:def0a4e454042e9b00427c" + const val GOOGLE_APP_ID_NIGHTLY = "1:912726360885:android:e17435e0beb0303000427c" +}