forked from adapt-it/adapt-it-mobile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-aim.sh
executable file
·65 lines (56 loc) · 1.55 KB
/
build-aim.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
#!/bin/bash
# build-ai.sh -- builds Adapt It Mobile on macOS (ios and Android platforms)
DIR=$( cd "$( dirname "$0" )" && pwd )
TRUNK=$DIR
CURRENT_OS="OSX"
ANDROID_VER="@12.0.1" # cordova-android version
IOS_VER="@7.0.1" # cordova-ios version
echo " "
echo "-- Adapt It Mobile build configuration --"
echo " Current directory: $DIR"
echo " cordova-android: $ANDROID_VER"
echo " cordova-ios: $IOS_VER"
echo "-------------------------------------"
# troubleshooting helps -- enable if needed
# set -e
# set -x
# clean
# remove files from previous builds
rm -rf $TRUNK/platforms
if [ $? -ne 0 ]
then
echo "Unable to remove platforms directory: $?"
exit 1
fi
rm -rf $TRUNK/plugins
if [ $? -ne 0 ]
then
echo "Unable to remove plugins directory: $?"
exit 1
fi
# Add platforms as appropriate
# (will also add plugins from config.xml)
if [ "$(uname)" == "Darwin" ]; then
# macOS / OSX -- Android and iOS platforms
osType="Darwin"
echo "OSX detected... adding android and iOS platforms"
cordova platform add android $ANDROID_VER
cordova platform add ios $IOS_VER
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
# Linux -- Android
osType="Linux"
echo "Linux detected... adding android platform"
cordova platform add android $ANDROID_VER
fi
# build ios and Android platforms
cordova build
if [ $? -ne 0 ]
then
echo "Error building Adapt It Mobile: $?"
exit 1
fi
echo " "
echo "--------------------------------------"
echo "-- Adapt It Mobile builds succeeded --"
echo "--------------------------------------"
echo " "