| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 | 2 |
| 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 set -e | 7 set -e |
| 8 | 8 |
| 9 # The script is to install Android SDK, NDK for build chromium on Android, and | 9 # The script is to install Android SDK, NDK for build chromium on Android, and |
| 10 # doesn't need to run as root. | 10 # doesn't need to run as root. |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 SDK_VER=$(sed '/^\#/d' ${ANDROID_SDK_ROOT}/tools/source.properties | \ | 111 SDK_VER=$(sed '/^\#/d' ${ANDROID_SDK_ROOT}/tools/source.properties | \ |
| 112 grep 'Pkg.Revision' |tail -n 1 | cut -d "=" -f2- | \ | 112 grep 'Pkg.Revision' |tail -n 1 | cut -d "=" -f2- | \ |
| 113 sed 's/^[[:space:]]*//;s/[[:space:]]*$//') | 113 sed 's/^[[:space:]]*//;s/[[:space:]]*$//') |
| 114 if [[ ${SDK_VER} -lt 17 ]]; then | 114 if [[ ${SDK_VER} -lt 17 ]]; then |
| 115 update_flag=" -o " | 115 update_flag=" -o " |
| 116 else | 116 else |
| 117 update_flag=" --all " | 117 update_flag=" --all " |
| 118 fi | 118 fi |
| 119 # Updates the SDK to latest version firstly. | 119 # Updates the SDK to latest version firstly. |
| 120 "${ANDROID_SDK_ROOT}"/tools/android update sdk ${update_flag} --no-ui \ | 120 "${ANDROID_SDK_ROOT}"/tools/android update sdk ${update_flag} --no-ui \ |
| 121 --filter platform,platform-tool,tool,system-image | 121 --filter platform-tool,tool,system-image,${SDK_TARGET_ID} |
| 122 fi | 122 fi |
| 123 | 123 |
| 124 # Create a Android Virtual Device named 'buildbot' with default hardware | 124 # Create a Android Virtual Device named 'buildbot' with default hardware |
| 125 # configuration and override the existing one, since there is no easy way to | 125 # configuration and override the existing one, since there is no easy way to |
| 126 # check whether current AVD has correct configuration and it takes almost no | 126 # check whether current AVD has correct configuration and it takes almost no |
| 127 # time to create a new one. | 127 # time to create a new one. |
| 128 "${ANDROID_SDK_ROOT}/tools/android" --silent create avd --name buildbot \ | 128 "${ANDROID_SDK_ROOT}/tools/android" --silent create avd --name buildbot \ |
| 129 --target ${SDK_TARGET_ID} --force <<< "no" | 129 --target ${SDK_TARGET_ID} --force <<< "no" |
| 130 | 130 |
| 131 # Install Android NDK if it doesn't exist. | 131 # Install Android NDK if it doesn't exist. |
| (...skipping 30 matching lines...) Expand all Loading... |
| 162 if [[ ! -f "$linker_dirname/$NEW_LINKER" ]]; then | 162 if [[ ! -f "$linker_dirname/$NEW_LINKER" ]]; then |
| 163 echo "Could not copy linker" | 163 echo "Could not copy linker" |
| 164 exit 1 | 164 exit 1 |
| 165 fi | 165 fi |
| 166 fi | 166 fi |
| 167 fi | 167 fi |
| 168 } | 168 } |
| 169 | 169 |
| 170 replace_linker $LINKER_DIRNAME_1 $LINKER_BASENAME_1 | 170 replace_linker $LINKER_DIRNAME_1 $LINKER_BASENAME_1 |
| 171 replace_linker $LINKER_DIRNAME_2 $LINKER_BASENAME_2 | 171 replace_linker $LINKER_DIRNAME_2 $LINKER_BASENAME_2 |
| OLD | NEW |