Index: build/config/mac/base_rules.gni |
diff --git a/build/config/mac/base_rules.gni b/build/config/mac/base_rules.gni |
index 92e73a862f66a6b67320a739ae22dd7088e3da46..e75239744f536bd235c00da7a25fcdcadd4d3d74 100644 |
--- a/build/config/mac/base_rules.gni |
+++ b/build/config/mac/base_rules.gni |
@@ -202,7 +202,7 @@ template("info_plist") { |
} |
} |
-# Template to combile .xib or .storyboard files. |
+# Template to compile .xib files. |
# |
# Arguments |
# |
@@ -226,7 +226,7 @@ template("compile_xibs") { |
ibtool_flags = invoker.ibtool_flags |
} |
- script = "//build/config/mac/compile_xib.py" |
+ script = "//build/config/mac/compile_ib_files.py" |
sources = invoker.sources |
outputs = [ |
"$target_gen_dir/$target_name/{{source_name_part}}.nib", |
@@ -246,3 +246,49 @@ template("compile_xibs") { |
args += ibtool_flags |
} |
} |
+ |
+# Template to compile .storyboard files. |
+# |
+# Arguments |
+# |
+# sources: |
+# list of string, sources to compile |
+# |
+# ibtool_flags: |
+# (optional) list of string, additional flags to pass to the ibtool |
+template("compile_storyboards") { |
+ action_foreach(target_name) { |
+ forward_variables_from(invoker, |
+ [ |
+ "testonly", |
+ "visibility", |
+ ]) |
+ assert(defined(invoker.sources), |
+ "Sources must be specified for $target_name") |
+ |
+ ibtool_flags = [] |
+ if (defined(invoker.ibtool_flags)) { |
+ ibtool_flags = invoker.ibtool_flags |
+ } |
+ |
+ script = "//build/config/mac/compile_ib_files.py" |
+ sources = invoker.sources |
+ outputs = [ |
+ "$target_gen_dir/$target_name/{{source_name_part}}.storyboardc", |
+ ] |
+ args = [ |
+ "--input", |
+ "{{source}}", |
+ "--output", |
+ rebase_path( |
+ "$target_gen_dir/$target_name/{{source_name_part}}.storyboardc"), |
+ ] |
+ if (!use_system_xcode) { |
+ args += [ |
+ "--developer_dir", |
+ hermetic_xcode_path, |
+ ] |
+ } |
+ args += ibtool_flags |
+ } |
+} |