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 # Parse the arguments for a DEVICE_ID. | 5 # Parse the arguments for a DEVICE_ID. |
6 DEVICE_ID="" | 6 DEVICE_ID="" |
7 DEVICE_SERIAL="" | 7 DEVICE_SERIAL="" |
8 while (( "$#" )); do | 8 while (( "$#" )); do |
9 if [[ $(echo "$1" | grep "^-d$") != "" ]]; | 9 if [[ $(echo "$1" | grep "^-d$") != "" ]]; |
10 then | 10 then |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 if [ -z "$ANDROID_TOOL" ]; then | 47 if [ -z "$ANDROID_TOOL" ]; then |
48 echo "ERROR: Please define ANDROID_SDK_ROOT in your environment to point" | 48 echo "ERROR: Please define ANDROID_SDK_ROOT in your environment to point" |
49 echo " to a valid Android SDK installation." | 49 echo " to a valid Android SDK installation." |
50 exit 1 | 50 exit 1 |
51 fi | 51 fi |
52 ANDROID_SDK_ROOT=$(cd $(dirname "$ANDROID_TOOL")/.. && pwd) | 52 ANDROID_SDK_ROOT=$(cd $(dirname "$ANDROID_TOOL")/.. && pwd) |
53 exportVar ANDROID_SDK_ROOT "$ANDROID_SDK_ROOT" | 53 exportVar ANDROID_SDK_ROOT "$ANDROID_SDK_ROOT" |
54 fi | 54 fi |
55 | 55 |
56 # ant is required to be installed on your system and in your PATH | 56 # ant is required to be installed on your system and in your PATH |
57 ant -version &> /dev/null | 57 which ant &> /dev/null |
58 if [[ "$?" != "0" ]]; then | 58 if [[ "$?" != "0" ]]; then |
59 echo "ERROR: Unable to find ant. Please install it before proceeding." | 59 echo "ERROR: Unable to find ant. Please install it before proceeding." |
60 exit 1 | 60 exit 1 |
61 fi | 61 fi |
62 | 62 |
63 # check to see that gclient sync ran successfully | 63 # check to see that gclient sync ran successfully |
64 THIRD_PARTY_EXTERNAL_DIR=${SCRIPT_DIR}/../third_party/externals | 64 THIRD_PARTY_EXTERNAL_DIR=${SCRIPT_DIR}/../third_party/externals |
65 if [ ! -d "$THIRD_PARTY_EXTERNAL_DIR" ]; then | 65 if [ ! -d "$THIRD_PARTY_EXTERNAL_DIR" ]; then |
66 echo "" | 66 echo "" |
67 echo "ERROR: Unable to find the required third_party dependencies needed
to build." | 67 echo "ERROR: Unable to find the required third_party dependencies needed
to build." |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 else | 330 else |
331 $ADB $DEVICE_SERIAL push $HOST_SRC $ANDROID_DST | 331 $ADB $DEVICE_SERIAL push $HOST_SRC $ANDROID_DST |
332 fi | 332 fi |
333 } | 333 } |
334 | 334 |
335 # Set up the device. | 335 # Set up the device. |
336 setup_device "${DEVICE_ID}" | 336 setup_device "${DEVICE_ID}" |
337 if [[ "$?" != "0" ]]; then | 337 if [[ "$?" != "0" ]]; then |
338 exit 1 | 338 exit 1 |
339 fi | 339 fi |
OLD | NEW |