From a61ba109bf1a60c6de8f9ebea043e782497b88cc Mon Sep 17 00:00:00 2001 From: "djsollen@google.com" Date: Tue, 20 Aug 2013 12:22:57 +0000 Subject: [PATCH] default to device type of last build if no device type is given R=borenet@google.com Review URL: https://codereview.chromium.org/22929006 git-svn-id: http://skia.googlecode.com/svn/trunk@10807 2bbb7eff-a529-9590-31e7-b0007b416f81 --- platform_tools/android/bin/android_install_apk | 2 +- platform_tools/android/bin/android_make | 16 +++++++++++++--- platform_tools/android/bin/android_setup.sh | 9 +++++++-- platform_tools/android/bin/utils/setup_skia_out.sh | 22 ---------------------- 4 files changed, 21 insertions(+), 28 deletions(-) delete mode 100644 platform_tools/android/bin/utils/setup_skia_out.sh diff --git a/platform_tools/android/bin/android_install_apk b/platform_tools/android/bin/android_install_apk index ac162a1..039acbb 100755 --- a/platform_tools/android/bin/android_install_apk +++ b/platform_tools/android/bin/android_install_apk @@ -13,8 +13,8 @@ function print_usage { SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +source $SCRIPT_DIR/android_setup.sh source $SCRIPT_DIR/utils/setup_adb.sh -source $SCRIPT_DIR/utils/setup_skia_out.sh forceRemoval="false" installLauncher="false" diff --git a/platform_tools/android/bin/android_make b/platform_tools/android/bin/android_make index ad52d67..10ddd33 100755 --- a/platform_tools/android/bin/android_make +++ b/platform_tools/android/bin/android_make @@ -1,8 +1,21 @@ #!/bin/bash SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +# remove the existing .android_config file prior to running android_setup. If +# we did not remove this here then we would build for whatever device type was +# listed in the .android_config instead of the default device type. +if [ -f .android_config ] +then + rm .android_config +fi + +# run the config to setup the environment source $SCRIPT_DIR/android_setup.sh +# write the device id into the .android_config file +echo $DEVICE_ID > .android_config + for arg in ${APP_ARGS[@]} do if [[ "${arg}" == "--use-ccache" ]]; @@ -26,9 +39,6 @@ if [[ -n "$ANDROID_MAKE_CCACHE" ]]; then fi fi -# write the out directory into the .android_config file -echo $SKIA_OUT > .android_config - make ${makeVars[@]} if [ $? != 0 ] then diff --git a/platform_tools/android/bin/android_setup.sh b/platform_tools/android/bin/android_setup.sh index fc3b669..5631e8e 100755 --- a/platform_tools/android/bin/android_setup.sh +++ b/platform_tools/android/bin/android_setup.sh @@ -161,8 +161,13 @@ setup_device() { TARGET_DEVICE="$1" if [ -z "$TARGET_DEVICE" ]; then - echo "INFO: no target device type was specified so using the default 'arm_v7'" - TARGET_DEVICE="arm_v7" + if [ -f .android_config ]; then + TARGET_DEVICE=$(cat .android_config) + echo "INFO: no target device was specified so using the device (${TARGET_DEVICE}) from the most recent build" + else + TARGET_DEVICE="arm_v7" + echo "INFO: no target device type was specified so using the default '${TARGET_DEVICE}'" + fi fi case $TARGET_DEVICE in diff --git a/platform_tools/android/bin/utils/setup_skia_out.sh b/platform_tools/android/bin/utils/setup_skia_out.sh deleted file mode 100644 index 78375a5..0000000 --- a/platform_tools/android/bin/utils/setup_skia_out.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -# - -UTIL_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -if [ -z "$SKIA_OUT" ] -then - - if [ ! -f .android_config ] - then - echo "Unable to find the .android_config file" - exit 1; - fi - - export SKIA_OUT=$(cat .android_config) - - if [ ! -d ${SKIA_OUT} ] - then - echo "The contents of .android_config are invalid" - exit 1; - fi -fi \ No newline at end of file -- 2.7.4