sentry-android-gradle-plugin icon indicating copy to clipboard operation
sentry-android-gradle-plugin copied to clipboard

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

Open romtsn opened this issue 1 year ago • 1 comments

#skip-changelog

:scroll: 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

:bulb: Motivation and Context

Closes #800

:green_heart: How did you test it?

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

:pencil: Checklist

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

:crystal_ball: 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

romtsn avatar Mar 25 '25 13:03 romtsn

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

Generated by :no_entry_sign: dangerJS against b17f9e83b6ceb578b9d699bc7333916ab835a34b

github-actions[bot] avatar Mar 25 '25 13:03 github-actions[bot]