From 5069bd6bfa49c0f978ed47d44e0439b15b74cef5 Mon Sep 17 00:00:00 2001 From: Jeff Hamilton Date: Thu, 4 Sep 2014 21:28:00 -0700 Subject: [PATCH] Add a density axis to tapas. It allows overriding the density the app is built for. Currently only used in the GMS core APK's gradle file. Change-Id: I3606df313a3110208cd8e6acade5f558261c921f (cherry picked from commit 7e3d2341570681e566872216796dc4f79c8695ef) --- envsetup.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/envsetup.sh b/envsetup.sh index a9bd707c0..f4c65664c 100644 --- a/envsetup.sh +++ b/envsetup.sh @@ -570,7 +570,8 @@ function tapas() { local arch="$(echo $* | xargs -n 1 echo | \grep -E '^(arm|x86|mips|armv5|arm64|x86_64|mips64)$' | xargs)" 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|mips|armv5|arm64|x86_64|mips64)$' | xargs)" + local density="$(echo $* | xargs -n 1 echo | \grep -E '^(ldpi|mdpi|tvdpi|hdpi|xhdpi|xxhdpi|xxxhdpi|alldpi)$' | xargs)" + local apps="$(echo $* | xargs -n 1 echo | \grep -E -v '^(user|userdebug|eng|arm|x86|mips|armv5|arm64|x86_64|mips64|ldpi|mdpi|tvdpi|hdpi|xhdpi|xxhdpi|xxxhdpi|alldpi)$' | xargs)" if [ $(echo $arch | wc -w) -gt 1 ]; then echo "tapas: Error: Multiple build archs supplied: $arch" @@ -580,6 +581,10 @@ function tapas() echo "tapas: Error: Multiple build variants supplied: $variant" return fi + if [ $(echo $density | wc -w) -gt 1 ]; then + echo "tapas: Error: Multiple densities supplied: $density" + return + fi local product=full case $arch in @@ -599,6 +604,7 @@ function tapas() export TARGET_PRODUCT=$product export TARGET_BUILD_VARIANT=$variant + export TARGET_BUILD_DENSITY=$density export TARGET_BUILD_TYPE=release export TARGET_BUILD_APPS=$apps -- 2.11.0