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

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

Issue 2564023002: Handle storyboards in GN. (Closed)
Patch Set: nib is the output_extension Created 4 years 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 | build/config/mac/base_rules.gni » ('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 d6413633829f6fa4be14ab248815c75d75f5c1b7..04f6754c50ca8c4a2211d8c9ad739bbd033ecd80 100644
--- a/build/config/ios/rules.gni
+++ b/build/config/ios/rules.gni
@@ -749,7 +749,7 @@ set_defaults("ios_appex_bundle") {
# string, path of the xib or storyboard to compile.
#
# Forwards all variables to the bundle_data target.
-template("bundle_data_xib") {
+template("bundle_data_ib_file") {
assert(defined(invoker.source), "source needs to be defined for $target_name")
_source_extension = get_path_info(invoker.source, "extension")
@@ -757,12 +757,19 @@ template("bundle_data_xib") {
"source must be a .xib or .storyboard for $target_name")
_target_name = target_name
- _compile_xib = target_name + "_compile_xib"
+ if (_source_extension == "xib") {
+ _compile_ib_file = target_name + "_compile_xib"
+ _output_extension = "nib"
+ } else {
+ _compile_ib_file = target_name + "_compile_storyboard"
+ _output_extension = "storyboardc"
+ }
- compile_xibs(_compile_xib) {
+ compile_ib_files(_compile_ib_file) {
sources = [
invoker.source,
]
+ output_extension = _output_extension
visibility = [ ":$_target_name" ]
ibtool_flags = [
"--minimum-deployment-target",
@@ -781,9 +788,9 @@ template("bundle_data_xib") {
if (!defined(public_deps)) {
public_deps = []
}
- public_deps += [ ":$_compile_xib" ]
+ public_deps += [ ":$_compile_ib_file" ]
- sources = get_target_outputs(":$_compile_xib")
+ sources = get_target_outputs(":$_compile_ib_file")
outputs = [
"{{bundle_resources_dir}}/{{source_file_part}}",
« no previous file with comments | « no previous file | build/config/mac/base_rules.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698