| 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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 parser.add_option('--asset-renaming-sources', | 229 parser.add_option('--asset-renaming-sources', |
| 230 help='List of asset sources with custom destinations.') | 230 help='List of asset sources with custom destinations.') |
| 231 parser.add_option('--asset-renaming-destinations', | 231 parser.add_option('--asset-renaming-destinations', |
| 232 help='List of asset custom destinations.') | 232 help='List of asset custom destinations.') |
| 233 parser.add_option('--disable-asset-compression', action='store_true', | 233 parser.add_option('--disable-asset-compression', action='store_true', |
| 234 help='Whether to disable asset compression.') | 234 help='Whether to disable asset compression.') |
| 235 | 235 |
| 236 # java library options | 236 # java library options |
| 237 parser.add_option('--jar-path', help='Path to target\'s jar output.') | 237 parser.add_option('--jar-path', help='Path to target\'s jar output.') |
| 238 parser.add_option('--java-sources-file', help='Path to .sources file') | 238 parser.add_option('--java-sources-file', help='Path to .sources file') |
| 239 parser.add_option('--bundled-srcjars', |
| 240 help='GYP-list of .srcjars that have been included in this java_library.') |
| 239 parser.add_option('--supports-android', action='store_true', | 241 parser.add_option('--supports-android', action='store_true', |
| 240 help='Whether this library supports running on the Android platform.') | 242 help='Whether this library supports running on the Android platform.') |
| 241 parser.add_option('--requires-android', action='store_true', | 243 parser.add_option('--requires-android', action='store_true', |
| 242 help='Whether this library requires running on the Android platform.') | 244 help='Whether this library requires running on the Android platform.') |
| 243 parser.add_option('--bypass-platform-checks', action='store_true', | 245 parser.add_option('--bypass-platform-checks', action='store_true', |
| 244 help='Bypass checks for support/require Android platform.') | 246 help='Bypass checks for support/require Android platform.') |
| 245 | 247 |
| 246 # android library options | 248 # android library options |
| 247 parser.add_option('--dex-path', help='Path to target\'s dex output.') | 249 parser.add_option('--dex-path', help='Path to target\'s dex output.') |
| 248 | 250 |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 | 359 |
| 358 # Required for generating gradle files. | 360 # Required for generating gradle files. |
| 359 if options.type == 'java_library': | 361 if options.type == 'java_library': |
| 360 deps_info['is_prebuilt'] = is_java_prebuilt | 362 deps_info['is_prebuilt'] = is_java_prebuilt |
| 361 | 363 |
| 362 if options.android_manifest: | 364 if options.android_manifest: |
| 363 gradle['android_manifest'] = options.android_manifest | 365 gradle['android_manifest'] = options.android_manifest |
| 364 if options.type in ('java_binary', 'java_library', 'android_apk'): | 366 if options.type in ('java_binary', 'java_library', 'android_apk'): |
| 365 if options.java_sources_file: | 367 if options.java_sources_file: |
| 366 gradle['java_sources_file'] = options.java_sources_file | 368 gradle['java_sources_file'] = options.java_sources_file |
| 369 if options.bundled_srcjars: |
| 370 gradle['bundled_srcjars'] = ( |
| 371 build_utils.ParseGypList(options.bundled_srcjars)) |
| 372 |
| 367 gradle['dependent_prebuilt_jars'] = deps.PrebuiltJarPaths() | 373 gradle['dependent_prebuilt_jars'] = deps.PrebuiltJarPaths() |
| 368 gradle['dependent_projects'] = ( | 374 |
| 369 [c['path'] for c in direct_library_deps if not c['is_prebuilt']]) | 375 gradle['dependent_android_projects'] = [] |
| 376 gradle['dependent_java_projects'] = [] |
| 377 for c in direct_library_deps: |
| 378 if not c['is_prebuilt']: |
| 379 if c['requires_android']: |
| 380 gradle['dependent_android_projects'].append(c['path']) |
| 381 else: |
| 382 gradle['dependent_java_projects'].append(c['path']) |
| 370 | 383 |
| 371 | 384 |
| 372 if (options.type in ('java_binary', 'java_library') and | 385 if (options.type in ('java_binary', 'java_library') and |
| 373 not options.bypass_platform_checks): | 386 not options.bypass_platform_checks): |
| 374 deps_info['requires_android'] = options.requires_android | 387 deps_info['requires_android'] = options.requires_android |
| 375 deps_info['supports_android'] = options.supports_android | 388 deps_info['supports_android'] = options.supports_android |
| 376 | 389 |
| 377 deps_require_android = (all_resources_deps + | 390 deps_require_android = (all_resources_deps + |
| 378 [d['name'] for d in all_library_deps if d['requires_android']]) | 391 [d['name'] for d in all_library_deps if d['requires_android']]) |
| 379 deps_not_support_android = ( | 392 deps_not_support_android = ( |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 577 _MergeAssets(deps.All('android_assets'))) | 590 _MergeAssets(deps.All('android_assets'))) |
| 578 | 591 |
| 579 build_utils.WriteJson(config, options.build_config, only_if_changed=True) | 592 build_utils.WriteJson(config, options.build_config, only_if_changed=True) |
| 580 | 593 |
| 581 if options.depfile: | 594 if options.depfile: |
| 582 build_utils.WriteDepfile(options.depfile, all_inputs) | 595 build_utils.WriteDepfile(options.depfile, all_inputs) |
| 583 | 596 |
| 584 | 597 |
| 585 if __name__ == '__main__': | 598 if __name__ == '__main__': |
| 586 sys.exit(main(sys.argv[1:])) | 599 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |