| 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 |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 parser.add_argument('--no-cache', | 255 parser.add_argument('--no-cache', |
| 256 action='store_false', | 256 action='store_false', |
| 257 default=True, | 257 default=True, |
| 258 dest='cache', | 258 dest='cache', |
| 259 help='Do not use cached information about what files are ' | 259 help='Do not use cached information about what files are ' |
| 260 'currently on the target device.') | 260 'currently on the target device.') |
| 261 parser.add_argument('--show-proguard-warning', | 261 parser.add_argument('--show-proguard-warning', |
| 262 action='store_true', | 262 action='store_true', |
| 263 default=False, | 263 default=False, |
| 264 help='Print a warning about proguard being disabled') | 264 help='Print a warning about proguard being disabled') |
| 265 parser.add_argument('--dont-even-try', |
| 266 help='Prints this message and exits.') |
| 265 parser.add_argument('-v', | 267 parser.add_argument('-v', |
| 266 '--verbose', | 268 '--verbose', |
| 267 dest='verbose_count', | 269 dest='verbose_count', |
| 268 default=0, | 270 default=0, |
| 269 action='count', | 271 action='count', |
| 270 help='Verbose level (multiple times for more)') | 272 help='Verbose level (multiple times for more)') |
| 271 | 273 |
| 272 args = parser.parse_args() | 274 args = parser.parse_args() |
| 273 | 275 |
| 274 run_tests_helper.SetLogLevel(args.verbose_count) | 276 run_tests_helper.SetLogLevel(args.verbose_count) |
| 275 constants.SetBuildType('Debug') | 277 constants.SetBuildType('Debug') |
| 276 if args.output_directory: | 278 if args.output_directory: |
| 277 constants.SetOutputDirectory(args.output_directory) | 279 constants.SetOutputDirectory(args.output_directory) |
| 278 | 280 |
| 279 devil_chromium.Initialize(output_directory=constants.GetOutDirectory()) | 281 devil_chromium.Initialize(output_directory=constants.GetOutDirectory()) |
| 280 | 282 |
| 283 if args.dont_even_try: |
| 284 logging.fatal(args.dont_even_try) |
| 285 return 1 |
| 286 |
| 281 if args.device: | 287 if args.device: |
| 282 # Retries are annoying when commands fail for legitimate reasons. Might want | 288 # Retries are annoying when commands fail for legitimate reasons. Might want |
| 283 # to enable them if this is ever used on bots though. | 289 # to enable them if this is ever used on bots though. |
| 284 device = device_utils.DeviceUtils( | 290 device = device_utils.DeviceUtils( |
| 285 args.device, default_retries=0, enable_device_files_cache=True) | 291 args.device, default_retries=0, enable_device_files_cache=True) |
| 286 else: | 292 else: |
| 287 devices = device_utils.DeviceUtils.HealthyDevices( | 293 devices = device_utils.DeviceUtils.HealthyDevices( |
| 288 default_retries=0, enable_device_files_cache=True) | 294 default_retries=0, enable_device_files_cache=True) |
| 289 if not devices: | 295 if not devices: |
| 290 raise device_errors.NoDevicesError() | 296 raise device_errors.NoDevicesError() |
| (...skipping 14 matching lines...) Expand all Loading... |
| 305 Uninstall(device, apk.GetPackageName(), enable_device_cache=args.cache) | 311 Uninstall(device, apk.GetPackageName(), enable_device_cache=args.cache) |
| 306 else: | 312 else: |
| 307 Install(device, apk, split_globs=args.splits, native_libs=args.native_libs, | 313 Install(device, apk, split_globs=args.splits, native_libs=args.native_libs, |
| 308 dex_files=args.dex_files, enable_device_cache=args.cache, | 314 dex_files=args.dex_files, enable_device_cache=args.cache, |
| 309 use_concurrency=args.threading, | 315 use_concurrency=args.threading, |
| 310 show_proguard_warning=args.show_proguard_warning) | 316 show_proguard_warning=args.show_proguard_warning) |
| 311 | 317 |
| 312 | 318 |
| 313 if __name__ == '__main__': | 319 if __name__ == '__main__': |
| 314 sys.exit(main()) | 320 sys.exit(main()) |
| OLD | NEW |