| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 # Sets up environment for building Chromium on Android. | 6 # Sets up environment for building Chromium on Android. |
| 7 | 7 |
| 8 # Make sure we're being sourced (possibly by another script). Check for bash | 8 # Make sure we're being sourced (possibly by another script). Check for bash |
| 9 # since zsh sets $0 when sourcing. | 9 # since zsh sets $0 when sourcing. |
| 10 if [[ -n "$BASH_VERSION" && "${BASH_SOURCE:-$0}" == "$0" ]]; then | 10 if [[ -n "$BASH_VERSION" && "${BASH_SOURCE:-$0}" == "$0" ]]; then |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 # Otherwise, it will equal to "${CURRENT_DIR}" | 29 # Otherwise, it will equal to "${CURRENT_DIR}" |
| 30 echo "Warning: Current directory is out of CHROME_SRC, it may not be \ | 30 echo "Warning: Current directory is out of CHROME_SRC, it may not be \ |
| 31 the one you want." | 31 the one you want." |
| 32 echo "${CHROME_SRC}" | 32 echo "${CHROME_SRC}" |
| 33 fi | 33 fi |
| 34 | 34 |
| 35 # Allow the caller to override a few environment variables. If any of them is | 35 # Allow the caller to override a few environment variables. If any of them is |
| 36 # unset, we default to a sane value that's known to work. This allows for | 36 # unset, we default to a sane value that's known to work. This allows for |
| 37 # experimentation with a custom SDK. | 37 # experimentation with a custom SDK. |
| 38 if [[ -z "${ANDROID_SDK_ROOT}" || ! -d "${ANDROID_SDK_ROOT}" ]]; then | 38 if [[ -z "${ANDROID_SDK_ROOT}" || ! -d "${ANDROID_SDK_ROOT}" ]]; then |
| 39 export ANDROID_SDK_ROOT="${CHROME_SRC}/third_party/android_tools/sdk/" | 39 local ANDROID_SDK_ROOT="${CHROME_SRC}/third_party/android_tools/sdk/" |
| 40 fi | 40 fi |
| 41 | 41 |
| 42 # Add Android SDK tools to system path. | 42 # Add Android SDK tools to system path. |
| 43 export PATH=$PATH:${ANDROID_SDK_ROOT}/tools | 43 export PATH=$PATH:${ANDROID_SDK_ROOT}/tools |
| 44 export PATH=$PATH:${ANDROID_SDK_ROOT}/platform-tools | 44 export PATH=$PATH:${ANDROID_SDK_ROOT}/platform-tools |
| 45 | 45 |
| 46 # Add Chromium Android development scripts to system path. | 46 # Add Chromium Android development scripts to system path. |
| 47 # Must be after CHROME_SRC is set. | 47 # Must be after CHROME_SRC is set. |
| 48 export PATH=$PATH:${CHROME_SRC}/build/android | 48 export PATH=$PATH:${CHROME_SRC}/build/android |
| 49 } | 49 } |
| 50 android_envsetup_main | 50 android_envsetup_main |
| 51 | 51 |
| 52 android_gyp() { | 52 android_gyp() { |
| 53 echo "Please call build/gyp_chromium instead. android_gyp is going away." | 53 echo "Please call build/gyp_chromium instead. android_gyp is going away." |
| 54 "${CHROME_SRC}/build/gyp_chromium" --depth="${CHROME_SRC}" --check "$@" | 54 "${CHROME_SRC}/build/gyp_chromium" --depth="${CHROME_SRC}" --check "$@" |
| 55 } | 55 } |
| OLD | NEW |