/
aosip.sh
120 lines (116 loc) · 4.8 KB
/
aosip.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#/bin/bash
clear
echo -e '\e[104mBuild and Sync Script v0.9.6c for AOSiP\e[0m'
echo -e '\e[91mThis build still contains test code. Not for daily use. Devs and testers Only.\e[0m'
cd ~/build/aosip
PATH=~/bin:$PATH
echo -e '\e[96mHelper Bot just changed BIN Path to current folder to allow for Repo commands\e[0m'
# Create a main menu with actions
echo -e '\e[32mOffering choices to either Sync, Build or Quit\e[0m'
PS3='Please enter your choice: '
options=("Sync Repo" "Build AOSiP" "Auto Sync and Build" "Build from Lunch" "Initialize Repo" "Set Jack Server" "Quit")
select opt in "${options[@]}"
do
case $opt in
"Sync Repo")
echo -e '\e[104mYou chose to sync\e[0m'
sleep 1
echo -e '\e[32mStarting sync without using sync.sh\e[0m'
sleep 1
repo sync -c -f -j8 --force-sync --no-clone-bundle --no-tags
echo -e '\e[32mSync finished\e[0m'
# Edit version.mk to use SLOBS version instead of Derp
sed -i '20s/.*/AOSIP_BUILDTYPE ?= SLOBS/' /root/build/aosip/vendor/aosip/config/version.mk
;;
"Build AOSiP")
echo -e '\e[104mYou are about to build AOSiP\e[0m'
prebuilts/misc/linux-x86/ccache/ccache -M 100G
export CCACHE_DIR=/CCACHE
export USE_CCACHE=1
export CCACHE_COMPRESS=1
cd ~/build/aosip/prebuilts/sdk/tools cd ~/build/aosip/prebuilts/sdk/tools
./jack-admin stop-server
export JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx6g"
./jack-admin start-server
echo -e '\e[32mSet Jack Server to -Xmx6g\e[0m'
echo -e '\e[32mMarking start of build\e[0m'
sleep 1
source build/envsetup.sh
echo -e '\e[91mYou will now be asked for your device name. Enter it when prompted.\e[0m'
echo -e '\e[32mFor example you can enter\e[0m' '\e[91mangler\e[0m' '\e[32mif you want to build for the Huawei 6P\e[0m'
sleep 2
# devicename="USER INPUT"
read -p "Enter your device code name: " devicename
echo -e '\e[32mYou are going to build for' $devicename '\e[32mdevice model\e[0m'
echo -e '\e[32mStarting build\e[0m'
sleep 2
lunch aosip_$devicename-userdebug
time mka kronic
pause 1
exit
;;
"Auto Sync and Build")
echo -e '\e[104mStarting Full Auto Mode\e[0m'
echo -e '\e[91mYou will now be asked for your device name. Enter it when prompted.\e[0m'
echo -e '\e[32mFor example you can enter\e[0m' '\e[91mangler\e[0m' '\e[32mif you want to build for the Huawei 6P\e[0m'
sleep 1
# devicename="USER INPUT"
read -p "Enter your device code name: " devicename
echo -e '\e[32mYou are going to build for' $devicename '\e[32mdevice model\e[0m'
sleep 1
echo -e '\e[32mStarting sync without using sync.sh\e[0m'
sleep 1
repo sync -c -f -j8 --force-sync --no-clone-bundle --no-tags
echo -e '\e[32mSync finished\e[0m'
sleep 1
# Edit version.mk to use SLOBS version instead of Derp
sed -i '20s/.*/AOSIP_BUILDTYPE ?= SLOBS/' /root/build/aosip/vendor/aosip/config/version.mk
# Start AOSiP auto build here
echo -e '\e[32mStarting to build\e[0m'
prebuilts/misc/linux-x86/ccache/ccache -M 100G
export CCACHE_DIR=/CCACHE
export USE_CCACHE=1
export CCACHE_COMPRESS=1
source build/envsetup.sh
lunch aosip_$devicename-userdebug
echo -e '\e[32mGot ingredients for making Lunch. Time to cook\e[0m'
sleep 1
time mka kronic
echo -e '\e[32mIf build was successful then you should have a finished ROM in your OUT folder.\e[0m'
echo -e '\e[91mAuto Build will now exit.\e[0m'
exit
;;
"Build from Lunch")
echo -e '\e[104mYou are about to build AOSiP using the lunch menu\e[0m'
echo -e '\e[32mMarking start of build\e[0m'
sleep 1
source build/envsetup.sh
echo -e '\e[32mPerforming lunch and letting user choose from Menu\e[0m'
sleep 1
lunch
echo -e '\e[32mStarting build\e[0m'
sleep 1
time mka kronic
exit
;;
"Initialize Repo")
echo -e '\e[104mYou are about to Initialize AOSiP\e[0m'
sleep 1
echo -e '\e[91mPress any key to confirm you want to Initialize AOSiP\e[0m'
read -n 1 -s
echo -e '\e[32mSetting nougat-mr2 as your branch. You can not currently change this.\e[0m'
repo init -u ssh://git@github.com/AOSiP/platform_manifest.git -b nougat-mr2
echo -e '\e[32mRepo ready to go\e[0m'
continue
;;
"Set Jack Server")
export JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx6g"
echo -e '\e[32mSet Jack Server VM Argument to 6g\e[0m'
continue
;;
"Quit")
break
;;
*) echo invalid option;;
esac
done