Fix banchan for trunk stable builds
In the trunk stable builds, we're required to have a
TARGET_RELEASE set.
For now, we hard-code this to "trunk_staging" (and leave a TODO
to accept this as a function argument).
This will have us producing valid builds in places like git_main.
Bug: 307946156
Test: None
Change-Id: Ie418aee2fad192a38beca44cd7d168e0e1b45689
diff --git a/envsetup.sh b/envsetup.sh
index e5d4eb7..b3cf988 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -947,6 +947,8 @@
{
local showHelp="$(echo $* | xargs -n 1 echo | \grep -E '^(help)$' | xargs)"
local product="$(echo $* | xargs -n 1 echo | \grep -E '^(.*_)?(arm|x86|arm64|riscv64|x86_64|arm64only|x86_64only)$' | xargs)"
+ # TODO: Expand banchan to take release arguments (and update hmm() usage).
+ local release="trunk_staging"
local variant="$(echo $* | xargs -n 1 echo | \grep -E '^(user|userdebug|eng)$' | xargs)"
local apps="$(echo $* | xargs -n 1 echo | \grep -E -v '^(user|userdebug|eng|(.*_)?(arm|x86|arm64|riscv64|x86_64))$' | xargs)"
@@ -961,6 +963,10 @@
echo "banchan: Error: Multiple build archs or products supplied: $products"
return
fi
+ if [ $(echo $release | wc -w) -gt 1 ]; then
+ echo "banchan: Error: Multiple build releases supplied: $release"
+ return
+ fi
if [ $(echo $variant | wc -w) -gt 1 ]; then
echo "banchan: Error: Multiple build variants supplied: $variant"
return
@@ -984,6 +990,7 @@
fi
export TARGET_PRODUCT=$product
+ export TARGET_RELEASE=$release
export TARGET_BUILD_VARIANT=$variant
export TARGET_BUILD_DENSITY=alldpi
export TARGET_BUILD_TYPE=release