mirror of
https://github.com/mihonapp/mihon.git
synced 2026-10-16 13:48:09 -07:00
Only upload Crashlytics mapping file when building for release
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import com.android.build.api.variant.ApplicationVariant
|
||||
import com.android.build.api.variant.BuildConfigField
|
||||
import com.google.firebase.crashlytics.buildtools.gradle.CrashlyticsExtension
|
||||
import mihon.gradle.Config
|
||||
import mihon.gradle.getCurrentTime
|
||||
import mihon.gradle.getLatestCommitCount
|
||||
@@ -106,6 +107,14 @@ android {
|
||||
|
||||
matchingFallbacks.addAll(commonMatchingFallbacks)
|
||||
}
|
||||
|
||||
if (Config.includeTelemetry) {
|
||||
configureEach {
|
||||
configure<CrashlyticsExtension> {
|
||||
mappingFileUploadEnabled = Config.uploadCrashlyticsMapping
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
|
||||
@@ -4,6 +4,7 @@ import org.gradle.api.Project
|
||||
|
||||
interface BuildConfig {
|
||||
val includeTelemetry: Boolean
|
||||
val uploadCrashlyticsMapping: Boolean
|
||||
val enableUpdater: Boolean
|
||||
val includeDependencyInfo: Boolean
|
||||
}
|
||||
@@ -26,6 +27,8 @@ val Project.Config: BuildConfig get() = object : BuildConfig {
|
||||
override val includeTelemetry: Boolean = project.flag("include-telemetry")
|
||||
?: (distribution == Distribution.CI || distribution == Distribution.GITHUB)
|
||||
|
||||
override val uploadCrashlyticsMapping: Boolean = includeTelemetry && (distribution == Distribution.GITHUB)
|
||||
|
||||
override val enableUpdater: Boolean = project.flag("enable-updater")
|
||||
?: (distribution != Distribution.LOCAL)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user