Move firebase stuff to a standalone module (#1841)

This commit is contained in:
AntsyLich
2025-03-11 12:55:50 +06:00
committed by GitHub
parent eddf07f9ac
commit 046f09c4bd
10 changed files with 101 additions and 65 deletions

View File

@@ -1,3 +1,4 @@
import mihon.buildlogic.Config
import mihon.buildlogic.getBuildTime
import mihon.buildlogic.getCommitCount
import mihon.buildlogic.getGitSha
@@ -10,16 +11,6 @@ plugins {
alias(libs.plugins.aboutLibraries)
}
class ConfigClass {
val includeAnalytics: Boolean = project.hasProperty("include-analytics")
val enableUpdater: Boolean = project.hasProperty("enable-updater")
val enableCodeShrink: Boolean = !project.hasProperty("disable-code-shrink")
val includeDependencyInfo: Boolean = project.hasProperty("include-dependency-info")
}
@Suppress("PropertyName")
val Config = ConfigClass()
if (Config.includeAnalytics) {
pluginManager.apply {
apply(libs.plugins.google.services.get().pluginId)
@@ -94,8 +85,6 @@ android {
}
sourceSets {
val analyticsDir = if (Config.includeAnalytics) "analytics-firebase" else "analytics-firebase-noop"
getByName("main").kotlin.srcDirs("src/$analyticsDir/kotlin")
getByName("preview").res.srcDirs("src/debug/res")
getByName("benchmark").res.srcDirs("src/debug/res")
}
@@ -187,6 +176,7 @@ dependencies {
implementation(projects.domain)
implementation(projects.presentationCore)
implementation(projects.presentationWidget)
implementation(projects.telemetry)
// Compose
implementation(compose.activity)
@@ -280,13 +270,6 @@ dependencies {
// Logging
implementation(libs.logcat)
// Crash reports/analytics
if (Config.includeAnalytics) {
implementation(platform(libs.firebase.bom))
implementation(libs.firebase.analytics)
implementation(libs.firebase.crashlytics)
}
// Shizuku
implementation(libs.bundles.shizuku)