bugsnag / bugsnag-android-gradle-plugin

Gradle plugin for BugSnag which uploads ProGuard, DexGuard and NDK mapping files, and sends build notifications
https://docs.bugsnag.com/build-integrations/gradle/
MIT License
70 stars 38 forks source link

Add react native maven repo earlier in plugin lifecycle #355

Closed fractalwrench closed 3 years ago

fractalwrench commented 3 years ago

Goal

The plugin adds a maven repository so that it can find the AARs bundled in the node_module, which avoids the user having to perform additional setup. If JVM minification isn't enabled when performing a gradle build then the plugin wouldn't have any effect as it bails out early rather than adding tasks: https://github.com/bugsnag/bugsnag-android-gradle-plugin/blob/integration/road-945-rn-sourcemaps/src/main/kotlin/com/bugsnag/android/gradle/BugsnagPlugin.kt#L199

This meant that in some circumstances the maven repository would not be added. The fix in this changeset ensures that the react native maven repo is added once as soon as the plugin initializes, so that the dependency always has a chance to resolve. It's worth noting that if the user has disabled the plugin entirely they will need to add the maven repository themselves.