aboutsummaryrefslogtreecommitdiff
path: root/build-logic
diff options
context:
space:
mode:
Diffstat (limited to 'build-logic')
-rw-r--r--build-logic/android-plugins/build.gradle.kts1
-rw-r--r--build-logic/android-plugins/src/main/kotlin/com.github.android-password-store.sentry.gradle.kts22
-rw-r--r--build-logic/kotlin-plugins/src/main/kotlin/com.github.android-password-store.binary-compatibility.gradle.kts1
-rw-r--r--build-logic/settings.gradle.kts1
4 files changed, 18 insertions, 7 deletions
diff --git a/build-logic/android-plugins/build.gradle.kts b/build-logic/android-plugins/build.gradle.kts
index cdc7c315..dfe77e89 100644
--- a/build-logic/android-plugins/build.gradle.kts
+++ b/build-logic/android-plugins/build.gradle.kts
@@ -35,4 +35,5 @@ dependencies {
implementation(libs.build.dokka)
implementation(libs.build.mavenpublish)
implementation(libs.build.semver)
+ implementation(libs.build.sentry)
}
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))
+ }
+}
diff --git a/build-logic/kotlin-plugins/src/main/kotlin/com.github.android-password-store.binary-compatibility.gradle.kts b/build-logic/kotlin-plugins/src/main/kotlin/com.github.android-password-store.binary-compatibility.gradle.kts
index ad6080e0..2723c8dc 100644
--- a/build-logic/kotlin-plugins/src/main/kotlin/com.github.android-password-store.binary-compatibility.gradle.kts
+++ b/build-logic/kotlin-plugins/src/main/kotlin/com.github.android-password-store.binary-compatibility.gradle.kts
@@ -16,6 +16,7 @@ apiValidation {
"format-common",
"diceware",
"random",
+ "sentry-stub",
"ui-compose",
)
}
diff --git a/build-logic/settings.gradle.kts b/build-logic/settings.gradle.kts
index dc8e13b2..144cd7f7 100644
--- a/build-logic/settings.gradle.kts
+++ b/build-logic/settings.gradle.kts
@@ -2,6 +2,7 @@
* Copyright © 2014-2021 The Android Password Store Authors. All Rights Reserved.
* SPDX-License-Identifier: GPL-3.0-only
*/
+@file:Suppress("UnstableApiUsage")
rootProject.name = "build-logic"