| 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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 # android library options | 246 # android library options |
| 247 parser.add_option('--dex-path', help='Path to target\'s dex output.') | 247 parser.add_option('--dex-path', help='Path to target\'s dex output.') |
| 248 | 248 |
| 249 # native library options | 249 # native library options |
| 250 parser.add_option('--shared-libraries-runtime-deps', | 250 parser.add_option('--shared-libraries-runtime-deps', |
| 251 help='Path to file containing runtime deps for shared ' | 251 help='Path to file containing runtime deps for shared ' |
| 252 'libraries.') | 252 'libraries.') |
| 253 | 253 |
| 254 # apk options | 254 # apk options |
| 255 parser.add_option('--apk-path', help='Path to the target\'s apk output.') | 255 parser.add_option('--apk-path', help='Path to the target\'s apk output.') |
| 256 parser.add_option('--apk-for-test-path', |
| 257 help='Path to the target\'s testable apk output.') |
| 256 parser.add_option('--incremental-apk-path', | 258 parser.add_option('--incremental-apk-path', |
| 257 help="Path to the target's incremental apk output.") | 259 help="Path to the target's incremental apk output.") |
| 258 parser.add_option('--incremental-install-script-path', | 260 parser.add_option('--incremental-install-script-path', |
| 259 help="Path to the target's generated incremental install " | 261 help="Path to the target's generated incremental install " |
| 260 "script.") | 262 "script.") |
| 261 | 263 |
| 262 parser.add_option('--tested-apk-config', | 264 parser.add_option('--tested-apk-config', |
| 263 help='Path to the build config of the tested apk (for an instrumentation ' | 265 help='Path to the build config of the tested apk (for an instrumentation ' |
| 264 'test apk).') | 266 'test apk).') |
| 265 parser.add_option('--proguard-enabled', action='store_true', | 267 parser.add_option('--proguard-enabled', action='store_true', |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 raise Exception('Not all deps support the Android platform: ' + | 389 raise Exception('Not all deps support the Android platform: ' + |
| 388 str(deps_not_support_android)) | 390 str(deps_not_support_android)) |
| 389 | 391 |
| 390 if options.type in ('java_binary', 'java_library', 'android_apk'): | 392 if options.type in ('java_binary', 'java_library', 'android_apk'): |
| 391 deps_info['resources_deps'] = [c['path'] for c in all_resources_deps] | 393 deps_info['resources_deps'] = [c['path'] for c in all_resources_deps] |
| 392 deps_info['jar_path'] = options.jar_path | 394 deps_info['jar_path'] = options.jar_path |
| 393 if options.type == 'android_apk' or options.supports_android: | 395 if options.type == 'android_apk' or options.supports_android: |
| 394 deps_info['dex_path'] = options.dex_path | 396 deps_info['dex_path'] = options.dex_path |
| 395 if options.type == 'android_apk': | 397 if options.type == 'android_apk': |
| 396 deps_info['apk_path'] = options.apk_path | 398 deps_info['apk_path'] = options.apk_path |
| 399 deps_info['apk_for_test_path'] = options.apk_for_test_path |
| 397 deps_info['incremental_apk_path'] = options.incremental_apk_path | 400 deps_info['incremental_apk_path'] = options.incremental_apk_path |
| 398 deps_info['incremental_install_script_path'] = ( | 401 deps_info['incremental_install_script_path'] = ( |
| 399 options.incremental_install_script_path) | 402 options.incremental_install_script_path) |
| 400 | 403 |
| 401 # Classpath values filled in below (after applying tested_apk_config). | 404 # Classpath values filled in below (after applying tested_apk_config). |
| 402 config['javac'] = {} | 405 config['javac'] = {} |
| 403 | 406 |
| 404 | 407 |
| 405 if options.type in ('java_binary', 'java_library'): | 408 if options.type in ('java_binary', 'java_library'): |
| 406 # Only resources might have srcjars (normal srcjar targets are listed in | 409 # Only resources might have srcjars (normal srcjar targets are listed in |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 577 _MergeAssets(deps.All('android_assets'))) | 580 _MergeAssets(deps.All('android_assets'))) |
| 578 | 581 |
| 579 build_utils.WriteJson(config, options.build_config, only_if_changed=True) | 582 build_utils.WriteJson(config, options.build_config, only_if_changed=True) |
| 580 | 583 |
| 581 if options.depfile: | 584 if options.depfile: |
| 582 build_utils.WriteDepfile(options.depfile, all_inputs) | 585 build_utils.WriteDepfile(options.depfile, all_inputs) |
| 583 | 586 |
| 584 | 587 |
| 585 if __name__ == '__main__': | 588 if __name__ == '__main__': |
| 586 sys.exit(main(sys.argv[1:])) | 589 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |