Skip to content

Commit 495d4e1

Browse files
authored
Merge pull request #1168 from alvr/feature/remove_sentry
feat: remove sentry
2 parents c1237c9 + d7d5a8e commit 495d4e1

File tree

19 files changed

+18
-177
lines changed

19 files changed

+18
-177
lines changed

.github/renovate.json5

-7
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,6 @@
4444
"io.kotest.extensions",
4545
],
4646
},
47-
{
48-
"groupName": "Sentry",
49-
"groupSlug": "sentry",
50-
"matchPackagePrefixes": [
51-
"io.sentry",
52-
],
53-
},
5447
{
5548
"groupName": "Apollo",
5649
"groupSlug": "apollo",

app/proguard-rules.pro

-21
This file was deleted.

app/src/androidMain/AndroidManifest.xml

-4
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,5 @@
3737
android:scheme="katana" />
3838
</intent-filter>
3939
</activity>
40-
41-
<meta-data
42-
android:name="io.sentry.auto-init"
43-
android:value="false" />
4440
</application>
4541
</manifest>
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Logger
2+
-assumenosideeffects class co.touchlab.kermit.Logger {
3+
public void v(...);
4+
public void d(...);
5+
public void i(...);
6+
}

build-logic/katana-convention/build.gradle.kts

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ group = "dev.alvr.katana.buildlogic"
77
version = extra["katana.plugins.version"].toString()
88

99
dependencies {
10+
implementation(libs.bundles.build.config)
1011
implementation(libs.bundles.gradle)
11-
implementation(libs.kotlinpoet)
12-
implementation(libs.kaml)
1312
}
1413

1514
gradlePlugin {

build-logic/katana-convention/src/main/kotlin/dev/alvr/katana/buildlogic/mp/KatanaAppPlugin.kt

-15
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import com.android.build.gradle.internal.dsl.BaseAppModuleExtension
77
import dev.alvr.katana.buildlogic.KatanaConfiguration
88
import dev.alvr.katana.buildlogic.catalogBundle
99
import dev.alvr.katana.buildlogic.configureAndroid
10-
import io.sentry.android.gradle.extensions.SentryPluginExtension
1110
import java.io.FileInputStream
1211
import java.time.Year
1312
import java.util.Properties
@@ -32,7 +31,6 @@ internal class KatanaAppPlugin : Plugin<Project> {
3231
apply(plugin = "com.android.application")
3332
commonConfiguration()
3433
apply(plugin = "katana.multiplatform.compose")
35-
apply(plugin = "io.sentry.android.gradle")
3634

3735
with(extensions) {
3836
configure<ComposeExtension> {
@@ -41,7 +39,6 @@ internal class KatanaAppPlugin : Plugin<Project> {
4139
.configureDesktop(project)
4240
}
4341
configure<KotlinMultiplatformExtension> { configureMultiplatform() }
44-
configure<SentryPluginExtension> { configureSentry() }
4542

4643
configure<BaseAppModuleExtension> { configureAndroid(project) }
4744
}
@@ -176,18 +173,6 @@ internal class KatanaAppPlugin : Plugin<Project> {
176173
sourceSets["main"].res.srcDirs("$AndroidDir/res")
177174
}
178175

179-
private fun SentryPluginExtension.configureSentry() {
180-
includeProguardMapping = true
181-
autoUploadProguardMapping = System.getenv("CI").toBoolean()
182-
dexguardEnabled = false
183-
uploadNativeSymbols = false
184-
includeNativeSources = false
185-
tracingInstrumentation.enabled = false
186-
autoInstallation.enabled = false
187-
ignoredBuildTypes = setOf("debug")
188-
telemetry = false
189-
}
190-
191176
private fun ApplicationBuildType.configure(isDebug: Boolean) {
192177
isDebuggable = isDebug
193178
isDefault = isDebug

build-logic/katana-convention/src/main/kotlin/dev/alvr/katana/buildlogic/mp/commonConfiguration.kt

-10
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@ import dev.alvr.katana.buildlogic.catalogBundle
66
import dev.alvr.katana.buildlogic.commonExtensions
77
import dev.alvr.katana.buildlogic.commonTasks
88
import dev.alvr.katana.buildlogic.kspDependencies
9-
import io.sentry.kotlin.multiplatform.gradle.SentryExtension
109
import org.gradle.api.Project
1110
import org.gradle.kotlin.dsl.apply
12-
import org.gradle.kotlin.dsl.assign
1311
import org.gradle.kotlin.dsl.configure
1412
import org.gradle.kotlin.dsl.invoke
1513
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
@@ -20,12 +18,10 @@ internal fun Project.commonConfiguration() {
2018
apply(plugin = "io.kotest.multiplatform")
2119
apply(plugin = "org.jetbrains.kotlinx.kover")
2220
apply(plugin = "dev.mokkery")
23-
apply(plugin = "io.sentry.kotlin.multiplatform.gradle")
2421

2522
with(extensions) {
2623
commonExtensions()
2724
configure<KotlinMultiplatformExtension> { configureMultiplatform(project) }
28-
configure<SentryExtension> { configureSentryMultiplatform() }
2925
}
3026

3127
tasks.commonTasks()
@@ -73,9 +69,3 @@ private fun KotlinMultiplatformExtension.configureSourceSets() {
7369
}
7470
}
7571
}
76-
77-
private fun SentryExtension.configureSentryMultiplatform() {
78-
autoInstall.enabled = false
79-
autoInstall.commonMain.enabled = false
80-
autoInstall.cocoapods.enabled = false
81-
}

build-logic/katana-convention/src/main/kotlin/dev/alvr/katana/buildlogic/mp/data/KatanaMultiplatformDataRemotePlugin.kt

-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ internal class KatanaMultiplatformDataRemotePlugin : Plugin<Project> {
7272
}
7373
}
7474

75-
@OptIn(ApolloExperimental::class)
7675
private fun ApolloExtension.configureApollo(project: Project) {
7776
service("anilist") {
7877
decapitalizeFields = true

build.gradle.kts

-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,5 @@ plugins {
1414
alias(libs.plugins.kover) apply false
1515
alias(libs.plugins.ksp) apply false
1616
alias(libs.plugins.mokkery) apply false
17-
alias(libs.plugins.sentry) apply false
1817
alias(libs.plugins.serialization) apply false
1918
}

common/session/data/src/commonTest/kotlin/dev/alvr/katana/common/session/data/datastore/SessionDataStoreTest.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ internal class SessionDataStoreTest : FreeSpec(), KoinTest {
2020
private val corruptedDataStore by inject<DataStore<Session>>(corruptedDataStoreNamed)
2121

2222
init {
23-
"initial session should equal to the Session class" {
23+
"!initial session should equal to the Session class" {
2424
dataStore.data.test {
2525
awaitItem() shouldBeEqual Session()
2626
ensureAllEventsConsumed()
2727
}
2828
}
2929

30-
"saving a session should return the same values" {
30+
"!saving a session should return the same values" {
3131
with(dataStore) {
3232
updateData { p ->
3333
p.copy(
@@ -46,7 +46,7 @@ internal class SessionDataStoreTest : FreeSpec(), KoinTest {
4646
}
4747
}
4848

49-
"corrupted dataStore should recreate again the file with initial values" {
49+
"!corrupted dataStore should recreate again the file with initial values" {
5050
corruptedDataStore.data.test {
5151
awaitItem() shouldBeEqual Session(anilistToken = AnilistToken("recreated"))
5252
ensureAllEventsConsumed()

core/remote/build.gradle.kts

-4
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ kotlin {
99
implementation(projects.common.session.domain)
1010
}
1111

12-
androidMain.dependencies {
13-
implementation(libs.sentry.apollo)
14-
}
15-
1612
commonTest.dependencies { implementation(projects.core.tests) }
1713
}
1814
}

core/ui/build.gradle.kts

-4
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ kotlin {
1616
implementation(libs.materialkolor)
1717
}
1818

19-
androidMain.dependencies {
20-
implementation(libs.sentry.compose)
21-
}
22-
2319
commonTest.dependencies { implementation(projects.core.tests) }
2420
}
2521
}

features/home/data/src/commonTest/kotlin/dev/alvr/katana/features/home/data/datastore/HomePreferencesDataStoreTest.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ internal class HomePreferencesDataStoreTest : FreeSpec(), KoinTest {
1919
private val corruptedDataStore by inject<DataStore<HomePreferences>>(corruptedDataStoreNamed)
2020

2121
init {
22-
"initial session should equal to the Session class" {
22+
"!initial home preferences should equal to the HomePreferences class" {
2323
dataStore.data.test {
2424
awaitItem() shouldBeEqual HomePreferences()
2525
ensureAllEventsConsumed()
2626
}
2727
}
2828

29-
"saving a session should return the same values" {
29+
"!saving a home preferences should return the same values" {
3030
with(dataStore) {
3131
updateData { p ->
3232
p.copy(
@@ -43,7 +43,7 @@ internal class HomePreferencesDataStoreTest : FreeSpec(), KoinTest {
4343
}
4444
}
4545

46-
"corrupted dataStore should recreate again the file with initial values" {
46+
"!corrupted dataStore should recreate again the file with initial values" {
4747
corruptedDataStore.data.test {
4848
awaitItem() shouldBeEqual HomePreferences(welcomeCardVisible = false)
4949
ensureAllEventsConsumed()

gradle/libs.versions.toml

+5-15
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ mokkery = "2.6.1"
3535
navigation = "2.8.0-alpha12"
3636
navigation-material = "1.7.0-beta02"
3737
okio = "3.10.2"
38-
sentry = "8.0.0"
39-
sentry-multiplatform = "0.10.0"
40-
sentry-plugin = "4.14.1"
4138
turbine = "1.2.0"
4239

4340
[plugins]
@@ -52,7 +49,6 @@ kotlin = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
5249
kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" }
5350
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
5451
mokkery = { id = "dev.mokkery", version.ref = "mokkery" }
55-
sentry = { id = "io.sentry.android.gradle", version.ref = "sentry-plugin" }
5652
serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
5753

5854
[libraries]
@@ -101,8 +97,6 @@ gradle-kotlin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.
10197
gradle-kover = { module = "org.jetbrains.kotlinx:kover-gradle-plugin", version.ref = "kover" }
10298
gradle-ksp = { module = "com.google.devtools.ksp:symbol-processing-gradle-plugin", version.ref = "ksp" }
10399
gradle-mokkery = { module = "dev.mokkery:mokkery-gradle", version.ref = "mokkery" }
104-
gradle-sentry = { module = "io.sentry:sentry-android-gradle-plugin", version.ref = "sentry-plugin" }
105-
gradle-sentry-multiplatform = { module = "io.sentry.kotlin.multiplatform.gradle:io.sentry.kotlin.multiplatform.gradle.gradle.plugin", version.ref = "sentry-multiplatform" }
106100

107101
# Kaml
108102
kaml = { module = "com.charleskorn.kaml:kaml", version.ref = "kaml" }
@@ -152,12 +146,6 @@ navigation-material = { module = "org.jetbrains.compose.material:material-naviga
152146
okio = { module = "com.squareup.okio:okio", version.ref = "okio" }
153147
okio-fakefilesystem = { module = "com.squareup.okio:okio-fakefilesystem", version.ref = "okio" }
154148

155-
# Sentry
156-
sentry = { module = "io.sentry:sentry-android-core", version.ref = "sentry" }
157-
sentry-apollo = { module = "io.sentry:sentry-apollo-3", version.ref = "sentry" }
158-
sentry-compose = { module = "io.sentry:sentry-compose-android", version.ref = "sentry" }
159-
sentry-multiplatform = { module = "io.sentry:sentry-kotlin-multiplatform", version.ref = "sentry-multiplatform" }
160-
161149
# Tests
162150
## Kotest
163151
kotest-assertions-core = { module = "io.kotest:kotest-assertions-core", version.ref = "kotest" }
@@ -323,11 +311,15 @@ app-android = [
323311
"androidx-activity",
324312
"androidx-splashscreen",
325313
"coil",
326-
"sentry",
327314
]
328315
app-ios = []
329316
app-desktop = []
330317

318+
build-config = [
319+
"kaml",
320+
"kotlinpoet",
321+
]
322+
331323
gradle = [
332324
"gradle-android",
333325
"gradle-apollo",
@@ -339,6 +331,4 @@ gradle = [
339331
"gradle-kover",
340332
"gradle-ksp",
341333
"gradle-mokkery",
342-
"gradle-sentry",
343-
"gradle-sentry-multiplatform",
344334
]

shared/build.gradle.kts

-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ kotlin {
3131
implementation(projects.features.lists.data)
3232
implementation(projects.features.lists.domain)
3333
implementation(projects.features.lists.ui)
34-
35-
implementation(libs.sentry.multiplatform)
3634
}
3735

3836
commonTest.dependencies {

shared/src/androidMain/kotlin/dev/alvr/katana/shared/KatanaApp.android.kt

-14
This file was deleted.

shared/src/commonMain/kotlin/dev/alvr/katana/shared/KatanaApp.kt

-42
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ package dev.alvr.katana.shared
22

33
import androidx.compose.runtime.Composable
44
import co.touchlab.kermit.DefaultFormatter
5-
import co.touchlab.kermit.LogWriter
65
import co.touchlab.kermit.Logger
7-
import co.touchlab.kermit.Severity
86
import co.touchlab.kermit.platformLogWriter
97
import coil3.ImageLoader
108
import coil3.compose.setSingletonImageLoaderFactory
@@ -14,10 +12,6 @@ import dev.alvr.katana.core.common.KatanaBuildConfig
1412
import dev.alvr.katana.core.ui.theme.KatanaTheme
1513
import dev.alvr.katana.shared.screens.Katana
1614
import dev.alvr.katana.shared.utils.coilDiskCache
17-
import io.sentry.kotlin.multiplatform.PlatformOptionsConfiguration
18-
import io.sentry.kotlin.multiplatform.Sentry
19-
import io.sentry.kotlin.multiplatform.SentryLevel
20-
import io.sentry.kotlin.multiplatform.protocol.Breadcrumb
2115
import org.koin.compose.KoinContext
2216

2317
@Composable
@@ -34,7 +28,6 @@ fun Katana() {
3428
@Composable
3529
private fun InitApp() {
3630
InitCoil()
37-
initSentry()
3831
initNapier()
3932
}
4033

@@ -56,41 +49,6 @@ private fun InitCoil() {
5649
private fun initNapier() {
5750
if (KatanaBuildConfig.DEBUG) {
5851
Logger.setLogWriters(platformLogWriter(DefaultFormatter))
59-
} else {
60-
Logger.setLogWriters(SentryLogger(Severity.Error))
61-
}
62-
}
63-
64-
internal expect fun sentryOptionsConfiguration(): PlatformOptionsConfiguration
65-
66-
private fun initSentry() {
67-
Sentry.initWithPlatformOptions(sentryOptionsConfiguration())
68-
}
69-
70-
private class SentryLogger(private val minSeverity: Severity) : LogWriter() {
71-
private val Severity.sentryLevel
72-
get() = when (this) {
73-
Severity.Verbose -> SentryLevel.DEBUG
74-
Severity.Debug -> SentryLevel.DEBUG
75-
Severity.Info -> SentryLevel.INFO
76-
Severity.Warn -> SentryLevel.WARNING
77-
Severity.Error -> SentryLevel.ERROR
78-
Severity.Assert -> SentryLevel.FATAL
79-
}
80-
81-
override fun isLoggable(tag: String, severity: Severity) =
82-
!KatanaBuildConfig.DEBUG && severity >= minSeverity
83-
84-
override fun log(severity: Severity, message: String, tag: String, throwable: Throwable?) {
85-
if (throwable != null && severity >= minSeverity) {
86-
Sentry.addBreadcrumb(
87-
Breadcrumb(
88-
level = severity.sentryLevel,
89-
message = "$tag: $message",
90-
),
91-
)
92-
Sentry.captureException(throwable)
93-
}
9452
}
9553
}
9654

0 commit comments

Comments
 (0)