fix(android): be more explicit about which Gradle plugin to include (#1934)

The previous approach could fail in a monorepo where both modules could
exist in a hoisted node_modules
This commit is contained in:
John Ferlito 2024-03-26 09:01:03 +11:00 коммит произвёл GitHub
Родитель de0723127b
Коммит 211891f4fb
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
1 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@ -67,9 +67,12 @@ ext.applyTestAppSettings = { DefaultSettings settings ->
settings.project(":support")
.projectDir = file("${testAppDir}/android/support")
def reactNativeVersion = getPackageVersionNumber("react-native", rootDir)
def reactNativeGradlePlugin =
findNodeModulesPath("@react-native/gradle-plugin", reactNativeDir) // >= 0.72
?: findNodeModulesPath("react-native-gradle-plugin", reactNativeDir) // < 0.72
reactNativeVersion >= v(0, 72, 0)
? findNodeModulesPath("@react-native/gradle-plugin", reactNativeDir)
: findNodeModulesPath("react-native-gradle-plugin", reactNativeDir)
if (reactNativeGradlePlugin != null) {
settings.includeBuild(reactNativeGradlePlugin)
}