diff options
author | Harsh Shandilya <me@msfjarvis.dev> | 2022-03-13 17:41:01 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-13 12:11:01 +0000 |
commit | 861ca58a58675e5f063072b7f31e8cefeaaeaed5 (patch) | |
tree | 1f886ec49d4742be01747d8590aa7d3edd4a7499 /build-logic/android-plugins/src/main/kotlin | |
parent | 20725219bdc482480ad7130cd2b3829ae24384a8 (diff) |
Configure Sentry with more information (#1782)
* build-logic: remove error path in Sentry plugin
* gradle: fix UnstableApiUsage warning
* build-logic: configure Sentry Gradle Plugin
* app: set traces sample-rate to 1.0
* sentry-stub: init
* app: populate Sentry user field with feature flags
Diffstat (limited to 'build-logic/android-plugins/src/main/kotlin')
-rw-r--r-- | build-logic/android-plugins/src/main/kotlin/com.github.android-password-store.sentry.gradle.kts | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/build-logic/android-plugins/src/main/kotlin/com.github.android-password-store.sentry.gradle.kts b/build-logic/android-plugins/src/main/kotlin/com.github.android-password-store.sentry.gradle.kts index 4c22e8c8..0407d808 100644 --- a/build-logic/android-plugins/src/main/kotlin/com.github.android-password-store.sentry.gradle.kts +++ b/build-logic/android-plugins/src/main/kotlin/com.github.android-password-store.sentry.gradle.kts @@ -2,11 +2,14 @@ import flavors.FlavorDimensions import flavors.ProductFlavors +import io.sentry.android.gradle.InstrumentationFeature -plugins { id("com.android.application") } +plugins { + id("com.android.application") + id("io.sentry.android.gradle") +} val SENTRY_DSN_PROPERTY = "SENTRY_DSN" -val INVOKED_FROM_IDE_PROPERTY = "android.injected.invoked.from.ide" android { androidComponents { @@ -14,12 +17,17 @@ android { val sentryDsn = project.providers.environmentVariable(SENTRY_DSN_PROPERTY) if (sentryDsn.isPresent) { variant.manifestPlaceholders.put("sentryDsn", sentryDsn.get()) - } else if (project.providers.gradleProperty(INVOKED_FROM_IDE_PROPERTY).orNull != "true") { - // Checking for 'INVOKED_FROM_IDE_PROPERTY' prevents failures during Gradle sync by the IDE - throw GradleException( - "The '${SENTRY_DSN_PROPERTY}' environment variable must be set when building the ${ProductFlavors.NON_FREE} flavor" - ) } } } } + +sentry { + autoUploadProguardMapping.set(true) + ignoredBuildTypes.set(setOf("debug")) + ignoredFlavors.set(setOf(ProductFlavors.FREE)) + tracingInstrumentation { + enabled.set(true) + features.set(setOf(InstrumentationFeature.FILE_IO)) + } +} |