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 """Gets and writes the configurations of the attached devices. | 7 """Gets and writes the configurations of the attached devices. |
8 | 8 |
9 This configuration is used by later build steps to determine which devices to | 9 This configuration is used by later build steps to determine which devices to |
10 install to and what needs to be installed to those devices. | 10 install to and what needs to be installed to those devices. |
11 """ | 11 """ |
12 | 12 |
13 import optparse | 13 import optparse |
14 import os | |
14 import sys | 15 import sys |
15 | 16 |
16 # pylint: disable=F0401 | 17 # pylint: disable=F0401 |
17 from util import build_utils | 18 from util import build_utils |
18 from util import build_device | 19 from util import build_device |
19 # pylint: disable=F0401 | 20 # pylint: disable=F0401 |
20 | 21 |
22 BUILD_ANDROID_DIR = os.path.join(os.path.dirname(__file__), '..') | |
23 sys.path.append(BUILD_ANDROID_DIR) | |
24 | |
25 from pylib import android_commands | |
frankf
2014/02/10 18:35:12
I'm guessing the original motivation here was for
jbudorick
2014/02/10 18:39:37
We could, but what's the point in only visibly dep
cjhopman
2014/02/10 18:50:47
Because getting the gyp dependencies correct is mu
| |
26 | |
21 | 27 |
22 def main(argv): | 28 def main(argv): |
23 parser = optparse.OptionParser() | 29 parser = optparse.OptionParser() |
24 parser.add_option('--stamp', action='store') | 30 parser.add_option('--stamp', action='store') |
25 parser.add_option('--output', action='store') | 31 parser.add_option('--output', action='store') |
26 options, _ = parser.parse_args(argv) | 32 options, _ = parser.parse_args(argv) |
27 | 33 |
28 devices = build_device.GetAttachedDevices() | 34 devices = android_commands.GetAttachedDevices() |
29 | 35 |
30 device_configurations = [] | 36 device_configurations = [] |
31 for d in devices: | 37 for d in devices: |
32 configuration, is_online, has_root = ( | 38 configuration, is_online, has_root = ( |
33 build_device.GetConfigurationForDevice(d)) | 39 build_device.GetConfigurationForDevice(d)) |
34 | 40 |
35 if not is_online: | 41 if not is_online: |
36 build_utils.PrintBigWarning( | 42 build_utils.PrintBigWarning( |
37 '%s is not online. Skipping managed install for this device. ' | 43 '%s is not online. Skipping managed install for this device. ' |
38 'Try rebooting the device to fix this warning.' % d) | 44 'Try rebooting the device to fix this warning.' % d) |
(...skipping 21 matching lines...) Expand all Loading... | |
60 'Multiple devices attached. ' | 66 'Multiple devices attached. ' |
61 'Installing to the preferred device: ' | 67 'Installing to the preferred device: ' |
62 '%(id)s (%(description)s)' % (device_configurations[0])) | 68 '%(id)s (%(description)s)' % (device_configurations[0])) |
63 | 69 |
64 | 70 |
65 build_device.WriteConfigurations(device_configurations, options.output) | 71 build_device.WriteConfigurations(device_configurations, options.output) |
66 | 72 |
67 | 73 |
68 if __name__ == '__main__': | 74 if __name__ == '__main__': |
69 sys.exit(main(sys.argv)) | 75 sys.exit(main(sys.argv)) |
OLD | NEW |