| 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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 | 272 |
| 273 parser.add_option('--tested-apk-config', | 273 parser.add_option('--tested-apk-config', |
| 274 help='Path to the build config of the tested apk (for an instrumentation ' | 274 help='Path to the build config of the tested apk (for an instrumentation ' |
| 275 'test apk).') | 275 'test apk).') |
| 276 parser.add_option('--proguard-enabled', action='store_true', | 276 parser.add_option('--proguard-enabled', action='store_true', |
| 277 help='Whether proguard is enabled for this apk.') | 277 help='Whether proguard is enabled for this apk.') |
| 278 parser.add_option('--proguard-info', | 278 parser.add_option('--proguard-info', |
| 279 help='Path to the proguard .info output for this apk.') | 279 help='Path to the proguard .info output for this apk.') |
| 280 parser.add_option('--has-alternative-locale-resource', action='store_true', | 280 parser.add_option('--has-alternative-locale-resource', action='store_true', |
| 281 help='Whether there is alternative-locale-resource in direct deps') | 281 help='Whether there is alternative-locale-resource in direct deps') |
| 282 parser.add_option('--fail', |
| 283 help='GYP-list of error message lines to fail with.') |
| 282 | 284 |
| 283 options, args = parser.parse_args(argv) | 285 options, args = parser.parse_args(argv) |
| 284 | 286 |
| 285 if args: | 287 if args: |
| 286 parser.error('No positional arguments should be given.') | 288 parser.error('No positional arguments should be given.') |
| 289 if options.fail: |
| 290 parser.error('\n'.join(build_utils.ParseGypList(options.fail))) |
| 287 | 291 |
| 288 required_options_map = { | 292 required_options_map = { |
| 289 'java_binary': ['build_config', 'jar_path'], | 293 'java_binary': ['build_config', 'jar_path'], |
| 290 'java_library': ['build_config', 'jar_path'], | 294 'java_library': ['build_config', 'jar_path'], |
| 291 'java_prebuilt': ['build_config', 'jar_path'], | 295 'java_prebuilt': ['build_config', 'jar_path'], |
| 292 'android_assets': ['build_config'], | 296 'android_assets': ['build_config'], |
| 293 'android_resources': ['build_config', 'resources_zip'], | 297 'android_resources': ['build_config', 'resources_zip'], |
| 294 'android_apk': ['build_config', 'jar_path', 'dex_path', 'resources_zip'], | 298 'android_apk': ['build_config', 'jar_path', 'dex_path', 'resources_zip'], |
| 295 'deps_dex': ['build_config', 'dex_path'], | 299 'deps_dex': ['build_config', 'dex_path'], |
| 296 'resource_rewriter': ['build_config'], | 300 'resource_rewriter': ['build_config'], |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 599 _MergeAssets(deps.All('android_assets'))) | 603 _MergeAssets(deps.All('android_assets'))) |
| 600 | 604 |
| 601 build_utils.WriteJson(config, options.build_config, only_if_changed=True) | 605 build_utils.WriteJson(config, options.build_config, only_if_changed=True) |
| 602 | 606 |
| 603 if options.depfile: | 607 if options.depfile: |
| 604 build_utils.WriteDepfile(options.depfile, all_inputs) | 608 build_utils.WriteDepfile(options.depfile, all_inputs) |
| 605 | 609 |
| 606 | 610 |
| 607 if __name__ == '__main__': | 611 if __name__ == '__main__': |
| 608 sys.exit(main(sys.argv[1:])) | 612 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |