From 3a7ab8ff3a625e5d23233dcac32a407c2418c236 Mon Sep 17 00:00:00 2001 From: Guillaume Jacquart Date: Thu, 29 Dec 2022 08:40:39 +0100 Subject: [PATCH 1/2] 855: setup Sentry telemetry. --- .gitlab-ci.yml | 1 + README.md | 4 +++- app/build.gradle | 5 ++++- app/src/main/AndroidManifest.xml | 7 ++++++- .../PrivacyCentralApplication.kt | 21 ++++++++++++++++++- dependencies.gradle | 2 ++ load-properties.gradle | 1 + 7 files changed, 37 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 17512518..1cddc6ac 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,6 +10,7 @@ stages: variables: MAPBOX_KEY: $MAPBOX_KEY_DEV MAPBOX_SECRET_KEY: $MAPBOX_SECRET_KEY_DEV + SENTRY_DSN: $SENTRY_DSN workflow: rules: diff --git a/README.md b/README.md index 5cc125df..17d2c629 100644 --- a/README.md +++ b/README.md @@ -42,13 +42,14 @@ You can use any latest stable version of android studio to be able to build this - Target SDK: 30 (Android R) ## API Keys -This project uses [Mapbox](https://docs.mapbox.com/android/maps/guides/install/) sdk for displaying maps. To download and use the mapbox sdk, you need to supply API key and secret and set them as follows: +This project uses [Sentry](https://sentry.io) for telemetry and crash reports, [Mapbox](https://docs.mapbox.com/android/maps/guides/install/) sdk for displaying maps. To download and use the mapbox sdk, you need to supply API key and secret and set them as follows: ### For local build You can set them in local.properties ``` MAPBOX_KEY= MAPBOX_SECRET_KEY= +SENTRY_DSN= ``` **IMP: Never add this file to version control.** @@ -57,6 +58,7 @@ When building in CI environment, we don't have local.properties file. So the fol ``` export MAPBOX_KEY= export MAPBOX_SECRET_KEY= +export SENTRY_DSN= ``` ## Code Style and Quality diff --git a/app/build.gradle b/app/build.gradle index 12d11590..bb2f6ac7 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -39,6 +39,7 @@ android { ] resValue("string", "mapbox_key", MAPBOX_KEY) + buildConfigField("String", "SENTRY_DSN", "\"$SENTRY_DSN\"") } signingConfigs { @@ -150,7 +151,9 @@ dependencies { Libs.Retrofit.scalars, Libs.MapBox.sdk, - Libs.mpAndroidCharts + Libs.mpAndroidCharts, + + Libs.sentry ) debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.9.1' diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 3bcd7640..d787f50c 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,6 +1,6 @@