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

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

Issue 581273004: Add template for bundling resources generated by previous grit step (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gn-java-proto
Patch Set: Created 6 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 | « no previous file | chrome/app/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 4fdcbdf67e570177c46a86d6445e7c2288ed39af..cf72ddd17f87d2fa11064eb1da030cc7c40754a2 100644
--- a/build/config/android/rules.gni
+++ b/build/config/android/rules.gni
@@ -469,6 +469,50 @@ template("java_strings_grd") {
}
}
+# Declare a target that packages strings.xml generated from a grd file.
+#
+# If this target is included in the deps of an android resources/library/apk,
+# the strings.xml will be included with that target.
+#
+# Variables
+# grit_output_dir: directory containing grit-generated files.
+# generated_files: list of android resource files to package.
+#
+# Example
+# java_strings_grd("foo_strings_grd") {
newt (away) 2014/09/23 05:42:51 update example
cjhopman 2014/10/08 22:37:56 Done. Ha, I had actually updated the usage part of
+# grit_output_dir = "$root_gen_dir/foo/grit"
+# generated_files = [
+# "values/strings.xml"
+# ]
+# }
+template("java_strings_grd_prebuilt") {
+ if (defined(invoker.testonly)) { testonly = invoker.testonly }
+
+ base_path = "$target_gen_dir/$target_name"
+ resources_zip = base_path + ".resources.zip"
+ build_config = base_path + ".build_config"
+
+ write_build_config("${target_name}__build_config") {
+ type = "android_resources"
+ if (defined(invoker.deps)) {
+ deps = invoker.deps
+ }
+ }
+
+ zip("${target_name}__zip") {
+ base_dir = invoker.grit_output_dir
+ inputs = rebase_path(invoker.generated_files, ".", base_dir)
+ output = resources_zip
+ }
+
+ group(target_name) {
+ deps = [
+ ":${target_name}__build_config",
+ ":${target_name}__zip",
+ ]
+ }
+}
+
# Declare an Android library target
#
« no previous file with comments | « no previous file | chrome/app/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698