-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmake
executable file
·159 lines (140 loc) · 4.61 KB
/
make
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
#!/bin/sh
# v1.0.14
# KENT <[email protected]>
# Building tools for React-Native app bundle
case ${1} in
"android-bundle")
# node node_modules/react-native/local-cli/cli.js bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
node node_modules/react-native/local-cli/cli.js bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/
;;
"ios-bundle")
node node_modules/react-native/local-cli/cli.js bundle --platform ios --dev false --entry-file index.js --bundle-output ios/main.jsbundle --assets-dest ios
;;
"bundle")
if test ! -z ${2}
then
echo "[!]MAKE: Run build tool command for the platform: [${2}]\n.";
else
echo "[!]MAKE: Run build tool command for the ALL platforms.\n";
fi
case ${2} in
"android")
sh ./make android-bundle
;;
"ios")
sh ./make ios-bundle
;;
*)
sh ./make android-bundle && sh ./make ios-bundle && sh ./make fix android-resource-release-gradle
;;
esac
;;
"fix")
case ${2} in
"android-resource-release-gradle")
node ./scripts/fix-android-release-gradle.js
;;
"websocket-ssl")
node ./scripts/install-wss.js
;;
"0.59-third-party-ios")
curl -L https://git.io/fix-rn-xcode10 | bash
;;
*)
echo "Fix:\n)Option1: 'android-resource-release-gradle'\n)Option2: '0.59-third-party-ios'"
;;
esac
;;
"ci")
if test ! -z ${3}
then
echo "[!]MAKE: Run CI command for the platform: [${2}] and [${3}] mode.\n.";
else
case ${2} in
"env")
echo "[!]MAKE: Run CI command for install the env.\n."
;;
*)
echo "[!]MAKE: Run CI command for ALL platforms in PRODUCTION mode.\n."
;;
esac
fi
case ${2} in
"producation")
cd ios && bundle install && fastlane make appstore && fastlane make development && cd ../
;;
"env")
gem install cocoapods:1.8.4 && gem install bundler && gem install fastlane
;;
*)
cd ${2} && bundle install && fastlane ${3} && cd ../
;;
esac
;;
"versioning")
echo "[!]Command - "${1} ${2} ${3} ${4};
#Get the highest tag number
VERSION=`git tag --sort version:refname | tail -1`
VERSION=${VERSION:-'0.0.0'}
#Get number parts
MAJOR="${VERSION%%.*}"; VERSION="${VERSION#*.}"
MINOR="${VERSION%%.*}"; VERSION="${VERSION#*.}"
PATCH="${VERSION%%.*}"; VERSION="${VERSION#*.}"
#Increase version
PATCH=$((PATCH+1))
#Get current hash and see if it already has a tag
GIT_COMMIT=`git rev-parse HEAD`
NEEDS_TAG=`git describe --contains $GIT_COMMIT`
#Create new tag
NEW_TAG="$MAJOR.$MINOR.$PATCH"
echo "$NEW_TAG"
case ${2} in
"alpha")
react-native-version && standard-version -a -r patch --prerelease alpha ${3} ${4} && sh ./make versioning push-tag
;;
"patch")
react-native-version && standard-version -a -r patch ${3} ${4} && sh ./make versioning push-tag
;;
"miror")
react-native-version && standard-version -a -r miror ${3} ${4} && sh ./make versioning push-tag
;;
"major")
react-native-version && standard-version -a -r major ${3} ${4} && sh ./make versioning push-tag
;;
"ci")
git fetch --prune --tags && react-native-version && standard-version -a -r $NEW_TAG && react-native-version && git push origin $(git tag --sort version:refname | tail -1) --force
;;
"push-tag")
git push origin $(git tag --sort version:refname | tail -1)
;;
*)
echo "[!]Versioning: Command for upgrade project version number automatically.\n
- Option1: 'patch' - Update project with "PATCH" number(Auto commit).
- Option2: 'miror' - Update project with "MIROR" number(Auto commit).
- Option3: 'major' - Update project with "MAJOR" number(Auto commit).
- Option4: 'ci' - Update project using standard-version default setting with CI(Auto commit).\n"
;;
esac
;;
"changelog")
conventional-changelog -p angular -i CHANGELOG.md -s
;;
"changelog-init")
conventional-changelog -p angular -i CHANGELOG.md -s -r 0
;;
"clear")
watchman watch-del-all && rm -rf /tmp/metro-bundler-cache-* && rm -rf /tmp/haste-map-react-native-packager-* && react-native start --reset-cache
;;
"sonar")
node ./scripts/sonar-scanner.js
;;
"install-fonts")
yarn add opentype.js --dev &&
node ./scripts/align-font-name.js &&
npx react-native-asset -a ./@App/Assets/Fonts
;;
"postinstall")
echo "[!]MAKE: run build tool command 'postinstall'."
npx jetify && sh ./make fix websocket-ssl && sh ./make fix android-resource-release-gradle
;;
esac