-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
82 lines (72 loc) · 1.41 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
echo -e "\n\n Choose a device: \n"
echo -e "1. Galaxy S2 Plus NFC (s2vep)"
echo -e "2. Galaxy S2 Plus (s2ve)"
echo -e "3. Galaxy Grand Duos (baffin) \n\n"
read device
echo -e "\n\n Do you want to make clean? \n"
echo -e "1. Yes"
echo -e "2. No"
read cle
echo -e "\n\n Do you want to sync sources? \n"
echo -e "1. Yes"
echo -e "2. No"
read syn
res1=$(date +%s.%N)
if [ "$cle" == "1" ]
then
echo -e "\n\n Cleaning... \n\n"
make clean
fi
if [ "$syn" == "1" ]
then
echo -e "\n\n Syncing sources... \n\n"
repo sync
fi
echo -e "\n\n Setting up environment... \n\n"
. build/envsetup.sh
echo -e "\n\n Building... \n\n"
if [ "$device" == "1" ]
then
lunch cm_s2vep-userdebug
brunch s2vep
elif [ "$device" == "2" ]
then
lunch cm_s2ve-userdebug
brunch s2ve
elif [ "$device" == "3" ]
then
lunch cm_baffin-userdebug
brunch baffin
elif [ "$device" == "12" ]
then
lunch cm_s2vep-userdebug
brunch s2vep
lunch cm_s2ve-userdebug
brunch s2ve
elif [ "$device" == "13" ]
then
lunch cm_s2vep-userdebug
brunch s2vep
lunch cm_baffin-userdebug
brunch baffin
elif [ "$device" == "23" ]
then
lunch cm_s2ve-userdebug
brunch s2ve
lunch cm_baffin-userdebug
brunch baffin
elif [ "$device" == "123" ]
then
lunch cm_s2vep-userdebug
brunch s2vep
lunch cm_s2ve-userdebug
brunch s2ve
lunch cm_baffin-userdebug
brunch baffin
fi
if [ -e up.py ]
then
./up.py
fi
res2=$(date +%s.%N)
echo "Time elapsed: $(echo "($res2 - $res1) / 60"|bc ) minutes"