Skip to content

Commit 9762016

Browse files
douglowderLuna Wei
authored and
Luna Wei
committed
fix: [gradle-plugin] 3rd party lib dependency substitution (#37445)
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
1 parent b245919 commit 9762016

File tree

1 file changed

+10
-0
lines changed
  • packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils

1 file changed

+10
-0
lines changed

packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/DependencyUtils.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,16 @@ internal object DependencyUtils {
6666
.using(it.module("${groupString}:hermes-android:${versionString}"))
6767
.because(
6868
"The hermes-engine artifact was deprecated in favor of hermes-android due to https://github.com/facebook/react-native/issues/35210.")
69+
if (groupString != DEFAULT_GROUP_STRING) {
70+
it.substitute(it.module("com.facebook.react:react-android"))
71+
.using(it.module("${groupString}:react-android:${versionString}"))
72+
.because(
73+
"The react-android dependency was modified to use the correct Maven group.")
74+
it.substitute(it.module("com.facebook.react:hermes-android"))
75+
.using(it.module("${groupString}:hermes-android:${versionString}"))
76+
.because(
77+
"The hermes-android dependency was modified to use the correct Maven group.")
78+
}
6979
}
7080
configuration.resolutionStrategy.force(
7181
"${groupString}:react-android:${versionString}",

0 commit comments

Comments
 (0)