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 |
# |