| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # | 2 # |
| 3 # Copyright 2013 The Chromium Authors. All rights reserved. | 3 # Copyright 2013 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 """Pushes native libraries to a device. | 7 """Pushes native libraries to a device. |
| 8 | 8 |
| 9 """ | 9 """ |
| 10 | 10 |
| 11 import json | 11 import json |
| 12 import optparse | 12 import optparse |
| 13 import os | 13 import os |
| 14 import sys | 14 import sys |
| 15 | 15 |
| 16 from util import build_utils |
| 16 from util import md5_check | 17 from util import md5_check |
| 17 | 18 |
| 18 BUILD_ANDROID_DIR = os.path.join(os.path.dirname(__file__), '..') | 19 BUILD_ANDROID_DIR = os.path.join(os.path.dirname(__file__), '..') |
| 19 sys.path.append(BUILD_ANDROID_DIR) | 20 sys.path.append(BUILD_ANDROID_DIR) |
| 20 | 21 |
| 21 from pylib import android_commands | 22 from pylib import android_commands |
| 22 from pylib import build_utils | |
| 23 | 23 |
| 24 | 24 |
| 25 def DoPush(options): | 25 def DoPush(options): |
| 26 libraries = build_utils.ReadJson(options.libraries_json) | 26 libraries = build_utils.ReadJson(options.libraries_json) |
| 27 | 27 |
| 28 adb = android_commands.AndroidCommands() | 28 adb = android_commands.AndroidCommands() |
| 29 needs_directory = True | 29 needs_directory = True |
| 30 for lib in libraries: | 30 for lib in libraries: |
| 31 device_path = os.path.join(options.device_dir, lib) | 31 device_path = os.path.join(options.device_dir, lib) |
| 32 host_path = os.path.join(options.libraries_dir, lib) | 32 host_path = os.path.join(options.libraries_dir, lib) |
| (...skipping 23 matching lines...) Expand all Loading... |
| 56 build_utils.CheckOptions(options, parser, required=required_options) | 56 build_utils.CheckOptions(options, parser, required=required_options) |
| 57 | 57 |
| 58 DoPush(options) | 58 DoPush(options) |
| 59 | 59 |
| 60 if options.stamp: | 60 if options.stamp: |
| 61 build_utils.Touch(options.stamp) | 61 build_utils.Touch(options.stamp) |
| 62 | 62 |
| 63 | 63 |
| 64 if __name__ == '__main__': | 64 if __name__ == '__main__': |
| 65 sys.exit(main(sys.argv)) | 65 sys.exit(main(sys.argv)) |
| OLD | NEW |