@@ -4,20 +4,29 @@ import org.gradle.initialization.DefaultSettings
44
55import java.nio.file.Paths
66
7+ private static void applyConfigPlugins (String testAppDir , File rootDir ) {
8+ String [] patch = [" node" , " ${ testAppDir} /scripts/apply-config-plugins.mjs" ]
9+ Runtime . runtime. exec(patch, null , rootDir). waitFor()
10+ }
11+
712// TODO: Remove when `@react-native-community/cli` 6.0+ is required. See also
813// https://github.com/react-native-community/cli/commit/fa0d09b2c9be144bbdff526bb14f171d7ddca88e
914private static void patchArgumentTypeMismatchError (String testAppDir , File rootDir ) {
1015 // We need to delegate this to a separate script to avoid running out of
1116 // Java heap space.
1217 String [] patch = [" node" , " ${ testAppDir} /scripts/patch-cli-platform-android.js" ]
13- Runtime . getRuntime() . exec(patch, null , rootDir). waitFor()
18+ Runtime . runtime . exec(patch, null , rootDir). waitFor()
1419}
1520
1621def testAppDir = buildscript. sourceFile. getParent()
1722apply(from : " ${ testAppDir} /android/test-app-util.gradle" )
1823
1924patchArgumentTypeMismatchError(testAppDir, rootDir)
2025
26+ if (findNodeModulesPath(" @rnx-kit/react-native-test-app-config-plugins" , rootDir)) {
27+ applyConfigPlugins(testAppDir, rootDir)
28+ }
29+
2130def cliAndroidDir = findNodeModulesPath(" @react-native-community/cli-platform-android" , rootDir)
2231apply(from : " ${ cliAndroidDir} /native_modules.gradle" )
2332
0 commit comments