OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 | 2 |
3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2011 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 | 95 |
96 # Install the target if it doesn't exist. The package installed above contains | 96 # Install the target if it doesn't exist. The package installed above contains |
97 # no platform, platform-tool or tool, all those should be installed by | 97 # no platform, platform-tool or tool, all those should be installed by |
98 # ${ANDROID_SDK_ROOT}/tools/android. | 98 # ${ANDROID_SDK_ROOT}/tools/android. |
99 if [[ ! $("${ANDROID_SDK_ROOT}/tools/android" list targets \ | 99 if [[ ! $("${ANDROID_SDK_ROOT}/tools/android" list targets \ |
100 | grep -q "${SDK_TARGET_ID}") ]]; then | 100 | grep -q "${SDK_TARGET_ID}") ]]; then |
101 # Updates the SDK by installing the necessary components. | 101 # Updates the SDK by installing the necessary components. |
102 # From current configuration, all android platforms will be installed. | 102 # From current configuration, all android platforms will be installed. |
103 # This will take a little bit long time. | 103 # This will take a little bit long time. |
104 echo "Install platform, platform-tool and tool ..." | 104 echo "Install platform, platform-tool and tool ..." |
105 "${ANDROID_SDK_ROOT}"/tools/android update sdk --no-ui \ | 105 |
106 --filter platform,platform-tool,tool | 106 # This needs to be called twice. The first time, "android" itself |
| 107 # references |
| 108 # https://dl-ssl.google.com/android/repository/addons_list.xml, |
| 109 # which no longer exists. On the second run, "android" (or one of |
| 110 # it's config files) has been updated to now reference curl |
| 111 # https://dl-ssl.google.com/android/repository/addons_list-1.xml, |
| 112 # which contains what we need. |
| 113 for try in 1 2 ; do |
| 114 echo "==== SDK update $try" |
| 115 "${ANDROID_SDK_ROOT}"/tools/android update sdk --no-ui \ |
| 116 --filter platform,platform-tool,tool |
| 117 done |
107 fi | 118 fi |
108 | 119 |
109 # Create a Android Virtual Device named 'buildbot' with default hardware | 120 # Create a Android Virtual Device named 'buildbot' with default hardware |
110 # configuration and override the existing one, since there is no easy way to | 121 # configuration and override the existing one, since there is no easy way to |
111 # check whether current AVD has correct configuration and it takes almost no | 122 # check whether current AVD has correct configuration and it takes almost no |
112 # time to create a new one. | 123 # time to create a new one. |
113 "${ANDROID_SDK_ROOT}/tools/android" --silent create avd --name buildbot \ | 124 "${ANDROID_SDK_ROOT}/tools/android" --silent create avd --name buildbot \ |
114 --target ${SDK_TARGET_ID} --force <<< "no" | 125 --target ${SDK_TARGET_ID} --force <<< "no" |
115 | 126 |
116 # Install Android NDK if it doesn't exist. | 127 # Install Android NDK if it doesn't exist. |
117 if [[ ! -d "${ANDROID_NDK_ROOT}" ]]; then | 128 if [[ ! -d "${ANDROID_NDK_ROOT}" ]]; then |
118 echo 'Install ANDROID NDK ...' | 129 echo 'Install ANDROID NDK ...' |
119 (install_dev_kit "${NDK_FILE_NAME}" "${NDK_DOWNLOAD_URL}" "${NDK_MD5SUM}" \ | 130 (install_dev_kit "${NDK_FILE_NAME}" "${NDK_DOWNLOAD_URL}" "${NDK_MD5SUM}" \ |
120 $(dirname "${ANDROID_NDK_ROOT}")) | 131 $(dirname "${ANDROID_NDK_ROOT}")) |
121 fi | 132 fi |
OLD | NEW |