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

Side by Side Diff: build/config/mac/base_rules.gni

Issue 2564023002: Handle storyboards in GN. (Closed)
Patch Set: 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 unified diff | Download patch
OLDNEW
1 # Copyright 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 # This file contains rules that are shared between Mac and iOS. 5 # This file contains rules that are shared between Mac and iOS.
6 6
7 import("//build/toolchain/toolchain.gni") 7 import("//build/toolchain/toolchain.gni")
8 import("//build/config/mac/symbols.gni") 8 import("//build/config/mac/symbols.gni")
9 9
10 if (is_mac) { 10 if (is_mac) {
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 "PRODUCT_NAME=$executable_name", 195 "PRODUCT_NAME=$executable_name",
196 "XCODE_BUILD=$xcode_build", 196 "XCODE_BUILD=$xcode_build",
197 "XCODE_VERSION=$xcode_version", 197 "XCODE_VERSION=$xcode_version",
198 ] 198 ]
199 if (defined(invoker.extra_substitutions)) { 199 if (defined(invoker.extra_substitutions)) {
200 substitutions += invoker.extra_substitutions 200 substitutions += invoker.extra_substitutions
201 } 201 }
202 } 202 }
203 } 203 }
204 204
205 # Template to combile .xib or .storyboard files. 205 # Template to compile .xib files.
206 # 206 #
207 # Arguments 207 # Arguments
208 # 208 #
209 # sources: 209 # sources:
210 # list of string, sources to compile 210 # list of string, sources to compile
211 # 211 #
212 # ibtool_flags: 212 # ibtool_flags:
213 # (optional) list of string, additional flags to pass to the ibtool 213 # (optional) list of string, additional flags to pass to the ibtool
214 template("compile_xibs") { 214 template("compile_xibs") {
sdefresne 2016/12/09 15:27:15 There is only one difference between compile_xibs
lpromero 2016/12/09 15:44:49 Right, I tried to factor out. invoker.output_exten
215 action_foreach(target_name) { 215 action_foreach(target_name) {
216 forward_variables_from(invoker, 216 forward_variables_from(invoker,
217 [ 217 [
218 "testonly", 218 "testonly",
219 "visibility", 219 "visibility",
220 ]) 220 ])
221 assert(defined(invoker.sources), 221 assert(defined(invoker.sources),
222 "Sources must be specified for $target_name") 222 "Sources must be specified for $target_name")
223 223
224 ibtool_flags = [] 224 ibtool_flags = []
225 if (defined(invoker.ibtool_flags)) { 225 if (defined(invoker.ibtool_flags)) {
226 ibtool_flags = invoker.ibtool_flags 226 ibtool_flags = invoker.ibtool_flags
227 } 227 }
228 228
229 script = "//build/config/mac/compile_xib.py" 229 script = "//build/config/mac/compile_ib_files.py"
230 sources = invoker.sources 230 sources = invoker.sources
231 outputs = [ 231 outputs = [
232 "$target_gen_dir/$target_name/{{source_name_part}}.nib", 232 "$target_gen_dir/$target_name/{{source_name_part}}.nib",
233 ] 233 ]
234 args = [ 234 args = [
235 "--input", 235 "--input",
236 "{{source}}", 236 "{{source}}",
237 "--output", 237 "--output",
238 rebase_path("$target_gen_dir/$target_name/{{source_name_part}}.nib"), 238 rebase_path("$target_gen_dir/$target_name/{{source_name_part}}.nib"),
239 ] 239 ]
240 if (!use_system_xcode) { 240 if (!use_system_xcode) {
241 args += [ 241 args += [
242 "--developer_dir", 242 "--developer_dir",
243 hermetic_xcode_path, 243 hermetic_xcode_path,
244 ] 244 ]
245 } 245 }
246 args += ibtool_flags 246 args += ibtool_flags
247 } 247 }
248 } 248 }
249
250 # Template to compile .storyboard files.
251 #
252 # Arguments
253 #
254 # sources:
255 # list of string, sources to compile
256 #
257 # ibtool_flags:
258 # (optional) list of string, additional flags to pass to the ibtool
259 template("compile_storyboards") {
260 action_foreach(target_name) {
261 forward_variables_from(invoker,
262 [
263 "testonly",
264 "visibility",
265 ])
266 assert(defined(invoker.sources),
267 "Sources must be specified for $target_name")
268
269 ibtool_flags = []
270 if (defined(invoker.ibtool_flags)) {
271 ibtool_flags = invoker.ibtool_flags
272 }
273
274 script = "//build/config/mac/compile_ib_files.py"
275 sources = invoker.sources
276 outputs = [
277 "$target_gen_dir/$target_name/{{source_name_part}}.storyboardc",
278 ]
279 args = [
280 "--input",
281 "{{source}}",
282 "--output",
283 rebase_path(
284 "$target_gen_dir/$target_name/{{source_name_part}}.storyboardc"),
285 ]
286 if (!use_system_xcode) {
287 args += [
288 "--developer_dir",
289 hermetic_xcode_path,
290 ]
291 }
292 args += ibtool_flags
293 }
294 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698