-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild_rising
More file actions
executable file
·118 lines (97 loc) · 2.33 KB
/
Copy pathbuild_rising
File metadata and controls
executable file
·118 lines (97 loc) · 2.33 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
# Rising directories
readonly ROM_NAME="rising"
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
WITH_GMS=false
build_device=dumpling
build_type=user
build_cmd=b
#
# Build functions
#
rising_build() {
local target_device=$1
decho "Building RisingOS: $target_device - $build_type WITH_GMS=$WITH_GMS"
cleanup_path
source build/envsetup.sh
export WITH_GMS
riseup $target_device $build_type
m installclean
riseup $target_device $build_type
rise $build_cmd -j$(nproc --all)
restore_path
rom_copy_and_clean "Rising" $target_device $build_type
}
rising_build_gms() {
WITH_GMS=true
rising_build "$@"
}
rising_build_vanilla() {
WITH_GMS=false
rising_build "$@"
}
rising_build_both() {
rising_build_gms "$@"
rising_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
;;
-g|--google)
WITH_GMS=true
;;
-a|--all)
build_all=y
;;
-s|--sign)
keysdir="$ROM_DIR/vendor/lineage-priv/keys/"
if [[ ! -z $(ls $keysdir | grep -i com.android) ]]; then
build_cmd=sb
else
decho "No apex keys found, will not sign apex."
fi
;;
esac
shift
done
}
#
# Build start
#
param_func "$@"
if [[ $build_all == "y" ]]; then
for device in ${devices_list[@]}; do
rising_build_both $device
done
exit_timestamp 0
fi
rising_build $build_device
exit_timestamp 0