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 shutil | 14 import shutil |
15 import sys | 15 import sys |
16 | 16 |
17 sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir)) | 17 sys.path.append( |
| 18 os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))) |
| 19 import devil_chromium |
18 from devil.android import apk_helper | 20 from devil.android import apk_helper |
19 from devil.android import device_utils | 21 from devil.android import device_utils |
20 from devil.android import device_errors | 22 from devil.android import device_errors |
21 from devil.android.sdk import version_codes | 23 from devil.android.sdk import version_codes |
22 from devil.utils import reraiser_thread | 24 from devil.utils import reraiser_thread |
23 from pylib import constants | 25 from pylib import constants |
24 from pylib.utils import run_tests_helper | 26 from pylib.utils import run_tests_helper |
25 from pylib.utils import time_profile | 27 from pylib.utils import time_profile |
26 | 28 |
27 prev_sys_path = list(sys.path) | 29 prev_sys_path = list(sys.path) |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 action='count', | 248 action='count', |
247 help='Verbose level (multiple times for more)') | 249 help='Verbose level (multiple times for more)') |
248 | 250 |
249 args = parser.parse_args() | 251 args = parser.parse_args() |
250 | 252 |
251 run_tests_helper.SetLogLevel(args.verbose_count) | 253 run_tests_helper.SetLogLevel(args.verbose_count) |
252 constants.SetBuildType('Debug') | 254 constants.SetBuildType('Debug') |
253 if args.output_directory: | 255 if args.output_directory: |
254 constants.SetOutputDirectory(args.output_directory) | 256 constants.SetOutputDirectory(args.output_directory) |
255 | 257 |
| 258 devil_chromium.Initialize(output_directory=constants.GetOutputDirectory()) |
| 259 |
256 if args.device: | 260 if args.device: |
257 # Retries are annoying when commands fail for legitimate reasons. Might want | 261 # Retries are annoying when commands fail for legitimate reasons. Might want |
258 # to enable them if this is ever used on bots though. | 262 # to enable them if this is ever used on bots though. |
259 device = device_utils.DeviceUtils( | 263 device = device_utils.DeviceUtils( |
260 args.device, default_retries=0, enable_device_files_cache=True) | 264 args.device, default_retries=0, enable_device_files_cache=True) |
261 else: | 265 else: |
262 devices = device_utils.DeviceUtils.HealthyDevices( | 266 devices = device_utils.DeviceUtils.HealthyDevices( |
263 default_retries=0, enable_device_files_cache=True) | 267 default_retries=0, enable_device_files_cache=True) |
264 if not devices: | 268 if not devices: |
265 raise device_errors.NoDevicesError() | 269 raise device_errors.NoDevicesError() |
(...skipping 14 matching lines...) Expand all Loading... |
280 Uninstall(device, apk.GetPackageName()) | 284 Uninstall(device, apk.GetPackageName()) |
281 else: | 285 else: |
282 Install(device, apk, split_globs=args.splits, native_libs=args.native_libs, | 286 Install(device, apk, split_globs=args.splits, native_libs=args.native_libs, |
283 dex_files=args.dex_files, enable_device_cache=args.cache, | 287 dex_files=args.dex_files, enable_device_cache=args.cache, |
284 use_concurrency=args.threading, | 288 use_concurrency=args.threading, |
285 show_proguard_warning=args.show_proguard_warning) | 289 show_proguard_warning=args.show_proguard_warning) |
286 | 290 |
287 | 291 |
288 if __name__ == '__main__': | 292 if __name__ == '__main__': |
289 sys.exit(main()) | 293 sys.exit(main()) |
OLD | NEW |