| 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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 help='GYP-list of .srcjars that have been included in this java_library.') | 261 help='GYP-list of .srcjars that have been included in this java_library.') |
| 262 parser.add_option('--supports-android', action='store_true', | 262 parser.add_option('--supports-android', action='store_true', |
| 263 help='Whether this library supports running on the Android platform.') | 263 help='Whether this library supports running on the Android platform.') |
| 264 parser.add_option('--requires-android', action='store_true', | 264 parser.add_option('--requires-android', action='store_true', |
| 265 help='Whether this library requires running on the Android platform.') | 265 help='Whether this library requires running on the Android platform.') |
| 266 parser.add_option('--bypass-platform-checks', action='store_true', | 266 parser.add_option('--bypass-platform-checks', action='store_true', |
| 267 help='Bypass checks for support/require Android platform.') | 267 help='Bypass checks for support/require Android platform.') |
| 268 parser.add_option('--extra-classpath-jars', | 268 parser.add_option('--extra-classpath-jars', |
| 269 help='GYP-list of .jar files to include on the classpath when compiling, ' | 269 help='GYP-list of .jar files to include on the classpath when compiling, ' |
| 270 'but not to include in the final binary.') | 270 'but not to include in the final binary.') |
| 271 parser.add_option('--not-chromium-code', action='store_true', |
| 272 help='Whether this library is chromium code or not.') |
| 271 | 273 |
| 272 # android library options | 274 # android library options |
| 273 parser.add_option('--dex-path', help='Path to target\'s dex output.') | 275 parser.add_option('--dex-path', help='Path to target\'s dex output.') |
| 274 | 276 |
| 275 # native library options | 277 # native library options |
| 276 parser.add_option('--shared-libraries-runtime-deps', | 278 parser.add_option('--shared-libraries-runtime-deps', |
| 277 help='Path to file containing runtime deps for shared ' | 279 help='Path to file containing runtime deps for shared ' |
| 278 'libraries.') | 280 'libraries.') |
| 279 parser.add_option('--secondary-abi-shared-libraries-runtime-deps', | 281 parser.add_option('--secondary-abi-shared-libraries-runtime-deps', |
| 280 help='Path to file containing runtime deps for secondary ' | 282 help='Path to file containing runtime deps for secondary ' |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 'resource_rewriter': ['build_config'], | 320 'resource_rewriter': ['build_config'], |
| 319 'group': ['build_config'], | 321 'group': ['build_config'], |
| 320 } | 322 } |
| 321 required_options = required_options_map.get(options.type) | 323 required_options = required_options_map.get(options.type) |
| 322 if not required_options: | 324 if not required_options: |
| 323 raise Exception('Unknown type: <%s>' % options.type) | 325 raise Exception('Unknown type: <%s>' % options.type) |
| 324 | 326 |
| 325 build_utils.CheckOptions(options, parser, required_options) | 327 build_utils.CheckOptions(options, parser, required_options) |
| 326 | 328 |
| 327 # Java prebuilts are the same as libraries except for in gradle files. | 329 # Java prebuilts are the same as libraries except for in gradle files. |
| 328 is_java_prebuilt = options.type == 'java_prebuilt' | 330 is_java_prebuilt = ( |
| 331 options.type == 'java_prebuilt' or options.not_chromium_code) |
| 329 if is_java_prebuilt: | 332 if is_java_prebuilt: |
| 330 options.type = 'java_library' | 333 options.type = 'java_library' |
| 331 | 334 |
| 332 if options.type == 'java_library': | 335 if options.type == 'java_library': |
| 333 if options.supports_android and not options.dex_path: | 336 if options.supports_android and not options.dex_path: |
| 334 raise Exception('java_library that supports Android requires a dex path.') | 337 raise Exception('java_library that supports Android requires a dex path.') |
| 335 | 338 |
| 336 if options.requires_android and not options.supports_android: | 339 if options.requires_android and not options.supports_android: |
| 337 raise Exception( | 340 raise Exception( |
| 338 '--supports-android is required when using --requires-android') | 341 '--supports-android is required when using --requires-android') |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 652 _CreateLocalePaksAssetJavaList(config['uncompressed_assets'])) | 655 _CreateLocalePaksAssetJavaList(config['uncompressed_assets'])) |
| 653 | 656 |
| 654 build_utils.WriteJson(config, options.build_config, only_if_changed=True) | 657 build_utils.WriteJson(config, options.build_config, only_if_changed=True) |
| 655 | 658 |
| 656 if options.depfile: | 659 if options.depfile: |
| 657 build_utils.WriteDepfile(options.depfile, options.build_config, all_inputs) | 660 build_utils.WriteDepfile(options.depfile, options.build_config, all_inputs) |
| 658 | 661 |
| 659 | 662 |
| 660 if __name__ == '__main__': | 663 if __name__ == '__main__': |
| 661 sys.exit(main(sys.argv[1:])) | 664 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |