| Index: build/config/android/rules.gni
|
| diff --git a/build/config/android/rules.gni b/build/config/android/rules.gni
|
| index 7bd22b43c34468cb834661a5a0b3f0812c6f46e5..5306c0582a2ba9c60a5779a96f5a838f77976772 100644
|
| --- a/build/config/android/rules.gni
|
| +++ b/build/config/android/rules.gni
|
| @@ -680,6 +680,63 @@ template("android_resources") {
|
| }
|
| }
|
|
|
| +# Declare an Android assets target.
|
| +#
|
| +# Defines a set of files to include as assets in a dependent apk.
|
| +#
|
| +# To include these assets in an apk, this target should be listed in
|
| +# the apk's deps, or in the deps of a library target used by an apk.
|
| +#
|
| +# Variables
|
| +# deps: Specifies the dependencies of this target. Any Android assets
|
| +# listed in deps will be included by libraries/apks that depend on this
|
| +# target.
|
| +# sources: List of files to include as assets.
|
| +# outputs: NOT YET IMPLEMENTED - List of asset paths to use for the assets
|
| +# (refer to semantics of copy()).
|
| +# disable_compression: Whether to diesable compression for files that are
|
| +# known to be compressable (default: false).
|
| +#
|
| +# Example:
|
| +# android_assets("content_shell_assets") {
|
| +# deps = [
|
| +# ":generates_foo",
|
| +# ":other_assets",
|
| +# ]
|
| +# sources = [
|
| +# "$target_gen_dir/foo.dat",
|
| +# ]
|
| +# }
|
| +template("android_assets") {
|
| + set_sources_assignment_filter([])
|
| + forward_variables_from(invoker, [ "testonly" ])
|
| +
|
| + assert(!defined(invoker.outputs), "TODO: Add support for output paths")
|
| +
|
| + _build_config = "$target_gen_dir/$target_name.build_config"
|
| + _build_config_target_name = "${target_name}__build_config"
|
| +
|
| + write_build_config(_build_config_target_name) {
|
| + forward_variables_from(invoker,
|
| + [
|
| + "deps",
|
| + "disable_compression",
|
| + ])
|
| + type = "android_assets"
|
| + build_config = _build_config
|
| + assets = invoker.sources
|
| + }
|
| +
|
| + group(target_name) {
|
| + forward_variables_from(invoker, [ "visibility" ])
|
| + if (invoker.sources != []) {
|
| + public_deps = [
|
| + ":$_build_config_target_name",
|
| + ]
|
| + }
|
| + }
|
| +}
|
| +
|
| # Declare a target that generates localized strings.xml from a .grd file.
|
| #
|
| # If this target is included in the deps of an android resources/library/apk,
|
| @@ -1520,6 +1577,7 @@ template("android_apk") {
|
| ])
|
| apk_path = _final_apk_path
|
| android_manifest = _android_manifest
|
| + assets_build_config = _build_config
|
| resources_zip = _all_resources_zip_path
|
| dex_path = final_dex_path
|
| load_library_from_apk = _load_library_from_apk
|
| @@ -1540,11 +1598,14 @@ template("android_apk") {
|
| keystore_password = _keystore_password
|
|
|
| # Incremental apk does not use native libs nor final dex.
|
| - incremental_deps =
|
| - deps + _android_manifest_deps + [ ":$process_resources_target" ]
|
| + incremental_deps = deps + _android_manifest_deps + [
|
| + ":$build_config_target",
|
| + ":$process_resources_target",
|
| + ]
|
|
|
| # This target generates the input file _all_resources_zip_path.
|
| deps += _android_manifest_deps + [
|
| + ":$build_config_target",
|
| ":$process_resources_target",
|
| ":$final_dex_target_name",
|
| ]
|
|
|