OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright 2014 The Chromium Authors. All rights reserved. | 3 # Copyright 2014 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 """Writes a build_config file. | 7 """Writes a build_config file. |
8 | 8 |
9 The build_config file for a target is a json file containing information about | 9 The build_config file for a target is a json file containing information about |
10 how to build that target based on the target's dependencies. This includes | 10 how to build that target based on the target's dependencies. This includes |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 all_deps_config_paths = GetAllDepsConfigsInOrder(direct_deps_config_paths) | 132 all_deps_config_paths = GetAllDepsConfigsInOrder(direct_deps_config_paths) |
133 | 133 |
134 direct_deps_configs = [GetDepConfig(p) for p in direct_deps_config_paths] | 134 direct_deps_configs = [GetDepConfig(p) for p in direct_deps_config_paths] |
135 all_deps_configs = [GetDepConfig(p) for p in all_deps_config_paths] | 135 all_deps_configs = [GetDepConfig(p) for p in all_deps_config_paths] |
136 | 136 |
137 direct_library_deps = DepsOfType('java_library', direct_deps_configs) | 137 direct_library_deps = DepsOfType('java_library', direct_deps_configs) |
138 all_library_deps = DepsOfType('java_library', all_deps_configs) | 138 all_library_deps = DepsOfType('java_library', all_deps_configs) |
139 | 139 |
140 direct_resources_deps = DepsOfType('android_resources', direct_deps_configs) | 140 direct_resources_deps = DepsOfType('android_resources', direct_deps_configs) |
141 all_resources_deps = DepsOfType('android_resources', all_deps_configs) | 141 all_resources_deps = DepsOfType('android_resources', all_deps_configs) |
| 142 # Resources should be ordered with the highest-level dependency first so that |
| 143 # overrides are done correctly. |
| 144 all_resources_deps.reverse() |
142 | 145 |
143 # Initialize some common config. | 146 # Initialize some common config. |
144 config = { | 147 config = { |
145 'deps_info': { | 148 'deps_info': { |
146 'name': os.path.basename(options.build_config), | 149 'name': os.path.basename(options.build_config), |
147 'path': options.build_config, | 150 'path': options.build_config, |
148 'type': options.type, | 151 'type': options.type, |
149 'deps_configs': direct_deps_config_paths, | 152 'deps_configs': direct_deps_config_paths, |
150 } | 153 } |
151 } | 154 } |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 build_utils.WriteJson(config, options.build_config, only_if_changed=True) | 258 build_utils.WriteJson(config, options.build_config, only_if_changed=True) |
256 | 259 |
257 if options.depfile: | 260 if options.depfile: |
258 build_utils.WriteDepfile( | 261 build_utils.WriteDepfile( |
259 options.depfile, | 262 options.depfile, |
260 all_deps_config_paths + build_utils.GetPythonDependencies()) | 263 all_deps_config_paths + build_utils.GetPythonDependencies()) |
261 | 264 |
262 | 265 |
263 if __name__ == '__main__': | 266 if __name__ == '__main__': |
264 sys.exit(main(sys.argv[1:])) | 267 sys.exit(main(sys.argv[1:])) |
OLD | NEW |