envsetup.sh: Use prebuilt emulator binaries if available.

This patch changes the setpaths() function in envsetup.sh to probe
for prebuilts/android-emulator/<host>/, and prepend it to PATH if
it exists.

See https://android-review.googlesource.com/#/c/93399/
for a related patch that adds the binaries.

BUG=13747402

Change-Id: I30794ea52f6dfc58908e6271f2c0da8e2f0b68e8
This commit is contained in:
David 'Digit' Turner 2014-05-05 16:13:50 +02:00
parent afe444a564
commit 94d16e5a0f
1 changed files with 19 additions and 0 deletions

View File

@ -171,6 +171,25 @@ function setpaths()
export ANDROID_QTOOLS=$T/development/emulator/qtools export ANDROID_QTOOLS=$T/development/emulator/qtools
export ANDROID_DEV_SCRIPTS=$T/development/scripts:$T/prebuilts/devtools/tools export ANDROID_DEV_SCRIPTS=$T/development/scripts:$T/prebuilts/devtools/tools
export ANDROID_BUILD_PATHS=$(get_build_var ANDROID_BUILD_PATHS):$ANDROID_QTOOLS:$ANDROID_TOOLCHAIN:$ANDROID_KERNEL_TOOLCHAIN_PATH$ANDROID_DEV_SCRIPTS: export ANDROID_BUILD_PATHS=$(get_build_var ANDROID_BUILD_PATHS):$ANDROID_QTOOLS:$ANDROID_TOOLCHAIN:$ANDROID_KERNEL_TOOLCHAIN_PATH$ANDROID_DEV_SCRIPTS:
# If prebuilts/android-emulator/<system>/ exists, prepend it to our PATH
# to ensure that the corresponding 'emulator' binaries are used.
case $(uname -s) in
Darwin)
ANDROID_EMULATOR_PREBUILTS=$T/prebuilts/android-emulator/darwin-x86_64
;;
Linux)
ANDROID_EMULATOR_PREBUILTS=$T/prebuilts/android-emulator/linux-x86_64
;;
*)
ANDROID_EMULATOR_PREBUILTS=
;;
esac
if [ -n "$ANDROID_EMULATOR_PREBUILTS" -a -d "$ANDROID_EMULATOR_PREBUILTS" ]; then
ANDROID_BUILD_PATHS=$ANDROID_EMULATOR_PREBUILTS:$ANDROID_BUILD_PATHS
export ANDROID_EMULATOR_PREBUILTS
fi
export PATH=$ANDROID_BUILD_PATHS$PATH export PATH=$ANDROID_BUILD_PATHS$PATH
unset ANDROID_JAVA_TOOLCHAIN unset ANDROID_JAVA_TOOLCHAIN