OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 # | 2 # |
3 # android_setup.sh: Sets environment variables used by other Android scripts. | 3 # android_setup.sh: Sets environment variables used by other Android scripts. |
4 | 4 |
5 # Fail-fast if anything in the script fails. | 5 # Fail-fast if anything in the script fails. |
6 set -e | 6 set -e |
7 | 7 |
8 BUILDTYPE=${BUILDTYPE-Debug} | 8 BUILDTYPE=${BUILDTYPE-Debug} |
9 | 9 |
10 while (( "$#" )); do | 10 while (( "$#" )); do |
11 if [[ "$1" == "-d" ]]; then | 11 if [[ "$1" == "-d" ]]; then |
12 DEVICE_ID=$2 | 12 DEVICE_ID=$2 |
13 shift | 13 shift |
14 elif [[ "$1" == "-i" || "$1" == "--resourcePath" ]]; then | 14 elif [[ "$1" == "-i" || "$1" == "--resourcePath" ]]; then |
15 RESOURCE_PATH=$2 | 15 RESOURCE_PATH=$2 |
16 APP_ARGS=("${APP_ARGS[@]}" "${1}" "${2}") | 16 APP_ARGS=("${APP_ARGS[@]}" "${1}" "${2}") |
17 shift | 17 shift |
18 elif [[ "$1" == "-s" ]]; then | 18 elif [[ "$1" == "-s" ]]; then |
19 DEVICE_SERIAL="-s $2" | 19 DEVICE_SERIAL="-s $2" |
20 shift | 20 shift |
21 elif [[ "$1" == "-t" ]]; then | 21 elif [[ "$1" == "-t" ]]; then |
22 BUILDTYPE=$2 | 22 BUILDTYPE=$2 |
23 shift | 23 shift |
24 elif [[ "$1" == "--release" ]]; then | 24 elif [[ "$1" == "--release" ]]; then |
25 BUILDTYPE=Release | 25 BUILDTYPE=Release |
| 26 elif [[ "$1" == "--clang" ]]; then |
| 27 USE_CLANG="true" |
26 else | 28 else |
27 APP_ARGS=("${APP_ARGS[@]}" "${1}") | 29 APP_ARGS=("${APP_ARGS[@]}" "${1}") |
28 fi | 30 fi |
29 shift | 31 shift |
30 done | 32 done |
31 | 33 |
32 function verbose { | 34 function verbose { |
33 if [[ -n $VERBOSE ]]; then | 35 if [[ -n $VERBOSE ]]; then |
34 echo $@ | 36 echo $@ |
35 fi | 37 fi |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 adb_push_if_needed $HOST_SRC $ANDROID_DST | 262 adb_push_if_needed $HOST_SRC $ANDROID_DST |
261 else | 263 else |
262 echo -n "$ANDROID_DST " | 264 echo -n "$ANDROID_DST " |
263 $ADB $DEVICE_SERIAL shell mkdir -p "$(dirname "$ANDROID_DST")" | 265 $ADB $DEVICE_SERIAL shell mkdir -p "$(dirname "$ANDROID_DST")" |
264 $ADB $DEVICE_SERIAL push $HOST_SRC $ANDROID_DST | 266 $ADB $DEVICE_SERIAL push $HOST_SRC $ANDROID_DST |
265 fi | 267 fi |
266 fi | 268 fi |
267 } | 269 } |
268 | 270 |
269 setup_device "${DEVICE_ID}" | 271 setup_device "${DEVICE_ID}" |
OLD | NEW |