| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 ############################################################################### | 2 ############################################################################### |
| 3 # Copyright 2015 Google Inc. | 3 # Copyright 2015 Google Inc. |
| 4 # | 4 # |
| 5 # Use of this source code is governed by a BSD-style license that can be | 5 # Use of this source code is governed by a BSD-style license that can be |
| 6 # found in the LICENSE file. | 6 # found in the LICENSE file. |
| 7 ############################################################################### | 7 ############################################################################### |
| 8 # | 8 # |
| 9 # android_setup.sh: Sets environment variables used by other Android scripts. | 9 # android_setup.sh: Sets environment variables used by other Android scripts. |
| 10 | 10 |
| 11 # Fail-fast if anything in the script fails. | 11 # Fail-fast if anything in the script fails. |
| 12 set -e | 12 set -e |
| 13 | 13 |
| 14 BUILDTYPE=${BUILDTYPE-Debug} | 14 BUILDTYPE=${BUILDTYPE-Release_Developer} |
| 15 USE_CLANG="true" | 15 USE_CLANG="true" |
| 16 | 16 |
| 17 while (( "$#" )); do | 17 while (( "$#" )); do |
| 18 if [[ "$1" == "-d" ]]; then | 18 if [[ "$1" == "-d" ]]; then |
| 19 DEVICE_ID=$2 | 19 DEVICE_ID=$2 |
| 20 shift | 20 shift |
| 21 elif [[ "$1" == "-i" || "$1" == "--resourcePath" ]]; then | 21 elif [[ "$1" == "-i" || "$1" == "--resourcePath" ]]; then |
| 22 RESOURCE_PATH=$2 | 22 RESOURCE_PATH=$2 |
| 23 APP_ARGS=("${APP_ARGS[@]}" "${1}" "${2}") | 23 APP_ARGS=("${APP_ARGS[@]}" "${1}" "${2}") |
| 24 shift | 24 shift |
| 25 elif [[ "$1" == "-s" ]]; then | 25 elif [[ "$1" == "-s" ]]; then |
| 26 DEVICE_SERIAL="-s $2" | 26 DEVICE_SERIAL="-s $2" |
| 27 shift | 27 shift |
| 28 elif [[ "$1" == "-t" ]]; then | 28 elif [[ "$1" == "-t" ]]; then |
| 29 BUILDTYPE=$2 | 29 BUILDTYPE=$2 |
| 30 shift | 30 shift |
| 31 elif [[ "$1" == "--debug" ]]; then |
| 32 BUILDTYPE=Debug |
| 31 elif [[ "$1" == "--release" ]]; then | 33 elif [[ "$1" == "--release" ]]; then |
| 32 BUILDTYPE=Release | 34 BUILDTYPE=Release |
| 33 elif [[ "$1" == "--gcc" ]]; then | 35 elif [[ "$1" == "--gcc" ]]; then |
| 34 USE_CLANG="false" | 36 USE_CLANG="false" |
| 35 elif [[ "$1" == "--clang" ]]; then | 37 elif [[ "$1" == "--clang" ]]; then |
| 36 USE_CLANG="true" | 38 USE_CLANG="true" |
| 37 elif [[ "$1" == "--logcat" ]]; then | 39 elif [[ "$1" == "--logcat" ]]; then |
| 38 LOGCAT=1 | 40 LOGCAT=1 |
| 39 elif [[ "$1" == "--verbose" ]]; then | 41 elif [[ "$1" == "--verbose" ]]; then |
| 40 VERBOSE="true" | 42 VERBOSE="true" |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 $ADB $DEVICE_SERIAL shell mkdir -p "$(dirname "$ANDROID_DST")" | 275 $ADB $DEVICE_SERIAL shell mkdir -p "$(dirname "$ANDROID_DST")" |
| 274 $ADB $DEVICE_SERIAL push $HOST_SRC $ANDROID_DST | 276 $ADB $DEVICE_SERIAL push $HOST_SRC $ANDROID_DST |
| 275 fi | 277 fi |
| 276 fi | 278 fi |
| 277 | 279 |
| 278 # turn error checking back on | 280 # turn error checking back on |
| 279 set -e | 281 set -e |
| 280 } | 282 } |
| 281 | 283 |
| 282 setup_device "${DEVICE_ID}" | 284 setup_device "${DEVICE_ID}" |
| OLD | NEW |