OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 import("//build/config/mac/base_rules.gni") | 5 import("//build/config/mac/base_rules.gni") |
6 | 6 |
7 # Generates Info.plist files for Mac apps and frameworks. | 7 # Generates Info.plist files for Mac apps and frameworks. |
8 # | 8 # |
9 # Arguments | 9 # Arguments |
10 # | 10 # |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 # extra_configs: | 213 # extra_configs: |
214 # (optional) list of label, additional configs to apply to the | 214 # (optional) list of label, additional configs to apply to the |
215 # executable target. | 215 # executable target. |
216 # | 216 # |
217 # remove_configs: | 217 # remove_configs: |
218 # (optional) list of label, default configs to remove from the target. | 218 # (optional) list of label, default configs to remove from the target. |
219 # | 219 # |
220 # extra_substitutions: | 220 # extra_substitutions: |
221 # (optional) string array, 'key=value' pairs for extra fields which are | 221 # (optional) string array, 'key=value' pairs for extra fields which are |
222 # specified in a source Info.plist template. | 222 # specified in a source Info.plist template. |
| 223 # |
| 224 # bundle_extension: |
| 225 # (optional) string, if specified, the bundle extension to use. The |
| 226 # default is "app". |
223 template("mac_app_bundle") { | 227 template("mac_app_bundle") { |
224 _target_name = target_name | 228 _target_name = target_name |
225 _output_name = target_name | 229 _output_name = target_name |
226 if (defined(invoker.output_name)) { | 230 if (defined(invoker.output_name)) { |
227 _output_name = invoker.output_name | 231 _output_name = invoker.output_name |
228 } | 232 } |
229 | 233 |
| 234 _bundle_extension = "app" |
| 235 if (defined(invoker.bundle_extension)) { |
| 236 _bundle_extension = invoker.bundle_extension |
| 237 } |
| 238 |
230 _executable_target = target_name + "_executable" | 239 _executable_target = target_name + "_executable" |
231 _executable_bundle_data = _executable_target + "_bundle_data" | 240 _executable_bundle_data = _executable_target + "_bundle_data" |
232 | 241 |
233 _info_plist_target = target_name + "_info_plist" | 242 _info_plist_target = target_name + "_info_plist" |
234 | 243 |
235 mac_info_plist(_info_plist_target) { | 244 mac_info_plist(_info_plist_target) { |
236 executable_name = _output_name | 245 executable_name = _output_name |
237 forward_variables_from(invoker, | 246 forward_variables_from(invoker, |
238 [ | 247 [ |
239 "extra_substitutions", | 248 "extra_substitutions", |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 "testonly", | 340 "testonly", |
332 ]) | 341 ]) |
333 if (!defined(deps)) { | 342 if (!defined(deps)) { |
334 deps = [] | 343 deps = [] |
335 } | 344 } |
336 deps += [ | 345 deps += [ |
337 ":$_executable_bundle_data", | 346 ":$_executable_bundle_data", |
338 ":$_info_plist_bundle_data", | 347 ":$_info_plist_bundle_data", |
339 ":$_pkg_info_bundle_data", | 348 ":$_pkg_info_bundle_data", |
340 ] | 349 ] |
341 product_type = "com.apple.product-type.application" | 350 |
342 bundle_root_dir = "$root_out_dir/${_output_name}.app/Contents" | 351 bundle_root_dir = |
| 352 "$root_out_dir/${_output_name}.${_bundle_extension}/Contents" |
343 bundle_resources_dir = "$bundle_root_dir/Resources" | 353 bundle_resources_dir = "$bundle_root_dir/Resources" |
344 bundle_executable_dir = "$bundle_root_dir/MacOS" | 354 bundle_executable_dir = "$bundle_root_dir/MacOS" |
345 } | 355 } |
346 } | 356 } |
347 | 357 |
348 # Template to package a loadable_module into a .plugin bundle. | 358 # Template to package a loadable_module into a .plugin bundle. |
349 # | 359 # |
350 # This takes no extra arguments that differ from a loadable_module. | 360 # This takes no extra arguments that differ from a loadable_module. |
351 template("mac_plugin_bundle") { | 361 template("mac_plugin_bundle") { |
352 assert(defined(invoker.deps), | 362 assert(defined(invoker.deps), |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 ]) | 410 ]) |
401 if (!defined(deps)) { | 411 if (!defined(deps)) { |
402 deps = [] | 412 deps = [] |
403 } | 413 } |
404 deps += [ ":$_loadable_module_bundle_data" ] | 414 deps += [ ":$_loadable_module_bundle_data" ] |
405 | 415 |
406 bundle_root_dir = "$root_out_dir/$_output_name.plugin/Contents" | 416 bundle_root_dir = "$root_out_dir/$_output_name.plugin/Contents" |
407 bundle_executable_dir = "$bundle_root_dir/MacOS" | 417 bundle_executable_dir = "$bundle_root_dir/MacOS" |
408 } | 418 } |
409 } | 419 } |
OLD | NEW |