Use ModulesConfig for push provider modules.
This commit is contained in:
parent
d57e3b7ec9
commit
1a979cd142
3 changed files with 32 additions and 5 deletions
|
|
@ -250,10 +250,12 @@ dependencies {
|
|||
implementation(projects.libraries.uiStrings)
|
||||
anvil(projects.anvilcodegen)
|
||||
|
||||
// Comment to not include firebase in the project
|
||||
"gplayImplementation"(projects.libraries.pushproviders.firebase)
|
||||
// Comment to not include unified push in the project
|
||||
implementation(projects.libraries.pushproviders.unifiedpush)
|
||||
if (ModulesConfig.pushProvidersConfig.includeFirebase) {
|
||||
"gplayImplementation"(projects.libraries.pushproviders.firebase)
|
||||
}
|
||||
if (ModulesConfig.pushProvidersConfig.includeFirebase) {
|
||||
implementation(projects.libraries.pushproviders.unifiedpush)
|
||||
}
|
||||
|
||||
implementation(libs.appyx.core)
|
||||
implementation(libs.androidx.splash)
|
||||
|
|
|
|||
|
|
@ -6,10 +6,16 @@
|
|||
*/
|
||||
|
||||
import config.AnalyticsConfig
|
||||
import config.PushProvidersConfig
|
||||
|
||||
object ModulesConfig {
|
||||
val pushProvidersConfig = PushProvidersConfig(
|
||||
includeFirebase = true,
|
||||
includeUnifiedPush = true,
|
||||
)
|
||||
|
||||
val analyticsConfig: AnalyticsConfig = AnalyticsConfig.Enabled(
|
||||
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