forked from bmc08gt/local_manifest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompile
executable file
·107 lines (93 loc) · 2.01 KB
/
compile
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#!/bin/bash
# Simple script that allows three types of builds
# make clean && brunch, make installclean && brunch,
# or runs ./sync && ./picks.sh && (make clean && brunch)
#ARGS
TYPE=$1
DEVICE=$2
UPLOAD=$3
help() {
echo " "
echo " compile <command> <device>"
echo " commands are :"
echo " c for make clean && brunch <device>"
echo " i for make installclean && brunch <device>"
echo " s for ./sync && ./pick && c"
echo " u for checkout upstream in device repos && c"
echo " "
}
upstream(){
cd device/samsung/d2-common && checkout_upstream && cd $root
cd device/samsung/msm8960-common && checkout_upstream && cd $root
cd device/samsung/qcom-common && checkout_upstream && cd $root
}
checkout_upstream() {
CURRENT_REPO=`pwd`
CURRENT_REPO=${CURRENT_REPO##*/}
echo " Checking out $CURRENT_REPO to AOKP upstream"
git fetch upstream && git checkout upstream/jb-mr1
}
cleanbuild() {
lunchchoices
make clean
}
icleanbuild () {
lunchchoices
make installclean
}
syncpick() {
./sync
./picks.sh
}
brunchit () {
time brunch $DEVICE
}
lunchchoices() {
lunch aokp_$DEVICE-userdebug
}
root=`pwd`
# Load environment
if [ ! -d platform_manifest ]; then
echo "Not in root of source tree!!"
exit
else
. build/envsetup.sh >/dev/null 2>&1
fi
# Check command
if [ "$TYPE" = "help" ]; then
help
exit
elif [ "$TYPE" = "c" ]; then
cleanbuild
brunchit
elif [ "$TYPE" = "i" ]; then
icleanbuild
brunchit
elif [ "$TYPE" = "s" ]; then
syncpick
cleanbuild
brunchit
elif [ "$TYPE" = "u" ]; then
sync
upstream
cleanbuild
brunchit
else
echo " No build command given"
echo " "
echo " compile <command> <device> "
echo " compile help for help with build commands"
fi
if [ "$UPLOAD" = "-y" ]; then
# Just move zip out of build dir for now
ZIP=` find out/target/product/$DEVICE -name *aokp_\*unofficial*.zip `
if [ ! -d ~/zips/$DEVICE ]; then
mkdir ~/zips/$DEVICE
fi
if [ "$ZIP" != "" ]; then
cp $ZIP ~/zips/$DEVICE
else
echo "No zip found in out/target/product/$DEVICE."
echo "Build bork!?!?"
fi
fi