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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 action='count', | 227 action='count', |
226 help='Verbose level (multiple times for more)') | 228 help='Verbose level (multiple times for more)') |
227 | 229 |
228 args = parser.parse_args() | 230 args = parser.parse_args() |
229 | 231 |
230 run_tests_helper.SetLogLevel(args.verbose_count) | 232 run_tests_helper.SetLogLevel(args.verbose_count) |
231 constants.SetBuildType('Debug') | 233 constants.SetBuildType('Debug') |
232 if args.output_directory: | 234 if args.output_directory: |
233 constants.SetOutputDirectory(args.output_directory) | 235 constants.SetOutputDirectory(args.output_directory) |
234 | 236 |
| 237 devil_chromium.Initialize(output_directory=constants.GetOutputDirectory()) |
| 238 |
235 if args.device: | 239 if args.device: |
236 # Retries are annoying when commands fail for legitimate reasons. Might want | 240 # Retries are annoying when commands fail for legitimate reasons. Might want |
237 # to enable them if this is ever used on bots though. | 241 # to enable them if this is ever used on bots though. |
238 device = device_utils.DeviceUtils( | 242 device = device_utils.DeviceUtils( |
239 args.device, default_retries=0, enable_device_files_cache=True) | 243 args.device, default_retries=0, enable_device_files_cache=True) |
240 else: | 244 else: |
241 devices = device_utils.DeviceUtils.HealthyDevices( | 245 devices = device_utils.DeviceUtils.HealthyDevices( |
242 default_retries=0, enable_device_files_cache=True) | 246 default_retries=0, enable_device_files_cache=True) |
243 if not devices: | 247 if not devices: |
244 raise device_errors.NoDevicesError() | 248 raise device_errors.NoDevicesError() |
(...skipping 13 matching lines...) Expand all Loading... |
258 if args.uninstall: | 262 if args.uninstall: |
259 Uninstall(device, apk.GetPackageName()) | 263 Uninstall(device, apk.GetPackageName()) |
260 else: | 264 else: |
261 Install(device, apk, split_globs=args.splits, lib_dir=args.lib_dir, | 265 Install(device, apk, split_globs=args.splits, lib_dir=args.lib_dir, |
262 dex_files=args.dex_files, enable_device_cache=args.cache, | 266 dex_files=args.dex_files, enable_device_cache=args.cache, |
263 use_concurrency=args.threading) | 267 use_concurrency=args.threading) |
264 | 268 |
265 | 269 |
266 if __name__ == '__main__': | 270 if __name__ == '__main__': |
267 sys.exit(main()) | 271 sys.exit(main()) |
OLD | NEW |