-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild_infinity
More file actions
executable file
·109 lines (88 loc) · 2.05 KB
/
build_infinity
File metadata and controls
executable file
·109 lines (88 loc) · 2.05 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
#!/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
# Infinity directories
readonly ROM_NAME="infinity"
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
build_device=dumpling
build_type=user
WITH_GAPPS=true
#
# Build functions
#
infinity_build() {
local target_device=$1
decho "Building Infinity: $target_device - $build_type"
cleanup_path
export WITH_GAPPS
source build/envsetup.sh
lunch infinity_$target_device-$build_type
m installclean
lunch infinity_$target_device-$build_type
mka bacon -j$(nproc --all)
restore_path
rom_copy_and_clean "Project_Infinity" $target_device $build_type
}
infinity_build_gms() {
WITH_GAPPS=true
infinity_build "$@"
}
infinity_build_vanilla() {
WITH_GAPPS=false
infinity_build "$@"
}
infinity_build_both() {
infinity_build_gms "$@"
# infinity_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
;;
-v|--vanilla)
WITH_GAPPS=false
;;
-a|--all)
build_all=y
;;
esac
shift
done
}
#
# Build start
#
param_func "$@"
if [[ $build_all == "y" ]]; then
for device in ${devices_list[@]}; do
infinity_build_both $device
done
exit_timestamp 0
fi
infinity_build $build_device
exit_timestamp 0