OLD | NEW |
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 Loading... |
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 and .storyboard 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_ib_files") { |
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 assert(defined(invoker.output_extension), |
| 224 "output_extension must be specified for $target_name") |
223 | 225 |
224 ibtool_flags = [] | 226 ibtool_flags = [] |
225 if (defined(invoker.ibtool_flags)) { | 227 if (defined(invoker.ibtool_flags)) { |
226 ibtool_flags = invoker.ibtool_flags | 228 ibtool_flags = invoker.ibtool_flags |
227 } | 229 } |
228 | 230 |
229 script = "//build/config/mac/compile_xib.py" | 231 _output_extension = invoker.output_extension |
| 232 |
| 233 script = "//build/config/mac/compile_ib_files.py" |
230 sources = invoker.sources | 234 sources = invoker.sources |
231 outputs = [ | 235 outputs = [ |
232 "$target_gen_dir/$target_name/{{source_name_part}}.nib", | 236 "$target_gen_dir/$target_name/{{source_name_part}}.$_output_extension", |
233 ] | 237 ] |
234 args = [ | 238 args = [ |
235 "--input", | 239 "--input", |
236 "{{source}}", | 240 "{{source}}", |
237 "--output", | 241 "--output", |
238 rebase_path("$target_gen_dir/$target_name/{{source_name_part}}.nib"), | 242 rebase_path( |
| 243 "$target_gen_dir/$target_name/{{source_name_part}}.$_output_extension"
), |
239 ] | 244 ] |
240 if (!use_system_xcode) { | 245 if (!use_system_xcode) { |
241 args += [ | 246 args += [ |
242 "--developer_dir", | 247 "--developer_dir", |
243 hermetic_xcode_path, | 248 hermetic_xcode_path, |
244 ] | 249 ] |
245 } | 250 } |
246 args += ibtool_flags | 251 args += ibtool_flags |
247 } | 252 } |
248 } | 253 } |
OLD | NEW |