| 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 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 if options.main_class: | 426 if options.main_class: |
| 427 gradle['main_class'] = options.main_class | 427 gradle['main_class'] = options.main_class |
| 428 | 428 |
| 429 for c in deps.GradleLibraryProjectDeps(): | 429 for c in deps.GradleLibraryProjectDeps(): |
| 430 if c['requires_android']: | 430 if c['requires_android']: |
| 431 gradle['dependent_android_projects'].append(c['path']) | 431 gradle['dependent_android_projects'].append(c['path']) |
| 432 else: | 432 else: |
| 433 gradle['dependent_java_projects'].append(c['path']) | 433 gradle['dependent_java_projects'].append(c['path']) |
| 434 | 434 |
| 435 | 435 |
| 436 if (options.type in ('java_binary', 'java_library') and | 436 if (options.type in ('java_binary', 'java_library')): |
| 437 not options.bypass_platform_checks): | |
| 438 deps_info['requires_android'] = options.requires_android | 437 deps_info['requires_android'] = options.requires_android |
| 439 deps_info['supports_android'] = options.supports_android | 438 deps_info['supports_android'] = options.supports_android |
| 440 | 439 |
| 441 deps_require_android = (all_resources_deps + | 440 if not options.bypass_platform_checks: |
| 442 [d['name'] for d in all_library_deps if d['requires_android']]) | 441 deps_require_android = (all_resources_deps + |
| 443 deps_not_support_android = ( | 442 [d['name'] for d in all_library_deps if d['requires_android']]) |
| 444 [d['name'] for d in all_library_deps if not d['supports_android']]) | 443 deps_not_support_android = ( |
| 444 [d['name'] for d in all_library_deps if not d['supports_android']]) |
| 445 | 445 |
| 446 if deps_require_android and not options.requires_android: | 446 if deps_require_android and not options.requires_android: |
| 447 raise Exception('Some deps require building for the Android platform: ' + | 447 raise Exception('Some deps require building for the Android platform: ' |
| 448 str(deps_require_android)) | 448 + str(deps_require_android)) |
| 449 | 449 |
| 450 if deps_not_support_android and options.supports_android: | 450 if deps_not_support_android and options.supports_android: |
| 451 raise Exception('Not all deps support the Android platform: ' + | 451 raise Exception('Not all deps support the Android platform: ' |
| 452 str(deps_not_support_android)) | 452 + str(deps_not_support_android)) |
| 453 | 453 |
| 454 if options.type in ('java_binary', 'java_library', 'android_apk'): | 454 if options.type in ('java_binary', 'java_library', 'android_apk'): |
| 455 deps_info['jar_path'] = options.jar_path | 455 deps_info['jar_path'] = options.jar_path |
| 456 if options.type == 'android_apk' or options.supports_android: | 456 if options.type == 'android_apk' or options.supports_android: |
| 457 deps_info['dex_path'] = options.dex_path | 457 deps_info['dex_path'] = options.dex_path |
| 458 if options.type == 'android_apk': | 458 if options.type == 'android_apk': |
| 459 deps_info['apk_path'] = options.apk_path | 459 deps_info['apk_path'] = options.apk_path |
| 460 deps_info['incremental_apk_path'] = options.incremental_apk_path | 460 deps_info['incremental_apk_path'] = options.incremental_apk_path |
| 461 deps_info['incremental_install_script_path'] = ( | 461 deps_info['incremental_install_script_path'] = ( |
| 462 options.incremental_install_script_path) | 462 options.incremental_install_script_path) |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 709 deps_info['java_resources_jar'] = options.java_resources_jar_path | 709 deps_info['java_resources_jar'] = options.java_resources_jar_path |
| 710 | 710 |
| 711 build_utils.WriteJson(config, options.build_config, only_if_changed=True) | 711 build_utils.WriteJson(config, options.build_config, only_if_changed=True) |
| 712 | 712 |
| 713 if options.depfile: | 713 if options.depfile: |
| 714 build_utils.WriteDepfile(options.depfile, options.build_config, all_inputs) | 714 build_utils.WriteDepfile(options.depfile, options.build_config, all_inputs) |
| 715 | 715 |
| 716 | 716 |
| 717 if __name__ == '__main__': | 717 if __name__ == '__main__': |
| 718 sys.exit(main(sys.argv[1:])) | 718 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |