OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2013 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 """Installs deps for using SDK emulator for testing. | 6 """Installs deps for using SDK emulator for testing. |
7 | 7 |
8 The script will download the SDK and system images, if they are not present, and | 8 The script will download the SDK and system images, if they are not present, and |
9 install and enable KVM, if virtualization has been enabled in the BIOS. | 9 install and enable KVM, if virtualization has been enabled in the BIOS. |
10 """ | 10 """ |
(...skipping 12 matching lines...) Expand all Loading... |
23 from pylib.utils import run_tests_helper | 23 from pylib.utils import run_tests_helper |
24 | 24 |
25 # Android API level | 25 # Android API level |
26 DEFAULT_ANDROID_API_LEVEL = constants.ANDROID_SDK_VERSION | 26 DEFAULT_ANDROID_API_LEVEL = constants.ANDROID_SDK_VERSION |
27 | 27 |
28 # From the Android Developer's website. | 28 # From the Android Developer's website. |
29 # Keep this up to date; the user can install older API levels as necessary. | 29 # Keep this up to date; the user can install older API levels as necessary. |
30 SDK_BASE_URL = 'http://dl.google.com/android/adt' | 30 SDK_BASE_URL = 'http://dl.google.com/android/adt' |
31 SDK_ZIP = 'adt-bundle-linux-x86_64-20131030.zip' | 31 SDK_ZIP = 'adt-bundle-linux-x86_64-20131030.zip' |
32 | 32 |
33 # pylint: disable=C0301 | |
34 # Android x86 system image from the Intel website: | 33 # Android x86 system image from the Intel website: |
35 # http://software.intel.com/en-us/articles/intel-eula-x86-android-4-2-jelly-bean
-bin | 34 # http://software.intel.com/en-us/articles/intel-eula-x86-android-4-2-jelly-bean
-bin |
36 # These don't exist prior to Android-15. | 35 # These don't exist prior to Android-15. |
37 # As of 08 Nov 2013, Android-19 is not yet available either. | 36 # As of 08 Nov 2013, Android-19 is not yet available either. |
38 X86_IMG_URLS = { | 37 X86_IMG_URLS = { |
39 15: 'http://download-software.intel.com/sites/landingpage/android/sysimg_x86-1
5_r01.zip', | 38 15: 'http://download-software.intel.com/sites/landingpage/android/sysimg_x86-1
5_r01.zip', |
40 16: 'http://download-software.intel.com/sites/landingpage/android/sysimg_x86-1
6_r01.zip', | 39 16: 'http://download-software.intel.com/sites/landingpage/android/sysimg_x86-1
6_r01.zip', |
41 17: 'http://download-software.intel.com/sites/landingpage/android/sysimg_x86-1
7_r01.zip', | 40 17: 'http://download-software.intel.com/sites/landingpage/android/sysimg_x86-1
7_r01.zip', |
42 18: 'http://download-software.intel.com/sites/landingpage/android/sysimg_x86-1
8_r01.zip', | 41 18: 'http://download-software.intel.com/sites/landingpage/android/sysimg_x86-1
8_r01.zip', |
43 19: 'http://download-software.intel.com/sites/landingpage/android/sysimg_x86-1
9_r01.zip'} | 42 19: 'http://download-software.intel.com/sites/landingpage/android/sysimg_x86-1
9_r01.zip'} |
44 #pylint: enable=C0301 | |
45 | 43 |
46 def CheckSDK(): | 44 def CheckSDK(): |
47 """Check if SDK is already installed. | 45 """Check if SDK is already installed. |
48 | 46 |
49 Returns: | 47 Returns: |
50 True if the emulator SDK directory (src/android_emulator_sdk/) exists. | 48 True if the emulator SDK directory (src/android_emulator_sdk/) exists. |
51 """ | 49 """ |
52 return os.path.exists(constants.EMULATOR_SDK_ROOT) | 50 return os.path.exists(constants.EMULATOR_SDK_ROOT) |
53 | 51 |
54 | 52 |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 | 266 |
269 # Make sure KVM packages are installed and enabled. | 267 # Make sure KVM packages are installed and enabled. |
270 if CheckKVM(): | 268 if CheckKVM(): |
271 logging.info('KVM already installed and enabled.') | 269 logging.info('KVM already installed and enabled.') |
272 else: | 270 else: |
273 InstallKVM() | 271 InstallKVM() |
274 | 272 |
275 | 273 |
276 if __name__ == '__main__': | 274 if __name__ == '__main__': |
277 sys.exit(main(sys.argv)) | 275 sys.exit(main(sys.argv)) |
OLD | NEW |