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

Unified Diff: tools/grit/repack.gni

Issue 2009803002: [iOS] Add a template to repack and define bundle resources to grit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update description and comment to remove "Mac" Created 4 years, 7 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/grit/repack.gni
diff --git a/tools/grit/repack.gni b/tools/grit/repack.gni
index 673fdf79436cad91e340bc863b243b73881578d2..11bed43a52cbf7c04388c955c898afb71c323cbb 100644
--- a/tools/grit/repack.gni
+++ b/tools/grit/repack.gni
@@ -51,3 +51,57 @@ template("repack") {
}
}
}
+
+# This template combines repacking resources and defining a bundle_data target
+# to move them to the application bundle. This is mostly useful on iOS.
+#
+# Parameters:
+# sources [required]
+# List of pak files that need to be combined.
+#
+# output [required]
+# File name (single string) of the output file.
+#
+# bundle_output [optional]
+# Path of the file in the application bundle, defaults to
+# {{bundle_resources_dir}}/{{source_file_part}} if omitted.
+#
+# deps [optional]
+# visibility [optional]
+# Normal meaning.
+template("repack_and_bundle") {
+ assert(defined(invoker.bundle_output), "Need bundle_output for $target_name")
+
+ _repack_target_name = target_name + "_repack"
+ _bundle_target_name = target_name
+
+ repack(_repack_target_name) {
+ visibility = [ ":$_bundle_target_name" ]
+ forward_variables_from(invoker,
+ [
+ "deps",
+ "output",
+ "sources",
+ ])
+ }
+
+ bundle_data(_bundle_target_name) {
+ forward_variables_from(invoker, [ "visibility" ])
+
+ public_deps = [
+ ":$_repack_target_name",
+ ]
+ sources = [
+ invoker.output,
+ ]
+ if (defined(invoker.bundle_output)) {
+ outputs = [
+ invoker.bundle_output,
+ ]
+ } else {
+ outputs = [
+ "{{bundle_resources_dir}}/{{source_file_part}}",
+ ]
+ }
+ }
+}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698