-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·63 lines (51 loc) · 1.36 KB
/
build.sh
File metadata and controls
executable file
·63 lines (51 loc) · 1.36 KB
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
#!/bin/bash
# Android Master Project
# We don't allow scrollback buffer
echo -e '\0033\0143'
clear
# Local defaults, can be overriden by environment
: ${THREADS:="$(cat /proc/cpuinfo | grep "^processor" | wc -l)"}
# Import command line parameters
DEVICE="$1"
EXTRAS="$2"
# If there is no extra parameter, reduce parameters index by 1
if [ "$EXTRAS" == "true" ] || [ "$EXTRAS" == "false" ]; then
SYNC="$2"
UPLOAD="$3"
else
SYNC="$3"
UPLOAD="$4"
fi
echo -e "Building MASTAKAT for $DEVICE";
# Decide what command to execute
case "$EXTRAS" in
threads)
echo -e "Please enter desired building/syncing threads number followed by [ENTER]"
read threads
THREADS=$threads
;;
clean|cclean)
echo -e "Cleaning intermediates and output files"
export CLEAN_BUILD="true"
[ -d "${DIR}/out" ] && rm -Rf ${DIR}/out/*
;;
esac
echo -e ""
# Fetch latest sources
if [ "$SYNC" == "true" ]; then
echo -e ""
echo -e "$Fetching latest sources"
repo sync -j"$THREADS"
echo -e ""
fi
# Setup environment
echo -e ""
echo -e "Setting up environment"
. build/envsetup.sh
echo -e ""
# lunch/brunch device
echo -e "Lunching device [$DEVICE]"
lunch "mk_$DEVICE-userdebug";
echo -e "Starting compilation..."
mka bacon
echo -e ""