forked from teamgummy/hudsonGummy
-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.sh
executable file
·90 lines (75 loc) · 1.68 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
83
84
85
86
87
88
89
90
#!/usr/bin/env bash
function check_result {
if [ "0" -ne "$?" ]
then
echo $1
exit 1
fi
}
if [ -z "$WORKSPACE" ]
then
echo WORKSPACE not specified
exit 1
fi
if [ -z "$REPO_BRANCH" ]
then
echo REPO_BRANCH not specified
exit 1
fi
if [ -z "$LUNCH" ]
then
echo LUNCH not specified
exit 1
fi
export PATH=~/bin:$PATH
. ~/.profile
# colorization fix in Jenkins
export CL_PFX="\"\033[34m\""
export CL_INS="\"\033[32m\""
export CL_RST="\"\033[0m\""
cd $WORKSPACE
rm -rf archive
mkdir -p archive
export BUILD_NO=$BUILD_NUMBER
unset BUILD_NUMBER
export USE_CCACHE=1
export CCACHE_NLEVELS=4
export CCACHE_SLOPPINESS=file_macro
export BUILD_WITH_COLORS=0
# make sure ccache is in PATH
export PATH="$PATH:/opt/local/bin/:$PWD/prebuilts/misc/$(uname|awk '{print tolower($0)}')-x86/ccache"
REPO=$(which repo)
if [ -z "$REPO" ]
then
mkdir -p ~/bin
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
chmod a+x ~/bin/repo
fi
if [ ! -d $REPO_BRANCH ]
then
mkdir $REPO_BRANCH
if [ ! -z "$BOOTSTRAP" -a -d "$BOOTSTRAP" ]
then
echo Bootstrapping repo with: $BOOTSTRAP
cp -R $BOOTSTRAP/.repo $REPO_BRANCH
fi
cd $REPO_BRANCH
repo init -u https://github.com/CarbonDev/android.git -b $REPO_BRANCH
else
cd $REPO_BRANCH
# temp hack for turl
repo init -u https://github.com/CarbonDev/android.git -b $REPO_BRANCH
fi
## TEMPORARY: Some kernels are building _into_ the source tree and messing
## up posterior syncs due to changes
rm -rf kernel/*
echo Syncing...
rm -f .repo/local_manifests/*
rm -rf device/*
rm -rf vendor/samsung
rm -rf vendor/motorola
rm -rf vendor/lge
rm -rf vendor/asus
repo sync -j16 -f
check_result repo sync failed.
echo Sync complete.