blob: 5c4edafec5b4a4ff85d148a4784209c55d698a22 [file] [log] [blame]
lisandropaeae0b72015-02-10 21:39:311#!/bin/bash -e
2
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
5# found in the LICENSE file.
6
7# Script to install SDKs needed to build chromium on android.
8# See http://code.google.com/p/chromium/wiki/AndroidBuildInstructions
9
10echo 'checking for sdk packages install'
11# Use absolute path to call 'android' so script can be run from any directory.
12cwd=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
13# Get the SDK extras packages to install from the DEPS file 'sdkextras' hook.
14packages="$(python ${cwd}/get_sdk_extras_packages.py)"
15for package in "${packages}"; do
16 pkg_id=$(${cwd}/../third_party/android_tools/sdk/tools/android list sdk | \
17 grep -i "$package," | \
18 awk '/^[ ]*[0-9]*- / {gsub("-",""); print $1}')
19 if [[ -n ${pkg_id} ]]; then
20 ${cwd}/../third_party/android_tools/sdk/tools/android update sdk --no-ui \
21 --filter ${pkg_id}
22 fi
23done
24
25echo "install-android-sdks.sh complete."