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

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

Issue 2130743002: Convert .strings to binary before declaring bundle_data. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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: build/config/ios/rules.gni
diff --git a/build/config/ios/rules.gni b/build/config/ios/rules.gni
index ac2c61ac1c9d98487141d5df7f50bb4d02523114..219b580be3c0e7beb6ade0a48bdcf603bb6942a1 100644
--- a/build/config/ios/rules.gni
+++ b/build/config/ios/rules.gni
@@ -377,6 +377,58 @@ template("bundle_data_xib") {
}
}
+# Compile a strings file and add it to a bundle_data so that it is available
+# at runtime in the bundle.
+#
+# Arguments
+#
+# source:
+# string, path of the strings file to compile.
+#
+# output:
+# string, path of the compiled file in the final bundle.
+#
+# Forwards all variables to the bundle_data target.
+template("bundle_data_strings") {
+ assert(defined(invoker.source), "source needs to be defined for $target_name")
+ assert(defined(invoker.output), "output needs to be defined for $target_name")
+
+ _source_extension = get_path_info(invoker.source, "extension")
+ assert(_source_extension == "strings",
+ "source must be a .strings for $target_name")
+
+ _target_name = target_name
+ _convert_target = target_name + "_compile_strings"
+
+ convert_plist(_convert_target) {
+ visibility = [ ":$_target_name" ]
+ source = invoker.source
+ output =
+ "$target_gen_dir/$_target_name/" + get_path_info(invoker.source, "file")
+ format = "binary1"
+ }
+
+ bundle_data(_target_name) {
+ forward_variables_from(invoker,
+ "*",
+ [
+ "source",
+ "output",
+ ])
+
+ if (!defined(public_deps)) {
+ public_deps = []
+ }
+ public_deps += [ ":$_convert_target" ]
+
+ sources = get_target_outputs(":$_convert_target")
+
+ outputs = [
+ invoker.output,
+ ]
+ }
+}
+
# Template to package a shared library into an iOS framework bundle.
#
# This template provides two targets to control whether the framework is
« 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