OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Configures devil for use in chromium.""" | 5 """Configures devil for use in chromium.""" |
6 | 6 |
7 import os | 7 import os |
| 8 import sys |
| 9 |
| 10 from pylib.constants import host_paths |
| 11 |
| 12 if host_paths.DEVIL_PATH not in sys.path: |
| 13 sys.path.append(host_paths.DEVIL_PATH) |
8 | 14 |
9 from devil import devil_env | 15 from devil import devil_env |
10 | 16 |
11 | |
12 _DEVIL_CONFIG = os.path.abspath( | 17 _DEVIL_CONFIG = os.path.abspath( |
13 os.path.join(os.path.dirname(__file__), 'devil_chromium.json')) | 18 os.path.join(os.path.dirname(__file__), 'devil_chromium.json')) |
14 | 19 |
15 _DEVIL_BUILD_PRODUCT_DEPS = { | 20 _DEVIL_BUILD_PRODUCT_DEPS = { |
16 'forwarder_device': [ | 21 'forwarder_device': [ |
17 { | 22 { |
18 'platform': 'android', | 23 'platform': 'android', |
19 'arch': 'armeabi-v7a', | 24 'arch': 'armeabi-v7a', |
20 'name': 'forwarder_dist', | 25 'name': 'forwarder_dist', |
21 }, | 26 }, |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 }, | 124 }, |
120 ... | 125 ... |
121 } | 126 } |
122 """ | 127 """ |
123 | 128 |
124 devil_dynamic_config = { | 129 devil_dynamic_config = { |
125 'config_type': 'BaseConfig', | 130 'config_type': 'BaseConfig', |
126 'dependencies': {}, | 131 'dependencies': {}, |
127 } | 132 } |
128 if output_directory: | 133 if output_directory: |
| 134 output_directory = os.path.abspath(output_directory) |
129 devil_dynamic_config['dependencies'] = { | 135 devil_dynamic_config['dependencies'] = { |
130 dep_name: { | 136 dep_name: { |
131 'file_info': { | 137 'file_info': { |
132 '%s_%s' % (dep_config['platform'], dep_config['arch']): { | 138 '%s_%s' % (dep_config['platform'], dep_config['arch']): { |
133 'local_paths': [ | 139 'local_paths': [ |
134 os.path.join(output_directory, dep_config['name']), | 140 os.path.join(output_directory, dep_config['name']), |
135 ], | 141 ], |
136 } | 142 } |
137 for dep_config in dep_configs | 143 for dep_config in dep_configs |
138 } | 144 } |
139 } | 145 } |
140 for dep_name, dep_configs in _DEVIL_BUILD_PRODUCT_DEPS.iteritems() | 146 for dep_name, dep_configs in _DEVIL_BUILD_PRODUCT_DEPS.iteritems() |
141 } | 147 } |
142 if custom_deps: | 148 if custom_deps: |
143 devil_dynamic_config['dependencies'].update(custom_deps) | 149 devil_dynamic_config['dependencies'].update(custom_deps) |
144 | 150 |
145 devil_env.config.Initialize( | 151 devil_env.config.Initialize( |
146 configs=[devil_dynamic_config], config_files=[_DEVIL_CONFIG]) | 152 configs=[devil_dynamic_config], config_files=[_DEVIL_CONFIG]) |
147 | 153 |
OLD | NEW |