-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild_yaap
More file actions
executable file
·118 lines (96 loc) · 2.14 KB
/
Copy pathbuild_yaap
File metadata and controls
executable file
·118 lines (96 loc) · 2.14 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
113
114
115
116
117
118
#!/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
# YAAP directories
readonly ROM_NAME="yaap"
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_GAPPS=true
build_device=dumpling
build_type=user
#
# Build functions
#
define_gapps() {
if [[ $TARGET_BUILD_GAPPS == "true" ]]; then
gapps=y
else
gapps=n
fi
}
yaap_build() {
local target_device=$1
decho "Building YAAP: $target_device - $build_type"
cleanup_path
source build/envsetup.sh
export TARGET_BUILD_GAPPS
lunch yaap_$target_device-$build_type
m installclean
lunch yaap_$target_device-$build_type
m yaap -j$(nproc --all)
restore_path
define_gapps
rom_copy_and_clean "YAAP" $target_device $build_type
}
yaap_build_gms() {
TARGET_BUILD_GAPPS=true
yaap_build "$@"
}
yaap_build_vanilla() {
TARGET_BUILD_GAPPS=false
yaap_build "$@"
}
yaap_build_both() {
yaap_build_gms "$@"
# yaap_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
;;
-g|--google)
TARGET_BUILD_GAPPS=true
;;
-t|--type)
if check_valid "$2"; then
build_type="$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
yaap_build_both $device
done
exit_timestamp 0
fi
yaap_build $build_device
exit_timestamp 0