Skip to content

feat(multi-module): Introduce SentryRootPlugin with App and Lib subplugins #858

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

romtsn
Copy link
Member

@romtsn romtsn commented Mar 25, 2025

#skip-changelog

📜 Description

  • Introduce a new io.sentry.gradle plugin that has to be applied on the root project level. The plugin then:
    • Goes over subprojects and applies the respective subplugins depending on what plugins are currently applied to the gradle project
    • AppSubplugin implementation remained untouched and just works, however I will refactor and extract some things later on
    • LibSubplugin implementation to follow
    • Checks if the io.sentry.android.gradle plugin is in place and throws as they are incompatible and can't be used together
  • Deprecate io.sentry.android.gradle and print a message to switch over to the new root plugin
    • It also delegates to the same AppSubplugin that is used by the new root plugin
  • Factor out common things into a separate file that we share among the plugins

💡 Motivation and Context

Closes #800

💚 How did you test it?

So far just manually, will add/convert existing tests later

📝 Checklist

  • I reviewed the submitted code
  • [] I added tests to verify the changes
  • I updated the docs if needed
  • No breaking changes

🔮 Next steps

  • Make LibSubplugin do the actual work
    • also investigate if we can reuse the same one for all kinds of libs, not only android
  • Make RootPlugin collect sources from all modules into a single bundle and upload it
  • Introduce new SentryRootExtension and SentryProjectExtension to allow configuration per-project or globally on a root project level
  • Convert tests to use the root plugin and add a single test that tests the deprecated one

@@ -2,7 +2,7 @@ root = true

[*]
indent_style = space
indent_size = 4
indent_size = 2
Copy link
Member Author

Choose a reason for hiding this comment

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

This was a leftover from ktlint -> ktfmt migration

Copy link
Contributor

github-actions bot commented Mar 25, 2025

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

Generated by 🚫 dangerJS against b17f9e8

@@ -28,7 +31,7 @@ include(":examples:android-gradle")

include(":examples:android-gradle-kts")

include(":examples:android-guardsquare-proguard")
// include(":examples:android-guardsquare-proguard")
Copy link
Member Author

Choose a reason for hiding this comment

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

For some reason this sample doesn't work but I will figure it out later (or maybe drop the sample altogether, as it's problematic to support it given there's no plans to support AGP 8+ from the proguard side)

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.

Introduce a new AppModuleSubplugin
1 participant