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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 if options.supports_android and not options.dex_path: | 275 if options.supports_android and not options.dex_path: |
276 raise Exception('java_library that supports Android requires a dex path.') | 276 raise Exception('java_library that supports Android requires a dex path.') |
277 | 277 |
278 if options.requires_android and not options.supports_android: | 278 if options.requires_android and not options.supports_android: |
279 raise Exception( | 279 raise Exception( |
280 '--supports-android is required when using --requires-android') | 280 '--supports-android is required when using --requires-android') |
281 | 281 |
282 possible_deps_config_paths = build_utils.ParseGypList( | 282 possible_deps_config_paths = build_utils.ParseGypList( |
283 options.possible_deps_configs) | 283 options.possible_deps_configs) |
284 | 284 |
285 allow_unknown_deps = (options.type in | |
286 ('android_apk', 'android_assets', 'android_resources')) | |
287 unknown_deps = [ | 285 unknown_deps = [ |
288 c for c in possible_deps_config_paths if not os.path.exists(c)] | 286 c for c in possible_deps_config_paths if not os.path.exists(c)] |
289 if unknown_deps and not allow_unknown_deps: | |
290 raise Exception('Unknown deps: ' + str(unknown_deps)) | |
291 | 287 |
292 direct_deps_config_paths = [ | 288 direct_deps_config_paths = [ |
293 c for c in possible_deps_config_paths if not c in unknown_deps] | 289 c for c in possible_deps_config_paths if not c in unknown_deps] |
294 direct_deps_config_paths = _FilterUnwantedDepsPaths(direct_deps_config_paths, | 290 direct_deps_config_paths = _FilterUnwantedDepsPaths(direct_deps_config_paths, |
295 options.type) | 291 options.type) |
296 | 292 |
297 deps = Deps(direct_deps_config_paths) | 293 deps = Deps(direct_deps_config_paths) |
298 all_inputs = deps.AllConfigPaths() + build_utils.GetPythonDependencies() | 294 all_inputs = deps.AllConfigPaths() + build_utils.GetPythonDependencies() |
299 | 295 |
300 # Remove other locale resources if there is alternative_locale_resource in | 296 # Remove other locale resources if there is alternative_locale_resource in |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 _MergeAssets(deps.All('android_assets'))) | 525 _MergeAssets(deps.All('android_assets'))) |
530 | 526 |
531 build_utils.WriteJson(config, options.build_config, only_if_changed=True) | 527 build_utils.WriteJson(config, options.build_config, only_if_changed=True) |
532 | 528 |
533 if options.depfile: | 529 if options.depfile: |
534 build_utils.WriteDepfile(options.depfile, all_inputs) | 530 build_utils.WriteDepfile(options.depfile, all_inputs) |
535 | 531 |
536 | 532 |
537 if __name__ == '__main__': | 533 if __name__ == '__main__': |
538 sys.exit(main(sys.argv[1:])) | 534 sys.exit(main(sys.argv[1:])) |
OLD | NEW |