Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import("//build/config/android/config.gni") | 5 import("//build/config/android/config.gni") |
| 6 import("//build/config/zip.gni") | 6 import("//build/config/zip.gni") |
| 7 import("//third_party/ijar/ijar.gni") | 7 import("//third_party/ijar/ijar.gni") |
| 8 | 8 |
| 9 assert(is_android) | 9 assert(is_android) |
| 10 | 10 |
| (...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 538 | 538 |
| 539 # Creates an unsigned .apk. | 539 # Creates an unsigned .apk. |
| 540 # | 540 # |
| 541 # Variables | 541 # Variables |
| 542 # assets_build_config: Path to android_apk .build_config containing merged | 542 # assets_build_config: Path to android_apk .build_config containing merged |
| 543 # asset information. | 543 # asset information. |
| 544 # deps: Specifies the dependencies of this target. | 544 # deps: Specifies the dependencies of this target. |
| 545 # dex_path: Path to classes.dex file to include (optional). | 545 # dex_path: Path to classes.dex file to include (optional). |
| 546 # resource_packaged_apk_path: Path to .ap_ to use. | 546 # resource_packaged_apk_path: Path to .ap_ to use. |
| 547 # output_apk_path: Output path for the generated .apk. | 547 # output_apk_path: Output path for the generated .apk. |
| 548 # native_lib_placeholders: List of placeholder filenames to add to the apk | |
| 549 # (optional). | |
| 548 # native_libs_dir: Directory containing native libraries. | 550 # native_libs_dir: Directory containing native libraries. |
| 549 # create_placeholder_lib: Whether to add a dummy lib to the apk. | |
| 550 template("package_apk") { | 551 template("package_apk") { |
| 551 action(target_name) { | 552 action(target_name) { |
| 552 forward_variables_from(invoker, | 553 forward_variables_from(invoker, |
| 553 [ | 554 [ |
| 554 "deps", | 555 "deps", |
| 555 "public_deps", | 556 "public_deps", |
| 556 "testonly", | 557 "testonly", |
| 557 ]) | 558 ]) |
| 558 _create_placeholder_lib = defined(invoker.create_placeholder_lib) && | 559 _native_lib_placeholders = [] |
| 559 invoker.create_placeholder_lib | 560 if (defined(invoker.native_lib_placeholders)) { |
| 561 _native_lib_placeholders = invoker.native_lib_placeholders | |
| 562 } | |
| 560 | 563 |
| 561 script = "//build/android/gyp/apkbuilder.py" | 564 script = "//build/android/gyp/apkbuilder.py" |
| 562 depfile = "$target_gen_dir/$target_name.d" | 565 depfile = "$target_gen_dir/$target_name.d" |
| 563 data_deps = [ | 566 data_deps = [ |
| 564 "//tools/android/md5sum", | 567 "//tools/android/md5sum", |
| 565 ] # Used when deploying APKs | 568 ] # Used when deploying APKs |
| 566 | 569 |
| 567 inputs = [ | 570 inputs = [ |
| 568 invoker.resource_packaged_apk_path, | 571 invoker.resource_packaged_apk_path, |
| 569 ] | 572 ] |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 592 rebase_path(invoker.assets_build_config, root_build_dir) | 595 rebase_path(invoker.assets_build_config, root_build_dir) |
| 593 args += [ | 596 args += [ |
| 594 "--assets=@FileArg($_rebased_build_config:assets)", | 597 "--assets=@FileArg($_rebased_build_config:assets)", |
| 595 "--uncompressed-assets=@FileArg($_rebased_build_config:uncompressed_asse ts)", | 598 "--uncompressed-assets=@FileArg($_rebased_build_config:uncompressed_asse ts)", |
| 596 ] | 599 ] |
| 597 } | 600 } |
| 598 if (defined(invoker.dex_path)) { | 601 if (defined(invoker.dex_path)) { |
| 599 _rebased_dex_path = rebase_path(invoker.dex_path, root_build_dir) | 602 _rebased_dex_path = rebase_path(invoker.dex_path, root_build_dir) |
| 600 args += [ "--dex-file=$_rebased_dex_path" ] | 603 args += [ "--dex-file=$_rebased_dex_path" ] |
| 601 } | 604 } |
| 602 if (defined(invoker.native_libs_dir) || _create_placeholder_lib) { | 605 if (defined(invoker.native_libs_dir) || _native_lib_placeholders != []) { |
| 603 args += [ "--android-abi=$android_app_abi" ] | 606 args += [ "--android-abi=$android_app_abi" ] |
| 604 } | 607 } |
| 605 if (defined(invoker.native_libs_dir)) { | 608 if (defined(invoker.native_libs_dir)) { |
| 606 _rebased_native_libs_dir = | 609 _rebased_native_libs_dir = |
| 607 rebase_path(invoker.native_libs_dir, root_build_dir) | 610 rebase_path(invoker.native_libs_dir, root_build_dir) |
| 608 args += [ "--native-libs-dir=$_rebased_native_libs_dir/$android_app_abi" ] | 611 args += [ "--native-libs-dir=$_rebased_native_libs_dir/$android_app_abi" ] |
| 609 } | 612 } |
| 610 if (_create_placeholder_lib) { | 613 if (_native_lib_placeholders != []) { |
| 611 args += [ "--create-placeholder-lib" ] | 614 args += [ "--native-lib-placeholders=$_native_lib_placeholders" ] |
| 612 } | 615 } |
| 613 } | 616 } |
| 614 } | 617 } |
| 615 | 618 |
| 616 # Signs & zipaligns an apk. | 619 # Signs & zipaligns an apk. |
| 617 # | 620 # |
| 618 # Variables | 621 # Variables |
| 619 # input_apk_path: Path of the .apk to be finalized. | 622 # input_apk_path: Path of the .apk to be finalized. |
| 620 # output_apk_path: Output path for the generated .apk. | 623 # output_apk_path: Output path for the generated .apk. |
| 621 # keystore_path: Path to keystore to use for signing. | 624 # keystore_path: Path to keystore to use for signing. |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 871 _incremental_deps + [ ":$_generate_incremental_manifest_target_name" ] | 874 _incremental_deps + [ ":$_generate_incremental_manifest_target_name" ] |
| 872 android_manifest = _incremental_android_manifest | 875 android_manifest = _incremental_android_manifest |
| 873 resource_packaged_apk_path = _incremental_resource_packaged_apk_path | 876 resource_packaged_apk_path = _incremental_resource_packaged_apk_path |
| 874 } | 877 } |
| 875 | 878 |
| 876 package_target = "${target_name}__package" | 879 package_target = "${target_name}__package" |
| 877 package_apk(package_target) { | 880 package_apk(package_target) { |
| 878 forward_variables_from(invoker, | 881 forward_variables_from(invoker, |
| 879 [ | 882 [ |
| 880 "assets_build_config", | 883 "assets_build_config", |
| 884 "native_lib_placeholders", | |
| 881 "native_libs_dir", | 885 "native_libs_dir", |
| 882 ]) | 886 ]) |
| 883 deps = _deps + [ ":${_package_resources_target_name}" ] | 887 deps = _deps + [ ":${_package_resources_target_name}" ] |
| 884 | 888 |
| 885 if (defined(_dex_path)) { | 889 if (defined(_dex_path)) { |
| 886 dex_path = _dex_path | 890 dex_path = _dex_path |
| 887 } | 891 } |
| 888 | 892 |
| 889 output_apk_path = _packaged_apk_path | 893 output_apk_path = _packaged_apk_path |
| 890 resource_packaged_apk_path = _resource_packaged_apk_path | 894 resource_packaged_apk_path = _resource_packaged_apk_path |
| 891 } | 895 } |
| 892 | 896 |
| 893 _incremental_package_target = "${target_name}_incremental__package" | 897 _incremental_package_target = "${target_name}_incremental__package" |
| 894 package_apk(_incremental_package_target) { | 898 package_apk(_incremental_package_target) { |
| 895 forward_variables_from(invoker, [ "assets_build_config" ]) | 899 forward_variables_from(invoker, [ "assets_build_config" ]) |
| 896 _dex_target = "//build/android/incremental_install:bootstrap_java__dex" | 900 _dex_target = "//build/android/incremental_install:bootstrap_java__dex" |
| 897 deps = _incremental_deps + [ | 901 deps = _incremental_deps + [ |
| 898 ":${_incremental_package_resources_target_name}", | 902 ":${_incremental_package_resources_target_name}", |
| 899 _dex_target, | 903 _dex_target, |
| 900 ] | 904 ] |
| 901 | 905 |
| 902 if (defined(_dex_path)) { | 906 if (defined(_dex_path)) { |
| 903 dex_path = | 907 dex_path = |
| 904 get_label_info(_dex_target, "target_gen_dir") + "/bootstrap.dex" | 908 get_label_info(_dex_target, "target_gen_dir") + "/bootstrap.dex" |
| 905 } | 909 } |
| 906 | 910 |
| 907 # http://crbug.com/384638 | 911 # http://crbug.com/384638 |
| 908 if (defined(invoker.native_libs_dir)) { | 912 if (defined(invoker.native_libs_dir)) { |
| 909 create_placeholder_lib = true | 913 native_lib_placeholders = [ "libfix.crbug.384638.so" ] |
|
pkotwicz
2015/11/16 19:28:22
I think that GYP appends "libfix.crbug.384638.so"
agrieve
2015/11/16 19:45:15
I think that may have just been out of convenience
| |
| 910 } | 914 } |
| 911 | 915 |
| 912 output_apk_path = _incremental_packaged_apk_path | 916 output_apk_path = _incremental_packaged_apk_path |
| 913 resource_packaged_apk_path = _incremental_resource_packaged_apk_path | 917 resource_packaged_apk_path = _incremental_resource_packaged_apk_path |
| 914 } | 918 } |
| 915 | 919 |
| 916 _finalize_apk_rule_name = "${target_name}__finalize" | 920 _finalize_apk_rule_name = "${target_name}__finalize" |
| 917 finalize_apk(_finalize_apk_rule_name) { | 921 finalize_apk(_finalize_apk_rule_name) { |
| 918 input_apk_path = _packaged_apk_path | 922 input_apk_path = _packaged_apk_path |
| 919 output_apk_path = _final_apk_path | 923 output_apk_path = _final_apk_path |
| (...skipping 863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1783 ] | 1787 ] |
| 1784 args = [ | 1788 args = [ |
| 1785 "--depfile", | 1789 "--depfile", |
| 1786 rebase_path(depfile, root_build_dir), | 1790 rebase_path(depfile, root_build_dir), |
| 1787 "--script-output-path", | 1791 "--script-output-path", |
| 1788 rebase_path(generated_script, root_build_dir), | 1792 rebase_path(generated_script, root_build_dir), |
| 1789 ] | 1793 ] |
| 1790 args += test_runner_args | 1794 args += test_runner_args |
| 1791 } | 1795 } |
| 1792 } | 1796 } |
| OLD | NEW |