Chromium Code Reviews| 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 85 # Install .apk(s) if any of them have changed. | 85 # Install .apk(s) if any of them have changed. |
| 86 def do_install(): | 86 def do_install(): |
| 87 if args.splits: | 87 if args.splits: |
| 88 splits = [] | 88 splits = [] |
| 89 for split_glob in args.splits: | 89 for split_glob in args.splits: |
| 90 splits.extend((f for f in glob.glob(split_glob))) | 90 splits.extend((f for f in glob.glob(split_glob))) |
| 91 device.InstallSplitApk(args.apk_path, splits, reinstall=True, | 91 device.InstallSplitApk(args.apk_path, splits, reinstall=True, |
| 92 allow_cached_props=True) | 92 allow_cached_props=True) |
| 93 else: | 93 else: |
| 94 device.Install(args.apk_path, reinstall=True) | 94 device.Install(args.apk_path, reinstall=True) |
| 95 logging.info('Finished installing .apk') | |
|
jbudorick
2015/09/02 18:14:19
I know this feeling. I'd recommend using -v/--verb
agrieve
2015/09/02 18:34:04
Was planning on adding this, but does seem like a
| |
| 95 | 96 |
| 96 # Push .so files to the device (if they have changed). | 97 # Push .so files to the device (if they have changed). |
| 97 def do_push_libs(): | 98 def do_push_libs(): |
| 98 if args.lib_dir: | 99 if args.lib_dir: |
| 99 device_lib_dir = posixpath.join(device_incremental_dir, 'lib') | 100 device_lib_dir = posixpath.join(device_incremental_dir, 'lib') |
| 100 device.PushChangedFiles([(args.lib_dir, device_lib_dir)], | 101 device.PushChangedFiles([(args.lib_dir, device_lib_dir)], |
| 101 delete_device_stale=True) | 102 delete_device_stale=True) |
| 103 logging.info('Finished pushing native libs') | |
| 104 | |
| 102 # Concurrency here speeds things up quite a bit, but DeviceUtils hasn't | 105 # Concurrency here speeds things up quite a bit, but DeviceUtils hasn't |
| 103 # been designed for multi-threading. Enabling only because this is a | 106 # been designed for multi-threading. Enabling only because this is a |
| 104 # developer-only tool. | 107 # developer-only tool. |
| 105 if args.no_threading: | 108 if args.no_threading: |
| 106 do_install() | 109 do_install() |
| 107 do_push_libs() | 110 do_push_libs() |
| 108 else: | 111 else: |
| 109 reraiser_thread.RunAsync((do_install, do_push_libs)) | 112 reraiser_thread.RunAsync((do_install, do_push_libs)) |
| 110 logging.info('Took %s seconds' % round(time.time() - start_time, 1)) | 113 logging.info('Took %s seconds' % round(time.time() - start_time, 1)) |
| 111 | 114 |
| 112 | 115 |
| 113 if __name__ == '__main__': | 116 if __name__ == '__main__': |
| 114 sys.exit(main()) | 117 sys.exit(main()) |
| 115 | 118 |
| OLD | NEW |