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

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, 2 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 bef77b210b6b7d46aecddae1f139c43167136e19..3849899192b1140ae5a9e1424064ac7dd28e61d2 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_prebuilt("foo_strings_grd") {
+# 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