| 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/ios/ios_sdk.gni") | 5 import("//build/config/ios/ios_sdk.gni") |
| 6 import("//build/config/mac/rules.gni") |
| 6 | 7 |
| 7 # TODO(crbug.com/297668): refactor this template to extract common behaviour | 8 # TODO(crbug.com/297668): refactor this template to extract common behaviour |
| 8 # between OS X and iOS bundle generation, then create a generic "app" template | 9 # between OS X and iOS bundle generation, then create a generic "app" template |
| 9 # that forward to "executable" on all platform except iOS/OS X. | 10 # that forward to "executable" on all platform except iOS/OS X. |
| 10 | 11 |
| 11 # Template to build an application bundle for iOS. | 12 # Template to build an application bundle for iOS. |
| 12 # | 13 # |
| 13 # This should be used instead of "executable" built-in target type on iOS. | 14 # This should be used instead of "executable" built-in target type on iOS. |
| 14 # As the template forward the generation of the application executable to | 15 # As the template forward the generation of the application executable to |
| 15 # an "executable" target, all arguments supported by "executable" targets | 16 # an "executable" target, all arguments supported by "executable" targets |
| 16 # are also supported by this template. | 17 # are also supported by this template. |
| 17 # | 18 # |
| 18 # Arguments | 19 # Arguments |
| 19 # | 20 # |
| 20 # output_name: | 21 # output_name: |
| 21 # (optional) string, name of the generated application, if omitted, | 22 # (optional) string, name of the generated application, if omitted, |
| 22 # defaults to the target_name. | 23 # defaults to the target_name. |
| 23 # | 24 # |
| 24 # extra_substitutions: | 25 # extra_substitutions: |
| 25 # (optional) list of string in "key=value" format, each value will | 26 # (optional) list of string in "key=value" format, each value will |
| 26 # be used as an additional variable substitution rule when generating | 27 # be used as an additional variable substitution rule when generating |
| 27 # the application Info.plist | 28 # the application Info.plist |
| 28 # | 29 # |
| 29 # info_plist: | 30 # info_plist: |
| 30 # path to the template to use to generate the application Info.plist | 31 # path to the template to use to generate the application Info.plist |
| 31 # by performing variable substitutions. | 32 # by performing variable substitutions. |
| 32 # | 33 # |
| 33 # For more information, see "gn help executable". | 34 # For more information, see "gn help executable". |
| 34 template("app") { | 35 template("ios_app_bundle") { |
| 35 assert(defined(invoker.info_plist), | 36 assert(defined(invoker.info_plist), |
| 36 "info_plist must be specified for target $target_name") | 37 "info_plist must be specified for target $target_name") |
| 37 | 38 |
| 38 _output_name = target_name | 39 _output_name = target_name |
| 39 _target_name = target_name | 40 _target_name = target_name |
| 40 if (defined(invoker.output_name)) { | 41 if (defined(invoker.output_name)) { |
| 41 _output_name = invoker.output_name | 42 _output_name = invoker.output_name |
| 42 } | 43 } |
| 43 | 44 |
| 44 _generate_info_plist = target_name + "_generate_info_plist" | 45 _generate_info_plist = target_name + "_generate_info_plist" |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 | 224 |
| 224 sources = [ | 225 sources = [ |
| 225 "$target_gen_dir/$_nib_filename/objects.nib", | 226 "$target_gen_dir/$_nib_filename/objects.nib", |
| 226 "$target_gen_dir/$_nib_filename/runtime.nib", | 227 "$target_gen_dir/$_nib_filename/runtime.nib", |
| 227 ] | 228 ] |
| 228 outputs = [ | 229 outputs = [ |
| 229 "{{bundle_resources_dir}}/$_nib_filename/{{source_file_part}}", | 230 "{{bundle_resources_dir}}/$_nib_filename/{{source_file_part}}", |
| 230 ] | 231 ] |
| 231 } | 232 } |
| 232 } | 233 } |
| 234 |
| 235 # Template to package a shared library into an iOS framework bundle. |
| 236 # |
| 237 # Arguments |
| 238 # |
| 239 # output_name: |
| 240 # (optional) string, name of the generated framework without the |
| 241 # .framework suffix. If omitted, defaults to target_name. |
| 242 # |
| 243 # framework_version: |
| 244 # (optional) string, version of the framework. Typically this is a |
| 245 # single letter, like "A". If omitted, the Versions/ subdirectory |
| 246 # structure will not be created, and build output will go directly |
| 247 # into the framework subdirectory. |
| 248 # |
| 249 # See "gn help shared_library" for more information on arguments supported |
| 250 # by shared library target. |
| 251 template("ios_framework_bundle") { |
| 252 framework_bundle(target_name) { |
| 253 forward_variables_from(invoker, "*") |
| 254 } |
| 255 } |
| OLD | NEW |