forked from AndroidOpenSourceXperia/android_scripts
-
Notifications
You must be signed in to change notification settings - Fork 8
/
CompileROM.sh
executable file
·50 lines (50 loc) · 1.18 KB
/
CompileROM.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
#Get prebuilts
echo "Getting prebuilts..."
cd vendor/cm && ./get-prebuilts && cd ../..
#Compile
if [[ $# = 1 ]]; then
. build/envsetup.sh
if [[ $? = 0 ]]; then
# Use local Java Development Kit 6
if (( $(java -version 2>&1 | grep version | cut -f2 -d".") > 6 )); then
echo "Using local JDK 6..."
export JAVA_HOME=$(realpath ../jdk1.6.0_45);
fi
case $1 in
-u)
lunch cm_kumquat-eng && make -j8 otapackage;
;;
-ru)
lunch cm_kumquat-userdebug && make -j8 otapackage;
;;
-p)
lunch cm_nypon-eng && make -j8 otapackage;
;;
-rp)
lunch cm_nypon-userdebug && make -j8 otapackage;
;;
-s)
lunch cm_pepper-eng && make -j8 otapackage;
;;
-rs)
lunch cm_pepper-userdebug && make -j8 otapackage;
;;
-g)
lunch cm_lotus-eng && make -j8 otapackage;
;;
-rg)
lunch cm_lotus-userdebug && make -j8 otapackage;
;;
*)
echo "ERROR: Unknow option";
exit -1;
;;
esac
else
echo "ERROR: . build/envsetup.sh falied"
exit -1;
fi
else
echo "ERROR: Number of options not correct. Usage: ./CompileROM.sh -u | -p | -s | -g | -ru | -rp | -rs | -rg"
exit -1;
fi