forked from software-mansion/react-native-reanimated
-
Notifications
You must be signed in to change notification settings - Fork 0
/
createNPMPackage.sh
executable file
·63 lines (40 loc) · 1.03 KB
/
createNPMPackage.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
#!/bin/bash
set -e
set -x
ROOT=$(pwd)
# unset CI so all archs are built
unset CI
# PART I - I (install RN)
yarn add react-native --dev
# PART I - II (clean)
rm -rf android/build/outputs/aar/*.aar
cd android
gradle clean
# PART I (add latest aar to android-npm)
gradle :assembleDebug
cd $ROOT
rm -rf android-npm/react-native-reanimated-63.aar
cp android/build/outputs/aar/*.aar android-npm/react-native-reanimated-63.aar
# PART II (clean)
rm -rf android/build/outputs/aar/*.aar
cd android
gradle clean
cd $ROOT
# part III (add react-native 62 aar to android-npm)
yarn add [email protected] --dev
cd android
gradle :assembleDebug
cd $ROOT
rm -rf android-npm/react-native-reanimated-62.aar
cp android/build/outputs/aar/*.aar android-npm/react-native-reanimated-62.aar
# PART IV (revert react-native change)
yarn add react-native --dev
# PART V (prepare android directory)
mv android android-temp
mv android-npm android
# PART VI (create package)
npm pack
# PART VII (clean)
mv android android-npm
mv android-temp android
echo "Done!"