forked from CyanogenMod/hudson
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdobuild
46 lines (40 loc) · 982 Bytes
/
dobuild
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
#!/bin/bash
#Cleanup
rm -f $WORKSPACE/*.zip $WORKSPACE/*.img
rm -f $OUT/cm*.zip*
#Setup
OUT=out/target/product/apexqtmo
cd vendor/cm
./get-prebuilts
cd ../..
#CCACHE
export PATH="$PATH:/opt/local/bin/:$PWD/prebuilts/misc/$(uname|awk '{print tolower($0)}')-x86/ccache"
export USE_CCACHE=1
export CCACHE_DIR=~/.kk_ccache
if [ ! "$(ccache -s|grep -E 'max cache size'|awk '{print $4}')" = "15.0" ]
then
ccache -M 15G
fi
#Build
. ./build/envsetup.sh
if [ $CLEAN = "true" ]; then make clean; fi
brunch apexqtmo
if [ "0" -ne "$?" ]; then exit 1; fi
#Archive
if [ ! -d $WORKSPACE/archive ]; then mkdir $WORKSPACE/archive; fi
for f in $(ls $OUT/cm-*.zip*)
do
targetf=`basename $f | sed "s/.zip$/-${BUILD_NO}.zip/g"`
ln $f $WORKSPACE/archive/$targetf
done
if [ -f $OUT/boot.img ]
then
cp $OUT/boot.img $WORKSPACE/archive
fi
if [ -f $OUT/recovery.img ]
then
cp $OUT/recovery.img $WORKSPACE/archive
fi
#Verify permissions
chmod -R ugo+r $WORKSPACE/*.zip
chmod -R ugo+r $WORKSPACE/*.img