| OLD | NEW |
| 1 #!/bin/bash -e | 1 #!/bin/bash -e |
| 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 # Script to install everything needed to build chromium on android that | 7 # Script to install everything needed to build chromium on android, including |
| 8 # requires sudo privileges. | 8 # items requiring sudo privileges. |
| 9 # See http://code.google.com/p/chromium/wiki/AndroidBuildInstructions | 9 # See http://code.google.com/p/chromium/wiki/AndroidBuildInstructions |
| 10 | 10 |
| 11 # This script installs the sun-java6 packages (bin, jre and jdk). Sun requires | 11 # This script installs the sun-java6 packages (bin, jre and jdk). Sun requires |
| 12 # a license agreement, so upon installation it will prompt the user. To get | 12 # a license agreement, so upon installation it will prompt the user. To get |
| 13 # past the curses-based dialog press TAB <ret> TAB <ret> to agree. | 13 # past the curses-based dialog press TAB <ret> TAB <ret> to agree. |
| 14 | 14 |
| 15 args="$@" | 15 args="$@" |
| 16 if test "$1" = "--skip-sdk-packages"; then | 16 if test "$1" = "--skip-sdk-packages"; then |
| 17 skip_inst_sdk_packages=1 | 17 skip_inst_sdk_packages=1 |
| 18 args="${@:2}" | 18 args="${@:2}" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 if grep -v 'javaplugin.so' "${TEMPDIR}"/update-java-alternatives.out \ | 85 if grep -v 'javaplugin.so' "${TEMPDIR}"/update-java-alternatives.out \ |
| 86 >& /dev/null | 86 >& /dev/null |
| 87 then | 87 then |
| 88 # If there are non-javaplugin.so errors, treat as errors and exit | 88 # If there are non-javaplugin.so errors, treat as errors and exit |
| 89 echo 'ERRORS: Failed to update alternatives for java-6-sun:' | 89 echo 'ERRORS: Failed to update alternatives for java-6-sun:' |
| 90 grep -v 'javaplugin.so' "${TEMPDIR}"/update-java-alternatives.out | 90 grep -v 'javaplugin.so' "${TEMPDIR}"/update-java-alternatives.out |
| 91 exit 1 | 91 exit 1 |
| 92 fi | 92 fi |
| 93 fi | 93 fi |
| 94 | 94 |
| 95 # Install SDK packages for android |
| 95 if test "$skip_inst_sdk_packages" != 1; then | 96 if test "$skip_inst_sdk_packages" != 1; then |
| 96 echo 'checking for sdk packages install' | 97 "$(dirname "${BASH_SOURCE[0]}")/install-android-sdks.sh" |
| 97 # Use absolute path to call 'android' so script can be run from any directory. | |
| 98 cwd=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) | |
| 99 # Get the SDK extras packages to install from the DEPS file 'sdkextras' hook. | |
| 100 packages="$(python ${cwd}/get_sdk_extras_packages.py)" | |
| 101 for package in "${packages}"; do | |
| 102 pkg_id=$(${cwd}/../third_party/android_tools/sdk/tools/android list sdk | \ | |
| 103 grep -i "$package," | \ | |
| 104 awk '/^[ ]*[0-9]*- / {gsub("-",""); print $1}') | |
| 105 if [[ -n ${pkg_id} ]]; then | |
| 106 ${cwd}/../third_party/android_tools/sdk/tools/android update sdk --no-ui \ | |
| 107 --filter ${pkg_id} | |
| 108 fi | |
| 109 done | |
| 110 fi | 98 fi |
| 111 | 99 |
| 112 echo "install-build-deps-android.sh complete." | 100 echo "install-build-deps-android.sh complete." |
| OLD | NEW |