blob: 1e0c34e866ddbbd3313697c844530910f4fec3fa [file] [log] [blame]
Alexander Martinz0920b7b2022-04-07 18:05:45 +02001function __print_shift_functions_help() {
2cat <<EOF
3
4Additional ShiftOS functions:
5- build_gms_enable: Enables building with Google APPS (GMS)
6- build_gms_disable: Disables building with Google APPS (GMS)
7
8- build_disable_beta: Do not mark build as beta
9- build_enable_beta: Mark build as beta
10
11EOF
12}
13
14function build_gms_enable() {
15 export BUILD_GMS=true
16 export SHIFT_BUILD_WITH_GMS=true
17 export WITH_GMS=true
Alexander Martinz7a7ad752022-04-08 13:48:06 +020018 export WITH_GMS_MAINLINE=true
Alexander Martinz0920b7b2022-04-07 18:05:45 +020019}
20function build_gms_disable() {
21 export BUILD_GMS=false
22 export SHIFT_BUILD_WITH_GMS=false
23 export WITH_GMS=false
Alexander Martinz7a7ad752022-04-08 13:48:06 +020024 export WITH_GMS_MAINLINE=false
Alexander Martinz0920b7b2022-04-07 18:05:45 +020025}
26
27function build_disable_beta() {
28 export SHIFT_BUILD_IS_BETA=false
29}
30function build_enable_beta() {
31 export SHIFT_BUILD_IS_BETA=true
32}
33
Alexander Martinz74f0b6f2022-04-07 21:05:41 +020034# Check if PARTNER_GMS exists
35_PARTNER_GMS_EXISTING=$([ -d "vendor/partner_gms" ] && echo true || echo false)
Alexander Martinz7a7ad752022-04-08 13:48:06 +020036_PARTNER_MODULES_EXISTING=$([ -d "vendor/partner_modules" ] && echo true || echo false)
Alexander Martinz74f0b6f2022-04-07 21:05:41 +020037
Alexander Martinz0920b7b2022-04-07 18:05:45 +020038# set GMS property if not specified
Alexander Martinz74f0b6f2022-04-07 21:05:41 +020039: ${BUILD_GMS:=$_PARTNER_GMS_EXISTING}
40: ${SHIFT_BUILD_WITH_GMS:=$_PARTNER_GMS_EXISTING}
41: ${WITH_GMS:=$_PARTNER_GMS_EXISTING}
Alexander Martinz7a7ad752022-04-08 13:48:06 +020042: ${WITH_GMS_MAINLINE:=$_PARTNER_MODULES_EXISTING}
Alexander Martinz74f0b6f2022-04-07 21:05:41 +020043export BUILD_GMS
Alexander Martinz0920b7b2022-04-07 18:05:45 +020044export SHIFT_BUILD_WITH_GMS
Alexander Martinz74f0b6f2022-04-07 21:05:41 +020045export WITH_GMS
Alexander Martinz7a7ad752022-04-08 13:48:06 +020046export WITH_GMS_MAINLINE