-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild_alpha
More file actions
executable file
·112 lines (91 loc) · 2.16 KB
/
Copy pathbuild_alpha
File metadata and controls
executable file
·112 lines (91 loc) · 2.16 KB
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
#!/bin/bash
# SPDX-FileCopyrightText: 2024 Edrick Sinsuan
# SPDX-License-Identifier: Apache-2.0
script_dir=$(dirname $0)
if ! check_file "$script_dir/setup_env"; then
decho "setup_env must be present in $script_dir!"
exit_timestamp 1
fi
source $script_dir/setup_env
build_init
# Alpha directories
readonly ROM_NAME="alpha"
readonly ROM_DIR="$(pwd)"
if [[ -z $(echo $ROM_DIR | grep -i $ROM_NAME | grep -vi "${ROM_NAME}/") ]]; then
decho "You are not in the right directory."
exit_timestamp 1
fi
# Default properties
TARGET_BUILD_PACKAGE=3
build_device=dumpling
build_type=user
#
# Build functions
#
alpha_build() {
local target_device=$1
decho "Building AlphaDroid: $target_device - $build_type TARGET_BUILD_PACKAGE=$TARGET_BUILD_PACKAGE"
cleanup_path
source build/envsetup.sh
export TARGET_BUILD_PACKAGE
lunch alpha_$target_device-$build_type
m installclean
lunch alpha_$target_device-$build_type
make bacon -j$(nproc --all)
restore_path
rom_copy_and_clean "Alpha" $target_device $build_type
}
alpha_build_gms() {
TARGET_BUILD_PACKAGE=3
alpha_build "$@"
}
alpha_build_vanilla() {
TARGET_BUILD_PACKAGE=1
alpha_build "$@"
}
alpha_build_both() {
alpha_build_gms "$@"
alpha_build_vanilla "$@"
}
param_func() {
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
-d|--device)
if check_valid "$2"; then
build_device="$2"
shift
fi
;;
-t|--type)
if check_valid "$2"; then
build_type="$2"
shift
fi
;;
-b|--build)
if check_valid "$2"; then
TARGET_BUILD_PACKAGE="$2"
shift
fi
;;
-a|--all)
build_all=y
;;
esac
shift
done
}
#
# Build start
#
param_func "$@"
if [[ $build_all == "y" ]]; then
for device in ${devices_list[@]}; do
alpha_build_both $device
done
exit_timestamp 0
fi
alpha_build $build_device
exit_timestamp 0