forked from Sunbird-Ed/SunbirdEd-mobile-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·48 lines (36 loc) · 1.09 KB
/
build.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
#!/bin/bash
# Simple script to clean install
rm -rf node_modules
rm -rf platforms
rm -rf plugins
rm -rf www
CORDOVA_COUNTER=0
SUNBIRD_CORDOVA_COUNTER=0
# Pass build branch as input
buildBranch="$1"
npm install
file="./build_config"
while IFS="=" read -r key value; do
case "$key" in
'#'*) ;;
'cordova'*)
CORDOVA[$CORDOVA_COUNTER]=$value
CORDOVA_COUNTER=$((CORDOVA_COUNTER+1));;
'sunbird-cordova'*)
SUNBIRD_CORDOVA[$SUNBIRD_CORDOVA_COUNTER]=$value
SUNBIRD_CORDOVA_COUNTER=$((SUNBIRD_CORDOVA_COUNTER+1));
esac
done < "$file"
for cordova_plugin in "${CORDOVA[@]}"
do
ionic cordova plugin add $cordova_plugin
done
for cordova_plugin in "${SUNBIRD_CORDOVA[@]}"
do
ionic cordova plugin add $cordova_plugin
done
rm -rf platforms
#Temporary Workaround to generate build as webpack was complaining of Heap Space
#need to inspect on webpack dependdencies at the earliest
NODE_OPTIONS=--max-old-space-size=4096 ionic cordova platforms add [email protected]
NODE_OPTIONS=--max-old-space-size=4096 ionic cordova build android --prod --release --buildConfig ./buildConfig/build.json