Chromium Code Reviews| 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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 257 help='GYP-list of .jar files to include on the classpath when compiling, ' | 257 help='GYP-list of .jar files to include on the classpath when compiling, ' |
| 258 'but not to include in the final binary.') | 258 'but not to include in the final binary.') |
| 259 | 259 |
| 260 # android library options | 260 # android library options |
| 261 parser.add_option('--dex-path', help='Path to target\'s dex output.') | 261 parser.add_option('--dex-path', help='Path to target\'s dex output.') |
| 262 | 262 |
| 263 # native library options | 263 # native library options |
| 264 parser.add_option('--shared-libraries-runtime-deps', | 264 parser.add_option('--shared-libraries-runtime-deps', |
| 265 help='Path to file containing runtime deps for shared ' | 265 help='Path to file containing runtime deps for shared ' |
| 266 'libraries.') | 266 'libraries.') |
| 267 parser.add_option('--secondary-abi-shared-libraries-runtime-deps', | |
| 268 help='Path to file containing runtime deps for secondary ' | |
| 269 'abi shared libraries.') | |
| 267 | 270 |
| 268 # apk options | 271 # apk options |
| 269 parser.add_option('--apk-path', help='Path to the target\'s apk output.') | 272 parser.add_option('--apk-path', help='Path to the target\'s apk output.') |
| 270 parser.add_option('--incremental-apk-path', | 273 parser.add_option('--incremental-apk-path', |
| 271 help="Path to the target's incremental apk output.") | 274 help="Path to the target's incremental apk output.") |
| 272 parser.add_option('--incremental-install-script-path', | 275 parser.add_option('--incremental-install-script-path', |
| 273 help="Path to the target's generated incremental install " | 276 help="Path to the target's generated incremental install " |
| 274 "script.") | 277 "script.") |
| 275 | 278 |
| 276 parser.add_option('--tested-apk-config', | 279 parser.add_option('--tested-apk-config', |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 627 java_libraries_list = None | 630 java_libraries_list = None |
| 628 runtime_deps_files = build_utils.ParseGnList( | 631 runtime_deps_files = build_utils.ParseGnList( |
| 629 options.shared_libraries_runtime_deps or '[]') | 632 options.shared_libraries_runtime_deps or '[]') |
| 630 if runtime_deps_files: | 633 if runtime_deps_files: |
| 631 library_paths = _ExtractSharedLibsFromRuntimeDeps(runtime_deps_files) | 634 library_paths = _ExtractSharedLibsFromRuntimeDeps(runtime_deps_files) |
| 632 # Create a java literal array with the "base" library names: | 635 # Create a java literal array with the "base" library names: |
| 633 # e.g. libfoo.so -> foo | 636 # e.g. libfoo.so -> foo |
| 634 java_libraries_list = ('{%s}' % ','.join( | 637 java_libraries_list = ('{%s}' % ','.join( |
| 635 ['"%s"' % s[3:-3] for s in library_paths])) | 638 ['"%s"' % s[3:-3] for s in library_paths])) |
| 636 | 639 |
| 640 secondary_abi_library_paths = [] | |
| 641 secondary_abi_java_libraries_list = None | |
| 642 secondary_abi_runtime_deps_files = build_utils.ParseGnList( | |
| 643 options.secondary_abi_shared_libraries_runtime_deps or '[]') | |
| 644 if secondary_abi_runtime_deps_files: | |
| 645 secondary_abi_library_paths = _ExtractSharedLibsFromRuntimeDeps( | |
| 646 secondary_abi_runtime_deps_files) | |
| 647 secondary_abi_java_libraries_list = ('{%s}' % ','.join( | |
|
agrieve
2016/09/08 01:02:15
nit: this line is non-trivial. Would be better as
michaelbai
2016/09/08 18:52:51
Done.
| |
| 648 ['"%s"' % s[3:-3] for s in secondary_abi_library_paths])) | |
| 649 | |
| 637 all_inputs.extend(runtime_deps_files) | 650 all_inputs.extend(runtime_deps_files) |
| 638 config['native'] = { | 651 config['native'] = { |
| 639 'libraries': library_paths, | 652 'libraries': library_paths, |
| 653 'secondary_abi_libraries': secondary_abi_library_paths, | |
| 640 'java_libraries_list': java_libraries_list, | 654 'java_libraries_list': java_libraries_list, |
| 655 'secondary_abi_java_libraries_list': secondary_abi_java_libraries_list, | |
| 641 } | 656 } |
| 642 config['assets'], config['uncompressed_assets'] = ( | 657 config['assets'], config['uncompressed_assets'] = ( |
| 643 _MergeAssets(deps.All('android_assets'))) | 658 _MergeAssets(deps.All('android_assets'))) |
| 644 | 659 |
| 645 build_utils.WriteJson(config, options.build_config, only_if_changed=True) | 660 build_utils.WriteJson(config, options.build_config, only_if_changed=True) |
| 646 | 661 |
| 647 if options.depfile: | 662 if options.depfile: |
| 648 build_utils.WriteDepfile(options.depfile, all_inputs) | 663 build_utils.WriteDepfile(options.depfile, all_inputs) |
| 649 | 664 |
| 650 | 665 |
| 651 if __name__ == '__main__': | 666 if __name__ == '__main__': |
| 652 sys.exit(main(sys.argv[1:])) | 667 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |