summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorSayantan Roychowdhury <sayantan.rc@e.email>2023-05-05 23:09:58 +0000
committerSayantan Roychowdhury <sayantan.rc@e.email>2023-05-05 23:09:58 +0000
commita348c8196a643e4f5853587133b05e3ec2cd0faa (patch)
tree733e1c001bc4cfafdf63eec495510b6ffde87071 /app
parent77914b27cf83fb8f6140542ae1d41728aa531603 (diff)
parentc69292e17f9b911b90edb342b618b9bc71428d3d (diff)
Merge branch '1234-fix-sentry-crash' into 'main'
1234 fix sentry crash See merge request e/os/advanced-privacy!130
Diffstat (limited to 'app')
-rw-r--r--app/build.gradle17
1 files changed, 16 insertions, 1 deletions
diff --git a/app/build.gradle b/app/build.gradle
index 5f3009a..e6d0c2a 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -21,6 +21,21 @@ plugins {
id 'kotlin-kapt'
}
+def getSentryDsn = { ->
+
+ def sentryDsnEnv = System.getenv("SENTRY_DSN")
+ if (sentryDsnEnv != null) {
+ return sentryDsnEnv
+ }
+
+ Properties properties = new Properties()
+ def propertiesFile = project.rootProject.file('local.properties')
+ if (propertiesFile.exists()) {
+ properties.load(propertiesFile.newDataInputStream())
+ }
+ return properties.getProperty('SENTRY_DSN')
+}
+
android {
compileSdkVersion buildConfig.compileSdk
@@ -39,7 +54,7 @@ android {
]
resValue("string", "mapbox_key", MAPBOX_KEY)
- buildConfigField("String", "SENTRY_DSN", "\"$SENTRY_DSN\"")
+ buildConfigField("String", "SENTRY_DSN", "\"${getSentryDsn()}\"")
}
signingConfigs {