forked from Expensify/App
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path@react-native-community+cli-platform-android+12.3.0.patch
52 lines (45 loc) · 2.35 KB
/
@react-native-community+cli-platform-android+12.3.0.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
diff --git a/node_modules/@react-native-community/cli-platform-android/native_modules.gradle b/node_modules/@react-native-community/cli-platform-android/native_modules.gradle
index bbfa7f7..ed53872 100644
--- a/node_modules/@react-native-community/cli-platform-android/native_modules.gradle
+++ b/node_modules/@react-native-community/cli-platform-android/native_modules.gradle
@@ -140,6 +140,7 @@ class ReactNativeModules {
private Logger logger
private String packageName
private File root
+ private File rnRoot
private ArrayList<HashMap<String, String>> reactNativeModules
private ArrayList<String> unstable_reactLegacyComponentNames
private HashMap<String, ArrayList> reactNativeModulesBuildVariants
@@ -147,9 +148,10 @@ class ReactNativeModules {
private static String LOG_PREFIX = ":ReactNative:"
- ReactNativeModules(Logger logger, File root) {
+ ReactNativeModules(Logger logger, File root, File rnRoot) {
this.logger = logger
this.root = root
+ this.rnRoot = rnRoot
def (nativeModules, reactNativeModulesBuildVariants, androidProject, reactNativeVersion) = this.getReactNativeConfig()
this.reactNativeModules = nativeModules
@@ -416,10 +418,10 @@ class ReactNativeModules {
*/
def cliResolveScript = "try {console.log(require('@react-native-community/cli').bin);} catch (e) {console.log(require('react-native/cli').bin);}"
String[] nodeCommand = ["node", "-e", cliResolveScript]
- def cliPath = this.getCommandOutput(nodeCommand, this.root)
+ def cliPath = this.getCommandOutput(nodeCommand, this.rnRoot)
String[] reactNativeConfigCommand = ["node", cliPath, "config"]
- def reactNativeConfigOutput = this.getCommandOutput(reactNativeConfigCommand, this.root)
+ def reactNativeConfigOutput = this.getCommandOutput(reactNativeConfigCommand, this.rnRoot)
def json
try {
@@ -486,7 +488,13 @@ class ReactNativeModules {
*/
def projectRoot = rootProject.projectDir
-def autoModules = new ReactNativeModules(logger, projectRoot)
+def autoModules
+
+if(this.hasProperty('reactNativeProject')){
+ autoModules = new ReactNativeModules(logger, projectRoot, new File(projectRoot, reactNativeProject))
+} else {
+ autoModules = new ReactNativeModules(logger, projectRoot, projectRoot)
+}
def reactNativeVersionRequireNewArchEnabled(autoModules) {
def rnVersion = autoModules.reactNativeVersion