From 0ff6e150f16f7456f736fa9ec81c2555f0a0170d Mon Sep 17 00:00:00 2001 From: "raphael.kubo.da.costa@intel.com" Date: Mon, 9 Sep 2013 22:54:08 +0000 Subject: [PATCH] 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 --- android/install_emulator_deps.py | 40 +++++++------------------------- 1 file changed, 9 insertions(+), 31 deletions(-) diff --git a/android/install_emulator_deps.py b/android/install_emulator_deps.py index 7b1222362..724bb7184 100755 --- a/android/install_emulator_deps.py +++ b/android/install_emulator_deps.py @@ -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: