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. |
11 | 11 |
12 # Using Android 3.2, API Level: 13 (Honeycomb). The SDK package is about 30M. | 12 # Using Android 3.2, API Level: 13 (Honeycomb). The SDK package is about 30M. |
13 SDK_FILE_NAME="android-sdk_r13-linux_x86.tgz" | 13 SDK_FILE_NAME="android-sdk_r13-linux_x86.tgz" |
14 SDK_DOWNLOAD_URL="http://dl.google.com/android/${SDK_FILE_NAME}" | 14 SDK_DOWNLOAD_URL="http://dl.google.com/android/${SDK_FILE_NAME}" |
15 SDK_MD5SUM="d80d7530a46c665644ae76084a9a0dc4" | 15 SDK_MD5SUM="d80d7530a46c665644ae76084a9a0dc4" |
16 | 16 |
17 # Using "ANDROID_SDK_ROOT/tools/android list targets" to get the matching target | 17 # Using "ANDROID_SDK_ROOT/tools/android list targets" to get the matching target |
18 # id which will be loaded in simulator for testing. | 18 # id which will be loaded in simulator for testing. |
19 # For example: the output of the listed the target could be below, and the | 19 # For example: the output of the listed the target could be below, and the |
20 # 'android-13' is the SDK_TARGET_ID in this case. | 20 # 'android-13' is the SDK_TARGET_ID in this case. |
21 # id: 9 or "android-13" | 21 # id: 9 or "android-13" |
22 # Name: Android 3.2 | 22 # Name: Android 3.2 |
23 # Type: Platform | 23 # Type: Platform |
24 # API level: 13 | 24 # API level: 13 |
25 # Revision: 1 | 25 # Revision: 1 |
26 # Skins: WXGA (default) | 26 # Skins: WXGA (default) |
27 SDK_TARGET_ID=android-13 | 27 SDK_TARGET_ID=android-13 |
28 | 28 |
29 # Using NDK r6b; The package is about 44M. | 29 # Using NDK r7; The package is about 64M. |
30 NDK_FILE_NAME="android-ndk-r6b-linux-x86.tar.bz2" | 30 NDK_FILE_NAME="android-ndk-r7-linux-x86.tar.bz2" |
31 NDK_DOWNLOAD_URL="http://dl.google.com/android/ndk/${NDK_FILE_NAME}" | 31 NDK_DOWNLOAD_URL="http://dl.google.com/android/ndk/${NDK_FILE_NAME}" |
32 NDK_MD5SUM="309f35e49b64313cfb20ac428df4cec2" | 32 NDK_MD5SUM="bf15e6b47bf50824c4b96849bf003ca3" |
33 | 33 |
34 # The temporary directory used to store the downloaded file. | 34 # The temporary directory used to store the downloaded file. |
35 TEMPDIR=$(mktemp -d) | 35 TEMPDIR=$(mktemp -d) |
36 cleanup() { | 36 cleanup() { |
37 local status=${?} | 37 local status=${?} |
38 trap - EXIT | 38 trap - EXIT |
39 rm -rf "${TEMPDIR}" | 39 rm -rf "${TEMPDIR}" |
40 exit ${status} | 40 exit ${status} |
41 } | 41 } |
42 trap cleanup EXIT | 42 trap cleanup EXIT |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 # time to create a new one. | 123 # time to create a new one. |
124 "${ANDROID_SDK_ROOT}/tools/android" --silent create avd --name buildbot \ | 124 "${ANDROID_SDK_ROOT}/tools/android" --silent create avd --name buildbot \ |
125 --target ${SDK_TARGET_ID} --force <<< "no" | 125 --target ${SDK_TARGET_ID} --force <<< "no" |
126 | 126 |
127 # Install Android NDK if it doesn't exist. | 127 # Install Android NDK if it doesn't exist. |
128 if [[ ! -d "${ANDROID_NDK_ROOT}" ]]; then | 128 if [[ ! -d "${ANDROID_NDK_ROOT}" ]]; then |
129 echo 'Install ANDROID NDK ...' | 129 echo 'Install ANDROID NDK ...' |
130 (install_dev_kit "${NDK_FILE_NAME}" "${NDK_DOWNLOAD_URL}" "${NDK_MD5SUM}" \ | 130 (install_dev_kit "${NDK_FILE_NAME}" "${NDK_DOWNLOAD_URL}" "${NDK_MD5SUM}" \ |
131 $(dirname "${ANDROID_NDK_ROOT}")) | 131 $(dirname "${ANDROID_NDK_ROOT}")) |
132 fi | 132 fi |
OLD | NEW |