From 6d21add3c877a3c590a08f05e4696b75c3029fa6 Mon Sep 17 00:00:00 2001 From: Tanuj Tekriwal Date: Tue, 17 Sep 2024 13:31:04 +0000 Subject: [PATCH] CI builder TARGET_RELEASE agnostic lunch support This patch will support CI builder to perform lunch without depending on the TARGET_RELEASE version of the underlying AOSP code. It will allow CI builder to provide lunch as target-variant and output will be target-release-variant sent to AOSP build system. Tests Done: source and lunch target-variant Tracked-On: OAM-124766 Signed-off-by: Tanuj Tekriwal --- vendorsetup.sh | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/vendorsetup.sh b/vendorsetup.sh index 51f9c94771..aea68585f7 100755 --- a/vendorsetup.sh +++ b/vendorsetup.sh @@ -11,7 +11,6 @@ tmp_lunch=`mktemp` sed '/ lunch()/,/^}/!d' build/envsetup.sh | sed 's/function lunch/function aosp_lunch/' > ${tmp_lunch} source ${tmp_lunch} rm -f ${tmp_lunch} - # Override lunch function to filter lunch targets function lunch { @@ -20,8 +19,30 @@ function lunch echo "[lunch] Couldn't locate the top of the tree. Try setting TOP." >&2 return fi + local answer=' ' + # Set the TARGET_RELEASE variable to the release_config for + # which we want to build CELADON. It should be one among + # $(TOP)/build/release/release_configs/* + # When updating TARGET_RELEASE value here please change in + # "function _get_build_var_cached" below too. + TARGET_RELEASE=ap3a + if [ "$1" ]; then + local valid_targets=`mixinup -t` + local count=`echo "$1" | grep -o "-" | wc -l` + if [ "${count}" -eq 1 ]; then + local array=(${1/-/ }) + local target=${array[0]} + if [[ "${valid_targets}" =~ "${target}" ]]; then + answer=${target}-$TARGET_RELEASE-${array[1]} + else + answer=$1 + fi + else + answer=$1 + fi + fi - aosp_lunch $* + aosp_lunch $answer rm -rf vendor/intel/utils/Android.mk vendor/intel/utils_priv/Android.mk vendor/intel/utils/autopatch.sh