Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2271)

Unified Diff: build/config/android/rules.gni

Issue 1338393003: GN: Fix ChromePublic crash on launch from misconfigured resource overrides (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: line length Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/android/gyp/process_resources.py ('k') | chrome/android/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/android/rules.gni
diff --git a/build/config/android/rules.gni b/build/config/android/rules.gni
index 6f32c9c2d755d5bb3019c1a52c5ff9b3daf9fad7..09ebd69584dc75eafc6ef4525bb8568cde880895 100644
--- a/build/config/android/rules.gni
+++ b/build/config/android/rules.gni
@@ -605,18 +605,22 @@ template("locale_pak_resources") {
# different application at runtime to access the package's resources.
#
-# Example
+# Example:
# android_resources("foo_resources") {
# deps = [":foo_strings_grd"]
# resource_dirs = ["res"]
# custom_package = "org.chromium.foo"
# }
+#
+# android_resources("foo_resources_overrides") {
+# deps = [":foo_resources"]
+# resource_dirs = ["res_overrides"]
+# }
template("android_resources") {
set_sources_assignment_filter([])
forward_variables_from(invoker, [ "testonly" ])
assert(defined(invoker.resource_dirs))
- assert(defined(invoker.android_manifest) || defined(invoker.custom_package))
base_path = "$target_gen_dir/$target_name"
zip_path = base_path + ".resources.zip"
@@ -635,12 +639,19 @@ template("android_resources") {
"custom_package",
"deps",
])
+
+ # No package means resources override their deps.
+ if (defined(custom_package) || defined(android_manifest)) {
+ r_text = r_text_path
+ } else {
+ assert(defined(invoker.deps),
+ "Must specify deps when custom_package is omitted.")
+ }
visibility = [ ":$process_resources_target_name" ]
type = "android_resources"
resources_zip = zip_path
srcjar = srcjar_path
- r_text = r_text_path
}
process_resources(process_resources_target_name) {
« no previous file with comments | « build/android/gyp/process_resources.py ('k') | chrome/android/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698