| 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 BUILD_ANDROID_DIR = os.path.join(os.path.dirname(__file__), os.pardir) |
| 17 sys.path.append(BUILD_ANDROID_DIR) |
| 18 |
| 19 from pylib import constants |
| 20 |
| 16 from util import build_device | 21 from util import build_device |
| 17 from util import build_utils | 22 from util import build_utils |
| 18 from util import md5_check | 23 from util import md5_check |
| 19 | 24 |
| 20 def DoPush(options): | 25 def DoPush(options): |
| 21 libraries = build_utils.ReadJson(options.libraries_json) | 26 libraries = build_utils.ReadJson(options.libraries_json) |
| 22 | 27 |
| 23 device = build_device.GetBuildDeviceFromPath( | 28 device = build_device.GetBuildDeviceFromPath( |
| 24 options.build_device_configuration) | 29 options.build_device_configuration) |
| 25 if not device: | 30 if not device: |
| (...skipping 24 matching lines...) Expand all Loading... |
| 50 parser = optparse.OptionParser() | 55 parser = optparse.OptionParser() |
| 51 parser.add_option('--libraries-dir', | 56 parser.add_option('--libraries-dir', |
| 52 help='Directory that contains stripped libraries.') | 57 help='Directory that contains stripped libraries.') |
| 53 parser.add_option('--device-dir', | 58 parser.add_option('--device-dir', |
| 54 help='Device directory to push the libraries to.') | 59 help='Device directory to push the libraries to.') |
| 55 parser.add_option('--libraries-json', | 60 parser.add_option('--libraries-json', |
| 56 help='Path to the json list of native libraries.') | 61 help='Path to the json list of native libraries.') |
| 57 parser.add_option('--stamp', help='Path to touch on success.') | 62 parser.add_option('--stamp', help='Path to touch on success.') |
| 58 parser.add_option('--build-device-configuration', | 63 parser.add_option('--build-device-configuration', |
| 59 help='Path to build device configuration.') | 64 help='Path to build device configuration.') |
| 65 parser.add_option('--configuration-name', |
| 66 help='The build CONFIGURATION_NAME') |
| 60 options, _ = parser.parse_args() | 67 options, _ = parser.parse_args() |
| 61 | 68 |
| 62 required_options = ['libraries_dir', 'device_dir', 'libraries_json'] | 69 required_options = ['libraries_dir', 'device_dir', 'libraries_json'] |
| 63 build_utils.CheckOptions(options, parser, required=required_options) | 70 build_utils.CheckOptions(options, parser, required=required_options) |
| 71 constants.SetBuildType(options.configuration_name) |
| 64 | 72 |
| 65 DoPush(options) | 73 DoPush(options) |
| 66 | 74 |
| 67 if options.stamp: | 75 if options.stamp: |
| 68 build_utils.Touch(options.stamp) | 76 build_utils.Touch(options.stamp) |
| 69 | 77 |
| 70 | 78 |
| 71 if __name__ == '__main__': | 79 if __name__ == '__main__': |
| 72 sys.exit(main(sys.argv)) | 80 sys.exit(main(sys.argv)) |
| OLD | NEW |