Skip to content

Commit 2b8d923

Browse files
committed
Allow selecting a different product in banchan.
Necessary since the products used for APEX modules are different in internal builds. Test: banchan com.android.art Test: banchan com.android.art arm Test: banchan com.android.art art_module_arm Test: banchan com.android.art module_arm Test: banchan com.android.art x86_64 Test: banchan com.android.art art_module_x86_64 Bug: 179779520 Change-Id: Ib59a86b70e409537aaad7258465b6874b589b858
1 parent 2c80511 commit 2b8d923

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

Diff for: banchanHelp.sh

+6-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ SCRIPT_DIR="${PWD}"
66
cd ../..
77
TOP="${PWD}"
88

9-
message='usage: banchan <module> ... [arm|x86|arm64|x86_64] [eng|userdebug|user]
9+
message='usage: banchan <module> ... [<product>|arm|x86|arm64|x86_64] [eng|userdebug|user]
1010
1111
banchan selects individual APEX modules to be built by the Android build system.
1212
Like "tapas", "banchan" does not request the building of images for a device but
@@ -19,6 +19,11 @@ for building APEX modules rather than apps (APKs).
1919
The module names should match apex{} modules in Android.bp files, typically
2020
starting with "com.android.".
2121
22+
The product argument should be a product name ending in "_<arch>", where <arch>
23+
is one of arm, x86, arm64, x86_64. It can also be just an arch, in which case
24+
the standard product for building modules with that architecture is used, i.e.
25+
module_<arch>.
26+
2227
The usage of the other arguments matches that of the rest of the platform
2328
build system and can be found by running `m help`'
2429

Diff for: envsetup.sh

+8-6
Original file line numberDiff line numberDiff line change
@@ -799,17 +799,19 @@ function tapas()
799799
function banchan()
800800
{
801801
local showHelp="$(echo $* | xargs -n 1 echo | \grep -E '^(help)$' | xargs)"
802-
local arch="$(echo $* | xargs -n 1 echo | \grep -E '^(arm|x86|arm64|x86_64)$' | xargs)"
802+
local product="$(echo $* | xargs -n 1 echo | \grep -E '^(.*_)?(arm|x86|arm64|x86_64)$' | xargs)"
803803
local variant="$(echo $* | xargs -n 1 echo | \grep -E '^(user|userdebug|eng)$' | xargs)"
804-
local apps="$(echo $* | xargs -n 1 echo | \grep -E -v '^(user|userdebug|eng|arm|x86|arm64|x86_64)$' | xargs)"
804+
local apps="$(echo $* | xargs -n 1 echo | \grep -E -v '^(user|userdebug|eng|(.*_)?(arm|x86|arm64|x86_64))$' | xargs)"
805805

806806
if [ "$showHelp" != "" ]; then
807807
$(gettop)/build/make/banchanHelp.sh
808808
return
809809
fi
810810

811-
if [ $(echo $arch | wc -w) -gt 1 ]; then
812-
echo "banchan: Error: Multiple build archs supplied: $arch"
811+
if [ -z "$product" ]; then
812+
product=arm
813+
elif [ $(echo $product | wc -w) -gt 1 ]; then
814+
echo "banchan: Error: Multiple build archs or products supplied: $products"
813815
return
814816
fi
815817
if [ $(echo $variant | wc -w) -gt 1 ]; then
@@ -821,8 +823,8 @@ function banchan()
821823
return
822824
fi
823825

824-
local product=module_arm
825-
case $arch in
826+
case $product in
827+
arm) product=module_arm;;
826828
x86) product=module_x86;;
827829
arm64) product=module_arm64;;
828830
x86_64) product=module_x86_64;;

0 commit comments

Comments
 (0)