Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Side by Side Diff: build/android/gyp/get_device_configuration.py

Issue 1399273002: [Android] Add a configurable environment for devil/. (RELAND) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed: more non-default directory handling, especially for gyp_managed_install Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 from util import build_utils 17 from util import build_utils
17 from util import build_device 18 from util import build_device
18 19
20 BUILD_ANDROID_DIR = os.path.abspath(
aiolos (Not reviewing) 2015/10/13 13:29:17 Is this supposed to be here? It's already defined
jbudorick 2015/10/13 13:40:48 I put it here to add to sys.path and promptly forg
aiolos (Not reviewing) 2015/10/13 18:27:54 Acknowledged.
21 os.path.join(os.path.dirname(__file__), '..'))
22 import devil_chromium
23
19 24
20 def main(argv): 25 def main(argv):
21 parser = optparse.OptionParser() 26 parser = optparse.OptionParser()
22 parser.add_option('--stamp', action='store') 27 parser.add_option('--stamp', action='store')
23 parser.add_option('--output', action='store') 28 parser.add_option('--output', action='store')
29 parser.add_option('--output-directory', action='store')
24 options, _ = parser.parse_args(argv) 30 options, _ = parser.parse_args(argv)
25 31
32 devil_chromium.Initialize(
33 output_directory=os.path.abspath(options.output_directory))
34
26 devices = build_device.GetAttachedDevices() 35 devices = build_device.GetAttachedDevices()
27 36
28 device_configurations = [] 37 device_configurations = []
29 for d in devices: 38 for d in devices:
30 configuration, is_online, has_root = ( 39 configuration, is_online, has_root = (
31 build_device.GetConfigurationForDevice(d)) 40 build_device.GetConfigurationForDevice(d))
32 41
33 if not is_online: 42 if not is_online:
34 build_utils.PrintBigWarning( 43 build_utils.PrintBigWarning(
35 '%s is not online. Skipping managed install for this device. ' 44 '%s is not online. Skipping managed install for this device. '
(...skipping 22 matching lines...) Expand all
58 'Multiple devices attached. ' 67 'Multiple devices attached. '
59 'Installing to the preferred device: ' 68 'Installing to the preferred device: '
60 '%(id)s (%(description)s)' % (device_configurations[0])) 69 '%(id)s (%(description)s)' % (device_configurations[0]))
61 70
62 71
63 build_device.WriteConfigurations(device_configurations, options.output) 72 build_device.WriteConfigurations(device_configurations, options.output)
64 73
65 74
66 if __name__ == '__main__': 75 if __name__ == '__main__':
67 sys.exit(main(sys.argv)) 76 sys.exit(main(sys.argv))
OLDNEW
« no previous file with comments | « build/android/gyp/create_device_library_links.py ('k') | build/android/gyp/util/build_device.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698