Skip to content

Commit

Permalink
fix: [gradle-plugin] 3rd party lib dependency substitution (#37445)
Browse files Browse the repository at this point in the history
Summary:
For 3rd party libraries to work with a React Native fork (such as the TV repo) that uses a different Maven group for `react-android` and `hermes-android` artifacts, an additional dependency substitution is required.

## Changelog:

[Android][fixed] RNGP dependency substitutions for fork with different Maven group

Pull Request resolved: #37445

Test Plan:
- Manual tested with an existing project
- Unit tests pass

Reviewed By: rshest, dmytrorykun

Differential Revision: D45948901

Pulled By: cortinico

fbshipit-source-id: 4151a1d3616172a92c68812c3a0034c98b330d67
  • Loading branch information
douglowder authored and facebook-github-bot committed May 17, 2023
1 parent 3a321ae commit 012e4bd
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,16 @@ internal object DependencyUtils {
.using(it.module("${groupString}:hermes-android:${versionString}"))
.because(
"The hermes-engine artifact was deprecated in favor of hermes-android due to https://github.com/facebook/react-native/issues/35210.")
if (groupString != DEFAULT_GROUP_STRING) {
it.substitute(it.module("com.facebook.react:react-android"))
.using(it.module("${groupString}:react-android:${versionString}"))
.because(
"The react-android dependency was modified to use the correct Maven group.")
it.substitute(it.module("com.facebook.react:hermes-android"))
.using(it.module("${groupString}:hermes-android:${versionString}"))
.because(
"The hermes-android dependency was modified to use the correct Maven group.")
}
}
configuration.resolutionStrategy.force(
"${groupString}:react-android:${versionString}",
Expand Down

0 comments on commit 012e4bd

Please sign in to comment.