Skip to content

Commit 966ec4b

Browse files
runningcodeclaude
andcommitted
refactor: Remove android-library auto-apply from settings plugin
Library modules don't initialize Sentry themselves and auto-installing dependencies could cause version conflicts with the app module. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 39ac566 commit 966ec4b

2 files changed

Lines changed: 1 addition & 16 deletions

File tree

plugin-build/src/main/kotlin/io/sentry/android/gradle/SentryPlugin.kt

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,7 @@ constructor(private val buildEvents: BuildEventListenerRegistryInternal) : Plugi
3030
.trimIndent()
3131
)
3232
}
33-
val appliedViaSettings =
34-
project.gradle.extensions
35-
.getByType(ExtraPropertiesExtension::class.java)
36-
.has(SentrySettingsPlugin.SENTRY_SETTINGS_EXTENSION_KEY)
37-
38-
if (
39-
!appliedViaSettings &&
40-
!project.plugins.hasPlugin("com.android.application") &&
41-
!project.plugins.hasPlugin("com.android.library")
42-
) {
33+
if (!project.plugins.hasPlugin("com.android.application")) {
4334
project.logger.warn(
4435
"""
4536
WARNING: Using 'io.sentry.android.gradle' is only supported for the app module.
@@ -84,9 +75,6 @@ constructor(private val buildEvents: BuildEventListenerRegistryInternal) : Plugi
8475
project.installDependencies(extension, true)
8576
}
8677

87-
project.pluginManager.withPlugin("com.android.library") {
88-
project.installDependencies(extension, true)
89-
}
9078
}
9179

9280
companion object {

plugin-build/src/main/kotlin/io/sentry/android/gradle/SentrySettingsPlugin.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ class SentrySettingsPlugin : Plugin<Settings> {
1717
.set(SENTRY_SETTINGS_EXTENSION_KEY, extension)
1818

1919
settings.gradle.beforeProject { project ->
20-
project.pluginManager.withPlugin("com.android.library") {
21-
project.pluginManager.apply("io.sentry.android.gradle")
22-
}
2320
project.pluginManager.withPlugin("java-library") {
2421
project.pluginManager.apply("io.sentry.jvm.gradle")
2522
}

0 commit comments

Comments
 (0)