forked from AdrianDC/advanced_development_shell_tools
/
android_google.rc
executable file
·65 lines (58 loc) · 1.68 KB
/
android_google.rc
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
#!/bin/bash
# ======================================
# Developed by Adrian DC - 2015-2016
# ======================================
# === Bash AOSP Sources ===
source $bash_android_dir/android_google_aospm.rc;
source $bash_android_dir/android_google_aospn.rc;
source $bash_android_dir/android_cyanogenmod_14.rc;
# === AOSP Syncer ===
function aospsync()
{
# Android Selection
case $1 in
m)
# Android 6.0.1
repo init -u https://android.googlesource.com/platform/manifest -b android-6.0.1_r63;
repo sync -j$(grep -c ^processor /proc/cpuinfo) --current-branch \
--detach -f --force-broken --force-sync -c --no-clone-bundle --no-tags;;
n)
# Android 7.0.0
repo init -u https://android.googlesource.com/platform/manifest -b android-7.0.0_r6;
repo sync -j$(grep -c ^processor /proc/cpuinfo) --current-branch \
--detach -f --force-broken --force-sync -c --no-clone-bundle --no-tags;;
*)
# No selection
echo '';
echo ' Usage: aospsync [m/n]'
echo '';;
esac;
}
# === AOSP Builder ===
function aospbuild()
{
# ROM variables
local rom_device="$1";
local rom_params="$2";
if [[ "$1" == 'init' ]]; then
rom_device='huashan';
rom_params='nobuild';
fi;
# CPU handling
if [[ "$rom_params" =~ "j1" ]]; then
build_cpu_count=1;
else
build_cpu_count=$(grep -c ^processor /proc/cpuinfo);
fi;
# Compilation preparation
source ./build/envsetup.sh;
lunch aosp_huashan-eng;
#lunch aosp_huashan-userdebug;
# Compilation start
if [[ ! "$rom_params" =~ "nobuild" ]]; then
#make -j$build_cpu_count;
make -j$build_cpu_count otapackage;
# Final notification
pushbrom 'huashan';
fi;
}