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 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
660 # Variables | 660 # Variables |
661 # assets_build_config: Path to android_apk .build_config containing merged | 661 # assets_build_config: Path to android_apk .build_config containing merged |
662 # asset information. | 662 # asset information. |
663 # deps: Specifies the dependencies of this target. | 663 # deps: Specifies the dependencies of this target. |
664 # dex_path: Path to classes.dex file to include (optional). | 664 # dex_path: Path to classes.dex file to include (optional). |
665 # resource_packaged_apk_path: Path to .ap_ to use. | 665 # resource_packaged_apk_path: Path to .ap_ to use. |
666 # output_apk_path: Output path for the generated .apk. | 666 # output_apk_path: Output path for the generated .apk. |
667 # native_lib_placeholders: List of placeholder filenames to add to the apk | 667 # native_lib_placeholders: List of placeholder filenames to add to the apk |
668 # (optional). | 668 # (optional). |
669 # native_libs_dir: Directory containing native libraries. | 669 # native_libs_dir: Directory containing native libraries. |
| 670 # write_asset_list: Adds an extra file to the assets, which contains a list of |
| 671 # all other asset files. |
670 template("package_apk") { | 672 template("package_apk") { |
671 action(target_name) { | 673 action(target_name) { |
672 forward_variables_from(invoker, | 674 forward_variables_from(invoker, |
673 [ | 675 [ |
674 "deps", | 676 "deps", |
675 "public_deps", | 677 "public_deps", |
676 "testonly", | 678 "testonly", |
677 ]) | 679 ]) |
678 _native_lib_placeholders = [] | 680 _native_lib_placeholders = [] |
679 if (defined(invoker.native_lib_placeholders)) { | 681 if (defined(invoker.native_lib_placeholders)) { |
(...skipping 30 matching lines...) Expand all Loading... |
710 ] | 712 ] |
711 if (defined(invoker.assets_build_config)) { | 713 if (defined(invoker.assets_build_config)) { |
712 inputs += [ invoker.assets_build_config ] | 714 inputs += [ invoker.assets_build_config ] |
713 _rebased_build_config = | 715 _rebased_build_config = |
714 rebase_path(invoker.assets_build_config, root_build_dir) | 716 rebase_path(invoker.assets_build_config, root_build_dir) |
715 args += [ | 717 args += [ |
716 "--assets=@FileArg($_rebased_build_config:assets)", | 718 "--assets=@FileArg($_rebased_build_config:assets)", |
717 "--uncompressed-assets=@FileArg($_rebased_build_config:uncompressed_asse
ts)", | 719 "--uncompressed-assets=@FileArg($_rebased_build_config:uncompressed_asse
ts)", |
718 ] | 720 ] |
719 } | 721 } |
| 722 if (defined(invoker.write_asset_list) && invoker.write_asset_list) { |
| 723 args += [ "--write-asset-list" ] |
| 724 } |
720 if (defined(invoker.dex_path)) { | 725 if (defined(invoker.dex_path)) { |
721 _rebased_dex_path = rebase_path(invoker.dex_path, root_build_dir) | 726 _rebased_dex_path = rebase_path(invoker.dex_path, root_build_dir) |
722 args += [ "--dex-file=$_rebased_dex_path" ] | 727 args += [ "--dex-file=$_rebased_dex_path" ] |
723 } | 728 } |
724 if (defined(invoker.native_libs_dir) || _native_lib_placeholders != []) { | 729 if (defined(invoker.native_libs_dir) || _native_lib_placeholders != []) { |
725 args += [ "--android-abi=$android_app_abi" ] | 730 args += [ "--android-abi=$android_app_abi" ] |
726 } | 731 } |
727 if (defined(invoker.native_libs_dir)) { | 732 if (defined(invoker.native_libs_dir)) { |
728 _rebased_native_libs_dir = | 733 _rebased_native_libs_dir = |
729 rebase_path(invoker.native_libs_dir, root_build_dir) | 734 rebase_path(invoker.native_libs_dir, root_build_dir) |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1002 } | 1007 } |
1003 | 1008 |
1004 package_target = "${target_name}__package" | 1009 package_target = "${target_name}__package" |
1005 package_apk(package_target) { | 1010 package_apk(package_target) { |
1006 forward_variables_from(invoker, | 1011 forward_variables_from(invoker, |
1007 [ | 1012 [ |
1008 "assets_build_config", | 1013 "assets_build_config", |
1009 "emma_instrument", | 1014 "emma_instrument", |
1010 "native_lib_placeholders", | 1015 "native_lib_placeholders", |
1011 "native_libs_dir", | 1016 "native_libs_dir", |
| 1017 "write_asset_list", |
1012 ]) | 1018 ]) |
1013 deps = _deps + [ ":${_package_resources_target_name}" ] | 1019 deps = _deps + [ ":${_package_resources_target_name}" ] |
1014 | 1020 |
1015 if (defined(_dex_path)) { | 1021 if (defined(_dex_path)) { |
1016 dex_path = _dex_path | 1022 dex_path = _dex_path |
1017 } | 1023 } |
1018 | 1024 |
1019 output_apk_path = _packaged_apk_path | 1025 output_apk_path = _packaged_apk_path |
1020 resource_packaged_apk_path = _resource_packaged_apk_path | 1026 resource_packaged_apk_path = _resource_packaged_apk_path |
1021 } | 1027 } |
(...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1979 ] | 1985 ] |
1980 args = [ | 1986 args = [ |
1981 "--depfile", | 1987 "--depfile", |
1982 rebase_path(depfile, root_build_dir), | 1988 rebase_path(depfile, root_build_dir), |
1983 "--script-output-path", | 1989 "--script-output-path", |
1984 rebase_path(generated_script, root_build_dir), | 1990 rebase_path(generated_script, root_build_dir), |
1985 ] | 1991 ] |
1986 args += test_runner_args | 1992 args += test_runner_args |
1987 } | 1993 } |
1988 } | 1994 } |
OLD | NEW |