android: Remove GetSDK() from install_emulator_deps.

These days, the SDK is already checked out by DEPS in
src/third_party/android_tools/sdk, so trying to download it again from a
different location at a later stage does not make much sense.

R=peter@chromium.org,bulach@chromium.org,craigdh@chromium.org,frankf@chromium.org

Review URL: https://chromiumcodereview.appspot.com/23621025

git-svn-id: http://src.chromium.org/svn/trunk/src/build@222121 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
This commit is contained in:
raphael.kubo.da.costa@intel.com 2013-09-09 22:54:08 +00:00
Родитель 0a1fe589d1
Коммит 0ff6e150f1
1 изменённых файлов: 9 добавлений и 31 удалений

Просмотреть файл

@ -5,7 +5,7 @@
"""Installs deps for using SDK emulator for testing.
The script will download the SDK and system images, if they are not present, and
The script will download system images, if they are not present, and
install and enable KVM, if virtualization has been enabled in the BIOS.
"""
@ -19,10 +19,6 @@ from pylib import cmd_helper
from pylib import constants
from pylib.utils import run_tests_helper
# From the Android Developer's website.
SDK_BASE_URL = 'http://dl.google.com/android/adt'
SDK_ZIP = 'adt-bundle-linux-x86_64-20130522.zip'
# Android x86 system image from the Intel website:
# http://software.intel.com/en-us/articles/intel-eula-x86-android-4-2-jelly-bean-bin
X86_IMG_URL = 'http://download-software.intel.com/sites/landingpage/android/sysimg_x86-17_r01.zip'
@ -65,27 +61,6 @@ def CheckKVM():
return False
def GetSDK():
"""Download the SDK and unzip in android_tools directory."""
logging.info('Download Android SDK.')
sdk_url = '%s/%s' % (SDK_BASE_URL, SDK_ZIP)
try:
cmd_helper.RunCmd(['curl', '-o', '/tmp/sdk.zip', sdk_url])
print 'curled unzipping...'
rc = cmd_helper.RunCmd(['unzip', '-o', '/tmp/sdk.zip', '-d', '/tmp/'])
if rc:
logging.critical('ERROR: could not download/unzip Android SDK.')
raise
# Get the name of the sub-directory that everything will be extracted to.
dirname, _ = os.path.splitext(SDK_ZIP)
zip_dir = '/tmp/%s' % dirname
# Move the extracted directory to EMULATOR_SDK_ROOT
dst = os.path.join(constants.EMULATOR_SDK_ROOT, 'android_tools')
shutil.move(zip_dir, dst)
finally:
os.unlink('/tmp/sdk.zip')
def InstallKVM():
"""Installs KVM packages."""
rc = cmd_helper.RunCmd(['sudo', 'apt-get', 'install', 'kvm'])
@ -127,14 +102,17 @@ def main(argv):
format='# %(asctime)-15s: %(message)s')
run_tests_helper.SetLogLevel(verbose_count=1)
# Calls below will download emulator SDK and/or system images only if needed.
if CheckSDK():
logging.info('android_tools directory already exists (not downloading).')
else:
GetSDK()
if not CheckSDK():
logging.critical(
'ERROR: android_tools does not exist. Make sure your .gclient file '
'contains the right \'target_os\' entry. See '
'https://code.google.com/p/chromium/wiki/AndroidBuildInstructions for '
'more information.')
return 1
logging.info('Emulator deps for ARM emulator complete.')
# Download system images only if needed.
if CheckX86Image():
logging.info('system-images directory already exists.')
else: