feat: add sentry
This commit is contained in:
@@ -3,6 +3,8 @@
|
|||||||
* Copyright (c) 2025. All rights reserved.
|
* Copyright (c) 2025. All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import java.util.Properties
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
alias(libs.plugins.android.application)
|
alias(libs.plugins.android.application)
|
||||||
alias(libs.plugins.kotlin.android)
|
alias(libs.plugins.kotlin.android)
|
||||||
@@ -22,6 +24,15 @@ android {
|
|||||||
setProperty("archivesBaseName", "$applicationId-v$versionCode($versionName)")
|
setProperty("archivesBaseName", "$applicationId-v$versionCode($versionName)")
|
||||||
|
|
||||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
|
||||||
|
val secretProperties = Properties().apply {
|
||||||
|
val secretFile = rootProject.file("secrets.properties")
|
||||||
|
if (secretFile.exists())
|
||||||
|
secretFile.inputStream().use { load(it) }
|
||||||
|
else
|
||||||
|
println("Warning: secrets.properties not found!")
|
||||||
|
}
|
||||||
|
manifestPlaceholders["sentry_url"] = secretProperties.getProperty("SENTRY_URL")!!
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
@@ -31,6 +42,10 @@ android {
|
|||||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||||
"proguard-rules.pro"
|
"proguard-rules.pro"
|
||||||
)
|
)
|
||||||
|
manifestPlaceholders["sentry_env"] = "production"
|
||||||
|
}
|
||||||
|
debug {
|
||||||
|
manifestPlaceholders["sentry_env"] = "develop"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
compileOptions {
|
compileOptions {
|
||||||
@@ -72,4 +87,5 @@ dependencies {
|
|||||||
implementation(libs.logback.classic)
|
implementation(libs.logback.classic)
|
||||||
|
|
||||||
implementation(libs.splitties.base)
|
implementation(libs.splitties.base)
|
||||||
|
implementation(libs.sentry)
|
||||||
}
|
}
|
||||||
@@ -26,6 +26,35 @@
|
|||||||
android:theme="@style/Theme.GeoTracker"
|
android:theme="@style/Theme.GeoTracker"
|
||||||
android:usesCleartextTraffic="true"
|
android:usesCleartextTraffic="true"
|
||||||
tools:targetApi="31">
|
tools:targetApi="31">
|
||||||
|
|
||||||
|
<meta-data
|
||||||
|
android:name="io.sentry.dsn"
|
||||||
|
android:value="${sentry_url}" />
|
||||||
|
<meta-data
|
||||||
|
android:name="io.sentry.environment"
|
||||||
|
android:value="${sentry_env}" />
|
||||||
|
<meta-data
|
||||||
|
android:name="io.sentry.send-default-pii"
|
||||||
|
android:value="true" />
|
||||||
|
<meta-data
|
||||||
|
android:name="io.sentry.traces.sample-rate"
|
||||||
|
android:value="1.0" />
|
||||||
|
<meta-data
|
||||||
|
android:name="io.sentry.traces.user-interaction.enable"
|
||||||
|
android:value="true" />
|
||||||
|
<meta-data
|
||||||
|
android:name="io.sentry.attach-screenshot"
|
||||||
|
android:value="true" />
|
||||||
|
<meta-data
|
||||||
|
android:name="io.sentry.attach-view-hierarchy"
|
||||||
|
android:value="true" />
|
||||||
|
<meta-data
|
||||||
|
android:name="io.sentry.session-replay.on-error-sample-rate"
|
||||||
|
android:value="1.0" />
|
||||||
|
<meta-data
|
||||||
|
android:name="io.sentry.session-replay.session-sample-rate"
|
||||||
|
android:value="0.1" />
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ lifecycleRuntimeKtx = "2.8.7"
|
|||||||
activityCompose = "1.10.1"
|
activityCompose = "1.10.1"
|
||||||
composeBom = "2024.04.01"
|
composeBom = "2024.04.01"
|
||||||
logbackClassic = "1.2.11"
|
logbackClassic = "1.2.11"
|
||||||
|
sentry = "8.12.0"
|
||||||
splittiesFunPackAndroidBase = "3.0.0"
|
splittiesFunPackAndroidBase = "3.0.0"
|
||||||
|
|
||||||
[libraries]
|
[libraries]
|
||||||
@@ -35,6 +36,7 @@ ktor-client-json = { module = "io.ktor:ktor-client-json", version.ref = "ktor" }
|
|||||||
ktor-client-logging = { module = "io.ktor:ktor-client-logging", version.ref = "ktor" }
|
ktor-client-logging = { module = "io.ktor:ktor-client-logging", version.ref = "ktor" }
|
||||||
ktor-client-okhttp = { module = "io.ktor:ktor-client-okhttp", version.ref = "ktor" }
|
ktor-client-okhttp = { module = "io.ktor:ktor-client-okhttp", version.ref = "ktor" }
|
||||||
logback-classic = { module = "ch.qos.logback:logback-classic", version.ref = "logbackClassic" }
|
logback-classic = { module = "ch.qos.logback:logback-classic", version.ref = "logbackClassic" }
|
||||||
|
sentry = { module = "io.sentry:sentry-android", version.ref = "sentry" }
|
||||||
splitties-base = { module = "com.louiscad.splitties:splitties-fun-pack-android-base", version.ref = "splittiesFunPackAndroidBase" }
|
splitties-base = { module = "com.louiscad.splitties:splitties-fun-pack-android-base", version.ref = "splittiesFunPackAndroidBase" }
|
||||||
|
|
||||||
[plugins]
|
[plugins]
|
||||||
|
|||||||
Reference in New Issue
Block a user