Index: build/config/android/rules.gni |
diff --git a/build/config/android/rules.gni b/build/config/android/rules.gni |
index 01202c944b6fd3408848051080dd386018ad1a72..613bb92c170e815ba1c00eacd900d0b492bb094a 100644 |
--- a/build/config/android/rules.gni |
+++ b/build/config/android/rules.gni |
@@ -1352,7 +1352,8 @@ template("android_apk") { |
} |
assert(defined(invoker.final_apk_path) || defined(invoker.apk_name)) |
- assert(defined(invoker.android_manifest)) |
+ assert(defined(invoker.android_manifest) || |
+ defined(invoker.android_manifest_dep)) |
gen_dir = "$target_gen_dir/$target_name" |
base_path = "$gen_dir/$target_name" |
_build_config = "$target_gen_dir/$target_name.build_config" |
@@ -1454,7 +1455,21 @@ template("android_apk") { |
} |
} |
- _android_manifest = invoker.android_manifest |
+ _android_manifest_deps = [] |
brettw
2015/06/26 19:48:52
It's not clear to me what this block is doing. Can
agrieve
2015/06/26 20:43:55
Done.
|
+ if (defined(invoker.android_manifest_dep)) { |
+ _android_manifest_deps = [ invoker.android_manifest_dep ] |
+ } |
+ if (defined(invoker.android_manifest)) { |
+ _android_manifest = invoker.android_manifest |
+ } else { |
+ _manifest_out_files = get_target_outputs(_android_manifest_deps[0]) |
+ |
+ # Use the last output, since depfile outputs always need to come first. |
+ foreach(_file, _manifest_out_files) { |
+ _android_manifest = _file |
+ } |
+ } |
+ |
_rebased_build_config = rebase_path(_build_config, root_build_dir) |
_create_abi_split = |
defined(invoker.create_abi_split) && invoker.create_abi_split |
@@ -1472,7 +1487,7 @@ template("android_apk") { |
build_config = _build_config |
android_manifest = _android_manifest |
- deps = _chromium_linker_dep |
+ deps = _chromium_linker_dep + _android_manifest_deps |
if (defined(invoker.deps)) { |
deps += invoker.deps |
} |
@@ -1502,9 +1517,7 @@ template("android_apk") { |
} |
build_config = _build_config |
- deps = [ |
- ":$build_config_target", |
- ] |
+ deps = _android_manifest_deps + [ ":$build_config_target" ] |
if (defined(invoker.deps)) { |
deps += invoker.deps |
} |
@@ -1553,9 +1566,7 @@ template("android_apk") { |
supports_android = true |
requires_android = true |
override_build_config = _build_config |
- deps = [ |
- ":$build_config_target", |
- ] |
+ deps = _android_manifest_deps + [ ":$build_config_target" ] |
android_manifest = _android_manifest |
chromium_code = true |
@@ -1712,10 +1723,10 @@ template("android_apk") { |
keystore_password = _keystore_password |
# This target generates the input file _all_resources_zip_path. |
- deps = [ |
- ":$process_resources_target", |
- ":$final_dex_target_name", |
- ] |
+ deps = _android_manifest_deps + [ |
+ ":$process_resources_target", |
+ ":$final_dex_target_name", |
+ ] |
if (defined(invoker.deps)) { |
deps += invoker.deps |
} |
@@ -1744,6 +1755,7 @@ template("android_apk") { |
out_manifest = |
"$gen_dir/split-manifests/${android_app_abi}/AndroidManifest.xml" |
split_name = "abi_${android_app_abi}" |
+ deps = _android_manifest_deps |
} |
_apk_rule = "${_template_name}__split_apk_abi_${android_app_abi}" |
@@ -1769,6 +1781,7 @@ template("android_apk") { |
native_libs_dir = _native_libs_dir |
deps = [ |
":${_template_name}__prepare_native", |
+ ":${_manifest_rule}", |
] |
} |
} |