| 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 import("//build/config/mac/rules.gni") |
| 7 | 7 |
| 8 # TODO(crbug.com/297668): refactor this template to extract common behaviour | 8 # TODO(crbug.com/297668): refactor this template to extract common behaviour |
| 9 # 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 |
| 10 # that forward to "executable" on all platform except iOS/OS X. | 10 # that forward to "executable" on all platform except iOS/OS X. |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 template("bundle_data_xib") { | 181 template("bundle_data_xib") { |
| 182 assert(defined(invoker.source), "source needs to be defined for $target_name") | 182 assert(defined(invoker.source), "source needs to be defined for $target_name") |
| 183 | 183 |
| 184 _source_extension = get_path_info(invoker.source, "extension") | 184 _source_extension = get_path_info(invoker.source, "extension") |
| 185 assert(_source_extension == "xib" || _source_extension == "storyboard", | 185 assert(_source_extension == "xib" || _source_extension == "storyboard", |
| 186 "source must be a .xib or .storyboard for $target_name") | 186 "source must be a .xib or .storyboard for $target_name") |
| 187 | 187 |
| 188 _target_name = target_name | 188 _target_name = target_name |
| 189 _compile_xib = target_name + "_compile_xib" | 189 _compile_xib = target_name + "_compile_xib" |
| 190 | 190 |
| 191 _nib_basename = get_path_info(invoker.source, "name") | 191 compile_xibs(_compile_xib) { |
| 192 _nib_filename = "$_nib_basename.nib" | |
| 193 | |
| 194 action(_compile_xib) { | |
| 195 visibility = [ ":$_target_name" ] | |
| 196 script = "//build/config/ios/ios_compile_xib.py" | |
| 197 sources = [ | 192 sources = [ |
| 198 invoker.source, | 193 invoker.source, |
| 199 ] | 194 ] |
| 200 outputs = [ | 195 visibility = [ ":$_target_name" ] |
| 201 "$target_gen_dir/$_nib_filename", | 196 ibtool_flags = [ |
| 202 ] | |
| 203 args = [ | |
| 204 "--minimum-deployment-target", | 197 "--minimum-deployment-target", |
| 205 ios_deployment_target, | 198 ios_deployment_target, |
| 206 "--output", | 199 "--auto-activate-custom-fonts", |
| 207 rebase_path("$target_gen_dir/$_nib_filename"), | 200 "--target-device", |
| 208 "--input", | 201 "iphone", |
| 209 rebase_path(invoker.source, root_out_dir), | 202 "--target-device", |
| 203 "ipad", |
| 210 ] | 204 ] |
| 211 } | 205 } |
| 212 | 206 |
| 213 bundle_data(_target_name) { | 207 bundle_data(_target_name) { |
| 214 forward_variables_from(invoker, "*", [ "source" ]) | 208 forward_variables_from(invoker, "*", [ "source" ]) |
| 215 | 209 |
| 216 if (!defined(public_deps)) { | 210 if (!defined(public_deps)) { |
| 217 public_deps = [] | 211 public_deps = [] |
| 218 } | 212 } |
| 219 public_deps += [ ":$_compile_xib" ] | 213 public_deps += [ ":$_compile_xib" ] |
| 220 | 214 |
| 221 sources = [ | 215 sources = get_target_outputs(":$_compile_xib") |
| 222 "$target_gen_dir/$_nib_filename", | 216 |
| 223 ] | |
| 224 outputs = [ | 217 outputs = [ |
| 225 "{{bundle_resources_dir}}/$_nib_filename", | 218 "{{bundle_resources_dir}}/{{source_file_part}}", |
| 226 ] | 219 ] |
| 227 } | 220 } |
| 228 } | 221 } |
| 229 | 222 |
| 230 # Template to package a shared library into an iOS framework bundle. | 223 # Template to package a shared library into an iOS framework bundle. |
| 231 # | 224 # |
| 232 # Arguments | 225 # Arguments |
| 233 # | 226 # |
| 234 # output_name: | 227 # output_name: |
| 235 # (optional) string, name of the generated framework without the | 228 # (optional) string, name of the generated framework without the |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 "visibility", | 363 "visibility", |
| 371 "public_configs", | 364 "public_configs", |
| 372 ]) | 365 ]) |
| 373 | 366 |
| 374 public_deps = [ | 367 public_deps = [ |
| 375 ":$_framework_target", | 368 ":$_framework_target", |
| 376 ] | 369 ] |
| 377 } | 370 } |
| 378 } | 371 } |
| 379 } | 372 } |
| OLD | NEW |