feat(source-context): Include sources from library modules#1177
Draft
runningcode wants to merge 2 commits intomainfrom
Draft
feat(source-context): Include sources from library modules#1177runningcode wants to merge 2 commits intomainfrom
runningcode wants to merge 2 commits intomainfrom
Conversation
Source context was only collected from the app module, which meant stack traces from library module code had no source context in Sentry. This adds support for collecting sources from all transitive local project dependencies using Gradle's consumable/resolvable configuration pattern, which is Project Isolation compatible. Library modules publish their source directories via a consumable `sentrySourceElements` configuration with a custom attribute. The app module resolves these through a resolvable configuration that inherits the same dependency scopes as RuntimeClasspath, with lenient resolution to gracefully skip dependencies without the plugin. Two setup paths: apply `io.sentry.android.gradle` to library modules, or apply the new `io.sentry.android.gradle.settings` settings plugin to auto-configure all library modules. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
Instructions and example for changelogPlease add an entry to Example: ## Unreleased
### Features
- Include sources from library modules ([#1177](https://github.com/getsentry/sentry-android-gradle-plugin/pull/1177))If none of the above apply, you can opt out of this check by adding |
…ractices Instead of the settings plugin performing build logic directly, it now auto-applies `io.sentry.android.gradle` to library modules. The project plugin handles all actual configuration. Follows the pattern from liutikas.net/2024/10/28/DRY-Gradle-Configuration-Values.html. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
io.sentry.android.gradleto library modules directly, or apply the newio.sentry.android.gradle.settingssettings plugin to auto-configure all library modules.How it works
Library side: A consumable
sentrySourceElementsconfiguration publishessrc/main/javaandsrc/main/kotlinas artifacts with a custom attribute (io.sentry.artifact = sentry-sources).App side: When
includeSourceContext = true, a resolvable configuration inherits the same dependency scopes asRuntimeClasspathand resolves source directories from dependency libraries via attribute matching withlenient(true).User experience
🤖 Generated with Claude Code