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 | |
12 import optparse | 11 import optparse |
13 import os | 12 import os |
14 import sys | 13 import sys |
15 | 14 |
16 BUILD_ANDROID_DIR = os.path.join(os.path.dirname(__file__), os.pardir) | 15 BUILD_ANDROID_DIR = os.path.join(os.path.dirname(__file__), os.pardir) |
17 sys.path.append(BUILD_ANDROID_DIR) | 16 sys.path.append(BUILD_ANDROID_DIR) |
18 | 17 |
19 from pylib import constants | 18 from pylib import constants |
20 | 19 |
21 from util import build_device | 20 from util import build_device |
(...skipping 22 matching lines...) Expand all Loading... |
44 device.PushIfNeeded(host_path, device_path) | 43 device.PushIfNeeded(host_path, device_path) |
45 | 44 |
46 record_path = '%s.%s.push.md5.stamp' % (host_path, serial_number) | 45 record_path = '%s.%s.push.md5.stamp' % (host_path, serial_number) |
47 md5_check.CallAndRecordIfStale( | 46 md5_check.CallAndRecordIfStale( |
48 Push, | 47 Push, |
49 record_path=record_path, | 48 record_path=record_path, |
50 input_paths=[host_path], | 49 input_paths=[host_path], |
51 input_strings=[device_path]) | 50 input_strings=[device_path]) |
52 | 51 |
53 | 52 |
54 def main(argv): | 53 def main(): |
55 parser = optparse.OptionParser() | 54 parser = optparse.OptionParser() |
56 parser.add_option('--libraries-dir', | 55 parser.add_option('--libraries-dir', |
57 help='Directory that contains stripped libraries.') | 56 help='Directory that contains stripped libraries.') |
58 parser.add_option('--device-dir', | 57 parser.add_option('--device-dir', |
59 help='Device directory to push the libraries to.') | 58 help='Device directory to push the libraries to.') |
60 parser.add_option('--libraries-json', | 59 parser.add_option('--libraries-json', |
61 help='Path to the json list of native libraries.') | 60 help='Path to the json list of native libraries.') |
62 parser.add_option('--stamp', help='Path to touch on success.') | 61 parser.add_option('--stamp', help='Path to touch on success.') |
63 parser.add_option('--build-device-configuration', | 62 parser.add_option('--build-device-configuration', |
64 help='Path to build device configuration.') | 63 help='Path to build device configuration.') |
65 parser.add_option('--configuration-name', | 64 parser.add_option('--configuration-name', |
66 help='The build CONFIGURATION_NAME') | 65 help='The build CONFIGURATION_NAME') |
67 options, _ = parser.parse_args() | 66 options, _ = parser.parse_args() |
68 | 67 |
69 required_options = ['libraries_dir', 'device_dir', 'libraries_json'] | 68 required_options = ['libraries_dir', 'device_dir', 'libraries_json'] |
70 build_utils.CheckOptions(options, parser, required=required_options) | 69 build_utils.CheckOptions(options, parser, required=required_options) |
71 constants.SetBuildType(options.configuration_name) | 70 constants.SetBuildType(options.configuration_name) |
72 | 71 |
73 DoPush(options) | 72 DoPush(options) |
74 | 73 |
75 if options.stamp: | 74 if options.stamp: |
76 build_utils.Touch(options.stamp) | 75 build_utils.Touch(options.stamp) |
77 | 76 |
78 | 77 |
79 if __name__ == '__main__': | 78 if __name__ == '__main__': |
80 sys.exit(main(sys.argv)) | 79 sys.exit(main()) |
OLD | NEW |