Use ModulesConfig for push provider modules.
This commit is contained in:
parent
f119b09644
commit
77d7bacaf6
3 changed files with 32 additions and 5 deletions
|
|
@ -250,10 +250,12 @@ dependencies {
|
||||||
implementation(projects.libraries.uiStrings)
|
implementation(projects.libraries.uiStrings)
|
||||||
anvil(projects.anvilcodegen)
|
anvil(projects.anvilcodegen)
|
||||||
|
|
||||||
// Comment to not include firebase in the project
|
if (ModulesConfig.pushProvidersConfig.includeFirebase) {
|
||||||
"gplayImplementation"(projects.libraries.pushproviders.firebase)
|
"gplayImplementation"(projects.libraries.pushproviders.firebase)
|
||||||
// Comment to not include unified push in the project
|
}
|
||||||
implementation(projects.libraries.pushproviders.unifiedpush)
|
if (ModulesConfig.pushProvidersConfig.includeFirebase) {
|
||||||
|
implementation(projects.libraries.pushproviders.unifiedpush)
|
||||||
|
}
|
||||||
|
|
||||||
implementation(libs.appyx.core)
|
implementation(libs.appyx.core)
|
||||||
implementation(libs.androidx.splash)
|
implementation(libs.androidx.splash)
|
||||||
|
|
|
||||||
|
|
@ -6,10 +6,16 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import config.AnalyticsConfig
|
import config.AnalyticsConfig
|
||||||
|
import config.PushProvidersConfig
|
||||||
|
|
||||||
object ModulesConfig {
|
object ModulesConfig {
|
||||||
|
val pushProvidersConfig = PushProvidersConfig(
|
||||||
|
includeFirebase = true,
|
||||||
|
includeUnifiedPush = true,
|
||||||
|
)
|
||||||
|
|
||||||
val analyticsConfig: AnalyticsConfig = AnalyticsConfig.Enabled(
|
val analyticsConfig: AnalyticsConfig = AnalyticsConfig.Enabled(
|
||||||
withPosthog = true,
|
withPosthog = true,
|
||||||
withSentry = true
|
withSentry = true,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
19
plugins/src/main/kotlin/config/PushProvidersConfig.kt
Normal file
19
plugins/src/main/kotlin/config/PushProvidersConfig.kt
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2024 New Vector Ltd.
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
* Please see LICENSE in the repository root for full details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package config
|
||||||
|
|
||||||
|
data class PushProvidersConfig(
|
||||||
|
val includeFirebase: Boolean,
|
||||||
|
val includeUnifiedPush: Boolean,
|
||||||
|
) {
|
||||||
|
init {
|
||||||
|
require(includeFirebase || includeUnifiedPush) {
|
||||||
|
"At least one push provider must be included"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue