| 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 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 | 330 |
| 331 if options.requires_android and not options.supports_android: | 331 if options.requires_android and not options.supports_android: |
| 332 raise Exception( | 332 raise Exception( |
| 333 '--supports-android is required when using --requires-android') | 333 '--supports-android is required when using --requires-android') |
| 334 | 334 |
| 335 direct_deps_config_paths = build_utils.ParseGnList(options.deps_configs) | 335 direct_deps_config_paths = build_utils.ParseGnList(options.deps_configs) |
| 336 direct_deps_config_paths = _FilterDepsPaths(direct_deps_config_paths, | 336 direct_deps_config_paths = _FilterDepsPaths(direct_deps_config_paths, |
| 337 options.type) | 337 options.type) |
| 338 | 338 |
| 339 deps = Deps(direct_deps_config_paths) | 339 deps = Deps(direct_deps_config_paths) |
| 340 all_inputs = deps.AllConfigPaths() + build_utils.GetPythonDependencies() | 340 all_inputs = deps.AllConfigPaths() |
| 341 | 341 |
| 342 # Remove other locale resources if there is alternative_locale_resource in | 342 # Remove other locale resources if there is alternative_locale_resource in |
| 343 # direct deps. | 343 # direct deps. |
| 344 if options.has_alternative_locale_resource: | 344 if options.has_alternative_locale_resource: |
| 345 alternative = [r['path'] for r in deps.Direct('android_resources') | 345 alternative = [r['path'] for r in deps.Direct('android_resources') |
| 346 if r.get('is_locale_resource')] | 346 if r.get('is_locale_resource')] |
| 347 # We can only have one locale resources in direct deps. | 347 # We can only have one locale resources in direct deps. |
| 348 if len(alternative) != 1: | 348 if len(alternative) != 1: |
| 349 raise Exception('The number of locale resource in direct deps is wrong %d' | 349 raise Exception('The number of locale resource in direct deps is wrong %d' |
| 350 % len(alternative)) | 350 % len(alternative)) |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 655 'secondary_abi_libraries': secondary_abi_library_paths, | 655 'secondary_abi_libraries': secondary_abi_library_paths, |
| 656 'java_libraries_list': java_libraries_list, | 656 'java_libraries_list': java_libraries_list, |
| 657 'secondary_abi_java_libraries_list': secondary_abi_java_libraries_list, | 657 'secondary_abi_java_libraries_list': secondary_abi_java_libraries_list, |
| 658 } | 658 } |
| 659 config['assets'], config['uncompressed_assets'] = ( | 659 config['assets'], config['uncompressed_assets'] = ( |
| 660 _MergeAssets(deps.All('android_assets'))) | 660 _MergeAssets(deps.All('android_assets'))) |
| 661 | 661 |
| 662 build_utils.WriteJson(config, options.build_config, only_if_changed=True) | 662 build_utils.WriteJson(config, options.build_config, only_if_changed=True) |
| 663 | 663 |
| 664 if options.depfile: | 664 if options.depfile: |
| 665 build_utils.WriteDepfile(options.depfile, all_inputs) | 665 build_utils.WriteDepfile(options.depfile, options.build_config, all_inputs) |
| 666 | 666 |
| 667 | 667 |
| 668 if __name__ == '__main__': | 668 if __name__ == '__main__': |
| 669 sys.exit(main(sys.argv[1:])) | 669 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |