Add BUILD_PRE_S_APEX to conditionally generate pre-S apex.
Used in CI and BUILD_PRE_S_APEX passed in via command line arguments. default=false, to prevent presubmit run-time regression. Ignore-AOSP-First: Will cherrypick into AOSP once tm-mlp is done. BUG: 198437211 BUG: 235701311 Test: TH and local build. Change-Id: Iae29c0c7119ec2cfc641e346280bd60f861b8ae1
This commit is contained in:
@@ -110,12 +110,13 @@ function init() {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
declare -grx DIST_DIR="${dist_dir}"
|
DIST_DIR="${dist_dir}"
|
||||||
declare -grx TARGET_BUILD_APPS="${TARGET_BUILD_APPS:-${DEFAULT_MODULES[*]}}"
|
declare -grx TARGET_BUILD_APPS="${TARGET_BUILD_APPS:-${DEFAULT_MODULES[*]}}"
|
||||||
declare -grx TARGET_BUILD_DENSITY="${TARGET_BUILD_DENSITY:-alldpi}"
|
declare -grx TARGET_BUILD_DENSITY="${TARGET_BUILD_DENSITY:-alldpi}"
|
||||||
declare -grx TARGET_BUILD_TYPE="${TARGET_BUILD_TYPE:-release}"
|
declare -grx TARGET_BUILD_TYPE="${TARGET_BUILD_TYPE:-release}"
|
||||||
declare -grx TARGET_BUILD_VARIANT="${TARGET_BUILD_VARIANT:-user}"
|
declare -grx TARGET_BUILD_VARIANT="${TARGET_BUILD_VARIANT:-user}"
|
||||||
declare -grx TARGET_PRODUCT="${product}"
|
declare -grx TARGET_PRODUCT="${product}"
|
||||||
|
declare -grx BUILD_PRE_S_APEX="${BUILD_PRE_S_APEX:-false}"
|
||||||
|
|
||||||
# This script cannot handle compressed apexes
|
# This script cannot handle compressed apexes
|
||||||
declare -grx OVERRIDE_PRODUCT_COMPRESSED_APEX=false
|
declare -grx OVERRIDE_PRODUCT_COMPRESSED_APEX=false
|
||||||
@@ -125,6 +126,18 @@ function init() {
|
|||||||
# frameworks/base).
|
# frameworks/base).
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function build_modules() {
|
||||||
|
|
||||||
|
build/soong/soong_ui.bash --make-mode "$@" \
|
||||||
|
ALWAYS_EMBED_NOTICES=true \
|
||||||
|
MODULE_BUILD_FROM_SOURCE=true \
|
||||||
|
${extra_build_params} \
|
||||||
|
"${RUN_ERROR_PRONE:+"RUN_ERROR_PRONE=true"}" \
|
||||||
|
apps_only \
|
||||||
|
dist \
|
||||||
|
lint-check
|
||||||
|
}
|
||||||
|
|
||||||
function main() {
|
function main() {
|
||||||
if [ ! -e "build/make/core/Makefile" ]; then
|
if [ ! -e "build/make/core/Makefile" ]; then
|
||||||
echo "$0 must be run from the top of the Android source tree."
|
echo "$0 must be run from the top of the Android source tree."
|
||||||
@@ -135,13 +148,18 @@ function main() {
|
|||||||
# the buildbots.
|
# the buildbots.
|
||||||
build/soong/soong_ui.bash --make-mode installclean
|
build/soong/soong_ui.bash --make-mode installclean
|
||||||
|
|
||||||
build/soong/soong_ui.bash --make-mode "$@" \
|
DIST_DIR="${DIST_DIR}" build_modules
|
||||||
ALWAYS_EMBED_NOTICES=true \
|
|
||||||
MODULE_BUILD_FROM_SOURCE=true \
|
# TODO(b/198437211): remove unconditionally added APEX_BUILD_FOR_PRE_S_DEVICES
|
||||||
"${RUN_ERROR_PRONE:+"RUN_ERROR_PRONE=true"}" \
|
# below.
|
||||||
apps_only \
|
# Command line flag passed in would also build modules configured
|
||||||
dist \
|
# for PRE_S configuration. Disabled by default, this feature enables
|
||||||
lint-check
|
# building modules with statically linked libraries.
|
||||||
|
# https://goto.google.com/building-dynamic-common-apex-variants
|
||||||
|
# Artifacts are stored in a different dist_dir (*_pre_s)
|
||||||
|
if [[ "${BUILD_PRE_S_APEX}" == "true" ]]; then
|
||||||
|
DIST_DIR="${DIST_DIR}_pre_s" APEX_BUILD_FOR_PRE_S_DEVICES=true build_modules
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
init "$@"
|
init "$@"
|
||||||
|
|||||||
Reference in New Issue
Block a user