forked from facebook/react-native
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreplace.sh
executable file
·71 lines (47 loc) · 1.57 KB
/
replace.sh
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/bash
REWIND_DIR=$(grep -E '^rewind\.dir=' local.properties | awk -F '=' '{print $2}')
echo "rewind dir: $REWIND_DIR"
function replace_android {
REWIND_MODULES_RN_ANDROID=$REWIND_DIR/node_modules/react-native/android
echo "Removing $REWIND_MODULES_RN_ANDROID"
rm -rf $REWIND_MODULES_RN_ANDROID
echo "Copying ./android to $REWIND_MODULES_RN_ANDROID"
cp -r ./android $REWIND_MODULES_RN_ANDROID
cat $REWIND_MODULES_RN_ANDROID/com/facebook/react/react-native/maven-metadata.xml.md5
}
function replace_libraries() {
REWIND_MODULES_RN_LIBRARIES=$REWIND_DIR/node_modules/react-native/Libraries
echo "Removing $REWIND_MODULES_RN_LIBRARIES"
rm -rf $REWIND_MODULES_RN_LIBRARIES
echo "Copying ./Libraries to $REWIND_MODULES_RN_LIBRARIES"
cp -r ./Libraries $REWIND_MODULES_RN_LIBRARIES
}
function replace_gradle() {
REWIND_REACT_GRADLE=$REWIND_DIR/node_modules/react-native/react.gradle
echo "Removing $REWIND_REACT_GRADLE"
rm $REWIND_REACT_GRADLE
echo "Copying ./react.gradle to $REWIND_REACT_GRADLE"
cp ./react.gradle $REWIND_REACT_GRADLE
}
function replace_hermesc() {
REWIND_HERMES=$REWIND_DIR/node_modules/react-native/hermes-engine
echo "Removing $REWIND_HERMES"
rm -rf $REWIND_HERMES
echo "Copying ./hermes-engine to $REWIND_HERMES"
cp -r ./hermes-engine $REWIND_HERMES
}
if [ "$1" == "android" ]; then
replace_android
elif [ "$1" == "libraries" ]; then
replace_libraries
elif [ "$1" == "gradle" ]; then
replace_gradle
else
replace_android
echo "\n"
replace_libraries
echo "\n"
replace_gradle
echo "\n"
replace_hermesc
fi