forked from Sunbird-Ed/SunbirdEd-mobile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·61 lines (44 loc) · 1.18 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
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/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"
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"
git clone -b $buildBranch https://github.com/project-sunbird/genie-sdk-wrapper.git
cd genie-sdk-wrapper
rm package-lock.json
npm install
npm run build
rm $(pwd)/dist/dependencies.json
npm pack $(pwd)/dist
cd ..
npm install
npm install $(pwd)/genie-sdk-wrapper/*.tgz --save
rm -rf genie-sdk-wrapper
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#$buildBranch
done
rm -rf platforms
ionic cordova platforms add [email protected]
ionic cordova build android --prod --release --buildConfig ./buildConfig/build.json