Skip to content

Commit 580e002

Browse files
runningcodeclaude
andcommitted
docs: Add comments explaining settings/project scope bridge
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 6bffa9e commit 580e002

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ class SentrySettingsPlugin : Plugin<Settings> {
1010
override fun apply(settings: Settings) {
1111
val extension = settings.extensions.create("sentry", SentrySettingsExtension::class.java)
1212

13+
// Stash the extension in Gradle's ExtraPropertiesExtension so the project-level
14+
// plugin can read it — settings and project scopes are otherwise isolated.
1315
settings.gradle.extensions
1416
.getByType(ExtraPropertiesExtension::class.java)
1517
.set(SENTRY_SETTINGS_EXTENSION_KEY, extension)

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@ import org.gradle.api.Action
66
import org.gradle.api.model.ObjectFactory
77
import org.gradle.api.provider.Property
88

9+
/**
10+
* Settings-level extension for shared Sentry configuration across all modules.
11+
*
12+
* Properties here are intentionally duplicated from [SentryPluginExtension] because Gradle
13+
* settings extensions and project extensions live in different scopes — a project extension
14+
* cannot inherit from or reference a settings extension type at configuration time. The
15+
* project-level plugin bridges the two via [SentryPluginExtension.applySettingsDefaults],
16+
* which wires these values as conventions (overridable defaults) on each module's extension.
17+
*/
918
abstract class SentrySettingsExtension @Inject constructor(objects: ObjectFactory) {
1019

1120
/** The slug of the Sentry organization. Applied as the default for all modules. */

0 commit comments

Comments
 (0)