-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathscript.sh
More file actions
executable file
·100 lines (95 loc) · 2.38 KB
/
Copy pathscript.sh
File metadata and controls
executable file
·100 lines (95 loc) · 2.38 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
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
#!/bin/bash
BUILD_DIR=/home/$USER/aokp
DATE=$(date +%h-%d-%y)
export USE_CCACHE=1
export CCACHE_COMPILERCHECK=none
#exporting for use of newer ccache. Default on 2.4 is none, Default on 3.* is mtime
if [ "$1" == "" ]
then
help
exit
else
cd $BUILD_DIR
. build/envsetup.sh
fi
sy=1
for i in "${@:2}"
do
device=$i
#reset upload to 0 until the last device is built
upload=0
function help(){
echo "usage: $0 [options] <device> <device>
options: s = sync c = clobber l = clean u = upload b= build only for <device>
example: $0 -scu d2tmo toro maguro"
}
function clean(){
lunch aokp_${device}-userdebug
make clean
}
function sync(){
if [ $sy == "1" ]; then
repo sync
#set sync to 0 so it will only run repo sync once if more then one device is being parsed
sy=0
fi
}
function clobber(){
lunch aokp_${device}-userdebug
make clobber
}
function build(){
find . -name *${device}_\*.zip* -exec echo "removing previous" {} \; -exec rm {} \;
echo "building $device"
time brunch $device
}
function UPLOAD(){
upload=1
}
for arg in $1
do
delim=""
case "$arg" in
#change long options to short options... will fix later
--help) args="${args}-h ";;
--build) args="${args}-b ";;
*) [[ "${arg:0:1}" == "-" ]] || delim="\""
args="${args}${delim}${arg}${delim} ";;
esac
done
#reset params for short opts
eval set -- $args
while getopts ":hsclbu?" option 2>/dev/null
do
case $option in
h ) help
exit
;;
s ) sync
;;
c ) clobber
;;
l ) clean
;;
b ) build
;;
u ) UPLOAD
;;
:) echo "Option -$OPTARG requires an argument."
help
exit
;;
*) echo $OPTARG is an unrecognized option;
help;
exit
;;
esac
done
done
shift
if [ $upload == "1" ]; then
time find . -name *aokp_\*unofficial*.zip -printf %p\\n -exec scp {} goo.im:public_html/testing/ \;
echo "refreshing goo.im index"; wget -q http://goo.im/update_index
rm update_*
echo "Build and upload Complete. Download from goo.im/devs/KAsp3rd"
fi