Skip to content

Conversation

runningcode
Copy link
Contributor

@runningcode runningcode commented Oct 9, 2025

Summary

When build distribution is enabled for a variant (via distribution.enabledVariants) and autoInstallation.enabled = true, the plugin now automatically adds the sentry-android-distribution dependency to that specific variant.

Note: the library is only released as an alpha 8.24.0-alpha.1. You'll need to set sentry.autoInstallation.sentryVersion="8.24.0-alpha.1" for this to work.

Changes

  • Added SENTRY_ANDROID_DISTRIBUTION module to SentryModules
  • Implemented logic in configureDistributionPropertiesTask to add the distribution dependency per variant when both distribution and autoInstallation are enabled
  • Added 3 integration tests to verify the behavior

Refs: EME-278

#skip-changelog as this is part of the unreleased build distribution feature

🤖 Generated with Claude Code

Copy link

linear bot commented Oct 9, 2025

Copy link
Contributor

github-actions bot commented Oct 9, 2025

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 92250c1

Copy link
Contributor

@chromy chromy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm % question around AutoInstall.kt

): TaskProvider<GenerateDistributionPropertiesTask>? {
val variantName = name
if (extension.distribution.enabledVariants.get().contains(variantName)) {
// Add the build distribution dependency if autoInstallation is enabled
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see all the machinery in plugin-build/src/main/kotlin/io/sentry/android/gradle/autoinstall/AutoInstall.kt & plugin-build/src/main/kotlin/io/sentry/android/gradle/autoinstall/*/*Strategy.kt

I assume we don't want to use that because we want to condition on extension.distribution.enabledVariants? It might be worth a comment either here and/or in plugin-build/src/main/kotlin/io/sentry/android/gradle/autoinstall/AutoInstall.kt explaining why distribution has a different implementation to the others

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that was my thought, it’s just easier to include it in here although it does make the task do two things instead of one. I’ll add a comment.

content {
includeGroup("com.android.tools")
}
content { includeGroup("com.android.tools") }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You ran some linter/formatter over this and/or sentry-java right as a big one off change before right? We should try get whatever you used added to the CI.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is weird. i just ran spotlessApply and it did this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think have a theory: We run spotless on all the modules but perhaps we don’t call spotlessCheck on the root project. I will open a separate PR once I investigate further.

runningcode and others added 3 commits October 10, 2025 15:01
When a variant has distribution enabled and autoInstallation is true,
automatically add sentry-android-distribution dependency to that variant.

Refs: EME-278

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Add comments explaining why sentry-android-distribution uses a custom
auto-install implementation instead of the standard InstallStrategy
approach. Distribution requires variant-specific installation based on
extension.distribution.enabledVariants, whereas other integrations are
installed globally when their dependencies are detected.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@runningcode runningcode force-pushed the no/auto-install-distribution-dependency branch from 92155d7 to 7e74c6a Compare October 10, 2025 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants