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

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

Issue 1808733003: [iOS] Fix ios_web_shell to build with gn. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@components
Patch Set: Rebase on origin/master Created 4 years, 9 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 | « build/config/ios/ios_compile_xib.py ('k') | ios/web/shell/BUILD.gn » ('j') | 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 87e7ff3abc163ab5df168a538415a9af1a039e31..8afbbcab5a813a63a9b7d4bd5a18b2eb343fb8e0 100644
--- a/build/config/ios/rules.gni
+++ b/build/config/ios/rules.gni
@@ -167,3 +167,63 @@ template("app") {
# an alias to "ninja -C out/Default base_unittests" (for convenience
# and compatibility with gyp),
}
+
+# Compile a xib or storyboard file and add it to a bundle_data so that it is
+# available at runtime in the bundle.
+#
+# Arguments
+#
+# source:
+# string, path of the xib or storyboard to compile.
+#
+# Forwards all variables to the bundle_data target.
+template("bundle_data_xib") {
+ assert(defined(invoker.source), "source needs to be defined for $target_name")
+
+ _source_extension = get_path_info(invoker.source, "extension")
+ assert(_source_extension == "xib" || _source_extension == "storyboard",
+ "source must be a .xib or .storyboard for $target_name")
+
+ _target_name = target_name
+ _compile_xib = target_name + "_compile_xib"
+
+ _nib_basename = get_path_info(invoker.source, "name")
+ _nib_filename = "$_nib_basename.nib"
+
+ action(_compile_xib) {
+ visibility = [ ":$_target_name" ]
+ script = "//build/config/ios/ios_compile_xib.py"
+ sources = [
+ invoker.source,
+ ]
+ outputs = [
+ "$target_gen_dir/$_nib_filename/objects.nib",
+ "$target_gen_dir/$_nib_filename/runtime.nib",
+ ]
+ args = [
+ "--minimum-deployment-target",
+ ios_deployment_target,
+ "--output",
+ rebase_path("$target_gen_dir/$_nib_filename"),
+ "--input",
+ rebase_path(invoker.source, root_build_dir),
+ ]
+ }
+
+ bundle_data(_target_name) {
+ forward_variables_from(invoker, "*", [ "source" ])
+
+ if (!defined(public_deps)) {
+ public_deps = []
+ }
+ public_deps += [ ":$_compile_xib" ]
+
+ sources = [
+ "$target_gen_dir/$_nib_filename/objects.nib",
+ "$target_gen_dir/$_nib_filename/runtime.nib",
+ ]
+ outputs = [
+ "{{bundle_resources_dir}}/$_nib_filename/{{source_file_part}}",
+ ]
+ }
+}
« no previous file with comments | « build/config/ios/ios_compile_xib.py ('k') | ios/web/shell/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698