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/sanitizers/sanitizers.gni") | 6 import("//build/config/sanitizers/sanitizers.gni") |
| 7 import("//build/config/zip.gni") | 7 import("//build/config/zip.gni") |
| 8 import("//third_party/ijar/ijar.gni") | 8 import("//third_party/ijar/ijar.gni") |
| 9 | 9 |
| 10 assert(is_android) | 10 assert(is_android) |
| (...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 658 | 658 |
| 659 # Creates an unsigned .apk. | 659 # Creates an unsigned .apk. |
| 660 # | 660 # |
| 661 # Variables | 661 # Variables |
| 662 # assets_build_config: Path to android_apk .build_config containing merged | 662 # assets_build_config: Path to android_apk .build_config containing merged |
| 663 # asset information. | 663 # asset information. |
| 664 # deps: Specifies the dependencies of this target. | 664 # deps: Specifies the dependencies of this target. |
| 665 # dex_path: Path to classes.dex file to include (optional). | 665 # dex_path: Path to classes.dex file to include (optional). |
| 666 # resource_packaged_apk_path: Path to .ap_ to use. | 666 # resource_packaged_apk_path: Path to .ap_ to use. |
| 667 # output_apk_path: Output path for the generated .apk. | 667 # output_apk_path: Output path for the generated .apk. |
| 668 # native_libs: List of .so files to include. | |
| 668 # native_lib_placeholders: List of placeholder filenames to add to the apk | 669 # native_lib_placeholders: List of placeholder filenames to add to the apk |
| 669 # (optional). | 670 # (optional). |
| 670 # native_libs_dir: Directory containing native libraries. | 671 # native_libs_dir: Directory containing native libraries. |
| 671 # write_asset_list: Adds an extra file to the assets, which contains a list of | 672 # write_asset_list: Adds an extra file to the assets, which contains a list of |
|
pkotwicz
2015/11/26 21:17:45
Let's get rid of this in this CL.
Usually, I am a
| |
| 672 # all other asset files. | 673 # all other asset files. |
| 673 template("package_apk") { | 674 template("package_apk") { |
| 674 action(target_name) { | 675 action(target_name) { |
| 675 forward_variables_from(invoker, | 676 forward_variables_from(invoker, |
| 676 [ | 677 [ |
| 677 "deps", | 678 "deps", |
| 678 "public_deps", | 679 "public_deps", |
| 679 "testonly", | 680 "testonly", |
| 680 ]) | 681 ]) |
| 681 _native_lib_placeholders = [] | 682 _native_lib_placeholders = [] |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 720 "--uncompressed-assets=@FileArg($_rebased_build_config:uncompressed_asse ts)", | 721 "--uncompressed-assets=@FileArg($_rebased_build_config:uncompressed_asse ts)", |
| 721 ] | 722 ] |
| 722 } | 723 } |
| 723 if (defined(invoker.write_asset_list) && invoker.write_asset_list) { | 724 if (defined(invoker.write_asset_list) && invoker.write_asset_list) { |
| 724 args += [ "--write-asset-list" ] | 725 args += [ "--write-asset-list" ] |
| 725 } | 726 } |
| 726 if (defined(invoker.dex_path)) { | 727 if (defined(invoker.dex_path)) { |
| 727 _rebased_dex_path = rebase_path(invoker.dex_path, root_build_dir) | 728 _rebased_dex_path = rebase_path(invoker.dex_path, root_build_dir) |
| 728 args += [ "--dex-file=$_rebased_dex_path" ] | 729 args += [ "--dex-file=$_rebased_dex_path" ] |
| 729 } | 730 } |
| 730 if (defined(invoker.native_libs_dir) || _native_lib_placeholders != []) { | 731 if (defined(invoker.native_libs_dir) || defined(invoker.native_libs) || |
| 732 _native_lib_placeholders != []) { | |
| 731 args += [ "--android-abi=$android_app_abi" ] | 733 args += [ "--android-abi=$android_app_abi" ] |
| 732 } | 734 } |
| 733 if (defined(invoker.native_libs_dir)) { | 735 if (defined(invoker.native_libs_dir)) { |
| 734 _rebased_native_libs_dir = | 736 _rebased_native_libs_dir = |
| 735 rebase_path(invoker.native_libs_dir, root_build_dir) | 737 rebase_path(invoker.native_libs_dir, root_build_dir) |
| 736 args += [ "--native-libs-dir=$_rebased_native_libs_dir/$android_app_abi" ] | 738 args += [ "--native-libs-dir=$_rebased_native_libs_dir/$android_app_abi" ] |
| 737 } | 739 } |
| 740 if (defined(invoker.native_libs)) { | |
| 741 _rebased_native_libs = rebase_path(invoker.native_libs, root_build_dir) | |
| 742 args += [ "--native-libs=$_rebased_native_libs" ] | |
| 743 } | |
| 738 if (_native_lib_placeholders != []) { | 744 if (_native_lib_placeholders != []) { |
| 739 args += [ "--native-lib-placeholders=$_native_lib_placeholders" ] | 745 args += [ "--native-lib-placeholders=$_native_lib_placeholders" ] |
| 740 } | 746 } |
| 741 | 747 |
| 742 if (defined(invoker.emma_instrument) && invoker.emma_instrument) { | 748 if (defined(invoker.emma_instrument) && invoker.emma_instrument) { |
| 743 _emma_device_jar = "$android_sdk_root/tools/lib/emma_device.jar" | 749 _emma_device_jar = "$android_sdk_root/tools/lib/emma_device.jar" |
| 744 _rebased_emma_device_jar = rebase_path(_emma_device_jar, root_build_dir) | 750 _rebased_emma_device_jar = rebase_path(_emma_device_jar, root_build_dir) |
| 745 args += [ "--emma-device-jar=$_rebased_emma_device_jar" ] | 751 args += [ "--emma-device-jar=$_rebased_emma_device_jar" ] |
| 746 } | 752 } |
| 747 } | 753 } |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1007 resource_packaged_apk_path = _incremental_resource_packaged_apk_path | 1013 resource_packaged_apk_path = _incremental_resource_packaged_apk_path |
| 1008 } | 1014 } |
| 1009 | 1015 |
| 1010 package_target = "${target_name}__package" | 1016 package_target = "${target_name}__package" |
| 1011 package_apk(package_target) { | 1017 package_apk(package_target) { |
| 1012 forward_variables_from(invoker, | 1018 forward_variables_from(invoker, |
| 1013 [ | 1019 [ |
| 1014 "assets_build_config", | 1020 "assets_build_config", |
| 1015 "emma_instrument", | 1021 "emma_instrument", |
| 1016 "native_lib_placeholders", | 1022 "native_lib_placeholders", |
| 1023 "native_libs", | |
| 1017 "native_libs_dir", | 1024 "native_libs_dir", |
| 1018 "write_asset_list", | 1025 "write_asset_list", |
| 1019 ]) | 1026 ]) |
| 1020 deps = _deps + [ ":${_package_resources_target_name}" ] | 1027 deps = _deps + [ ":${_package_resources_target_name}" ] |
| 1021 | 1028 |
| 1022 if (defined(_dex_path)) { | 1029 if (defined(_dex_path)) { |
| 1023 dex_path = _dex_path | 1030 dex_path = _dex_path |
| 1024 } | 1031 } |
| 1025 | 1032 |
| 1026 output_apk_path = _packaged_apk_path | 1033 output_apk_path = _packaged_apk_path |
| 1027 resource_packaged_apk_path = _resource_packaged_apk_path | 1034 resource_packaged_apk_path = _resource_packaged_apk_path |
| 1028 } | 1035 } |
| 1029 | 1036 |
| 1030 _incremental_package_target = "${target_name}_incremental__package" | 1037 _incremental_package_target = "${target_name}_incremental__package" |
| 1031 package_apk(_incremental_package_target) { | 1038 package_apk(_incremental_package_target) { |
| 1032 forward_variables_from(invoker, | 1039 forward_variables_from(invoker, |
| 1033 [ | 1040 [ |
| 1034 "assets_build_config", | 1041 "assets_build_config", |
| 1035 "emma_instrument", | 1042 "emma_instrument", |
| 1043 "native_libs", | |
|
pkotwicz
2015/11/26 21:17:45
Please add a comment as to why you are including n
| |
| 1036 ]) | 1044 ]) |
| 1037 _dex_target = "//build/android/incremental_install:bootstrap_java__dex" | 1045 _dex_target = "//build/android/incremental_install:bootstrap_java__dex" |
| 1038 deps = _incremental_deps + [ | 1046 deps = _incremental_deps + [ |
| 1039 ":${_incremental_package_resources_target_name}", | 1047 ":${_incremental_package_resources_target_name}", |
| 1040 _dex_target, | 1048 _dex_target, |
| 1041 ] | 1049 ] |
| 1042 | 1050 |
| 1043 if (defined(_dex_path)) { | 1051 if (defined(_dex_path)) { |
| 1044 dex_path = | 1052 dex_path = |
| 1045 get_label_info(_dex_target, "target_gen_dir") + "/bootstrap.dex" | 1053 get_label_info(_dex_target, "target_gen_dir") + "/bootstrap.dex" |
| (...skipping 943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1989 ] | 1997 ] |
| 1990 args = [ | 1998 args = [ |
| 1991 "--depfile", | 1999 "--depfile", |
| 1992 rebase_path(depfile, root_build_dir), | 2000 rebase_path(depfile, root_build_dir), |
| 1993 "--script-output-path", | 2001 "--script-output-path", |
| 1994 rebase_path(generated_script, root_build_dir), | 2002 rebase_path(generated_script, root_build_dir), |
| 1995 ] | 2003 ] |
| 1996 args += test_runner_args | 2004 args += test_runner_args |
| 1997 } | 2005 } |
| 1998 } | 2006 } |
| OLD | NEW |