OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright 2015 The Chromium Authors. All rights reserved. | 3 # Copyright 2015 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 """Install *_incremental.apk targets as well as their dependent files.""" | 7 """Install *_incremental.apk targets as well as their dependent files.""" |
8 | 8 |
9 import argparse | 9 import argparse |
10 import glob | 10 import glob |
11 import logging | 11 import logging |
12 import os | 12 import os |
13 import posixpath | 13 import posixpath |
14 import sys | 14 import sys |
15 | 15 |
16 sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir)) | 16 sys.path.append( |
| 17 os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))) |
| 18 import devil_chromium |
17 from devil.android import apk_helper | 19 from devil.android import apk_helper |
18 from devil.android import device_utils | 20 from devil.android import device_utils |
19 from devil.android import device_errors | 21 from devil.android import device_errors |
20 from devil.android.sdk import version_codes | 22 from devil.android.sdk import version_codes |
21 from devil.utils import reraiser_thread | 23 from devil.utils import reraiser_thread |
22 from pylib import constants | 24 from pylib import constants |
23 from pylib.utils import run_tests_helper | 25 from pylib.utils import run_tests_helper |
24 from pylib.utils import time_profile | 26 from pylib.utils import time_profile |
25 | 27 |
26 prev_sys_path = list(sys.path) | 28 prev_sys_path = list(sys.path) |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 action='count', | 245 action='count', |
244 help='Verbose level (multiple times for more)') | 246 help='Verbose level (multiple times for more)') |
245 | 247 |
246 args = parser.parse_args() | 248 args = parser.parse_args() |
247 | 249 |
248 run_tests_helper.SetLogLevel(args.verbose_count) | 250 run_tests_helper.SetLogLevel(args.verbose_count) |
249 constants.SetBuildType('Debug') | 251 constants.SetBuildType('Debug') |
250 if args.output_directory: | 252 if args.output_directory: |
251 constants.SetOutputDirectory(args.output_directory) | 253 constants.SetOutputDirectory(args.output_directory) |
252 | 254 |
| 255 devil_chromium.Initialize(output_directory=constants.GetOutputDirectory()) |
| 256 |
253 if args.device: | 257 if args.device: |
254 # Retries are annoying when commands fail for legitimate reasons. Might want | 258 # Retries are annoying when commands fail for legitimate reasons. Might want |
255 # to enable them if this is ever used on bots though. | 259 # to enable them if this is ever used on bots though. |
256 device = device_utils.DeviceUtils( | 260 device = device_utils.DeviceUtils( |
257 args.device, default_retries=0, enable_device_files_cache=True) | 261 args.device, default_retries=0, enable_device_files_cache=True) |
258 else: | 262 else: |
259 devices = device_utils.DeviceUtils.HealthyDevices( | 263 devices = device_utils.DeviceUtils.HealthyDevices( |
260 default_retries=0, enable_device_files_cache=True) | 264 default_retries=0, enable_device_files_cache=True) |
261 if not devices: | 265 if not devices: |
262 raise device_errors.NoDevicesError() | 266 raise device_errors.NoDevicesError() |
(...skipping 14 matching lines...) Expand all Loading... |
277 Uninstall(device, apk.GetPackageName()) | 281 Uninstall(device, apk.GetPackageName()) |
278 else: | 282 else: |
279 Install(device, apk, split_globs=args.splits, native_libs=args.native_libs, | 283 Install(device, apk, split_globs=args.splits, native_libs=args.native_libs, |
280 dex_files=args.dex_files, enable_device_cache=args.cache, | 284 dex_files=args.dex_files, enable_device_cache=args.cache, |
281 use_concurrency=args.threading, | 285 use_concurrency=args.threading, |
282 show_proguard_warning=args.show_proguard_warning) | 286 show_proguard_warning=args.show_proguard_warning) |
283 | 287 |
284 | 288 |
285 if __name__ == '__main__': | 289 if __name__ == '__main__': |
286 sys.exit(main()) | 290 sys.exit(main()) |
OLD | NEW |