Chromium Code Reviews| 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/base_rules.gni") | 6 import("//build/config/mac/base_rules.gni") |
| 7 import("//build/config/mac/symbols.gni") | 7 import("//build/config/mac/symbols.gni") |
| 8 import("//build/toolchain/toolchain.gni") | 8 import("//build/toolchain/toolchain.gni") |
| 9 | 9 |
| 10 # Invokes lipo on multiple arch-specific binaries to create a fat binary. | 10 # Invokes lipo on multiple arch-specific binaries to create a fat binary. |
| (...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 742 | 742 |
| 743 # Compile a xib or storyboard file and add it to a bundle_data so that it is | 743 # Compile a xib or storyboard file and add it to a bundle_data so that it is |
| 744 # available at runtime in the bundle. | 744 # available at runtime in the bundle. |
| 745 # | 745 # |
| 746 # Arguments | 746 # Arguments |
| 747 # | 747 # |
| 748 # source: | 748 # source: |
| 749 # string, path of the xib or storyboard to compile. | 749 # string, path of the xib or storyboard to compile. |
| 750 # | 750 # |
| 751 # Forwards all variables to the bundle_data target. | 751 # Forwards all variables to the bundle_data target. |
| 752 template("bundle_data_xib") { | 752 template("bundle_data_ib_file") { |
|
sdefresne
2016/12/09 15:29:55
Don't remove the old template name, you'll break d
| |
| 753 assert(defined(invoker.source), "source needs to be defined for $target_name") | 753 assert(defined(invoker.source), "source needs to be defined for $target_name") |
| 754 | 754 |
| 755 _source_extension = get_path_info(invoker.source, "extension") | 755 _source_extension = get_path_info(invoker.source, "extension") |
| 756 assert(_source_extension == "xib" || _source_extension == "storyboard", | 756 assert(_source_extension == "xib" || _source_extension == "storyboard", |
| 757 "source must be a .xib or .storyboard for $target_name") | 757 "source must be a .xib or .storyboard for $target_name") |
| 758 | 758 |
| 759 _target_name = target_name | 759 _target_name = target_name |
| 760 _compile_xib = target_name + "_compile_xib" | 760 if (_source_extension == "xib") { |
| 761 _compile_ib_file = target_name + "_compile_xib" | |
| 762 _compile_ib_file_template = "compile_xibs" | |
| 763 } else { | |
| 764 _compile_ib_file = target_name + "_compile_storyboard" | |
| 765 _compile_ib_file_template = "compile_storyboards" | |
| 766 } | |
| 761 | 767 |
| 762 compile_xibs(_compile_xib) { | 768 target(_compile_ib_file_template, _compile_ib_file) { |
| 763 sources = [ | 769 sources = [ |
| 764 invoker.source, | 770 invoker.source, |
| 765 ] | 771 ] |
| 766 visibility = [ ":$_target_name" ] | 772 visibility = [ ":$_target_name" ] |
| 767 ibtool_flags = [ | 773 ibtool_flags = [ |
| 768 "--minimum-deployment-target", | 774 "--minimum-deployment-target", |
| 769 ios_deployment_target, | 775 ios_deployment_target, |
| 770 "--auto-activate-custom-fonts", | 776 "--auto-activate-custom-fonts", |
| 771 "--target-device", | 777 "--target-device", |
| 772 "iphone", | 778 "iphone", |
| 773 "--target-device", | 779 "--target-device", |
| 774 "ipad", | 780 "ipad", |
| 775 ] | 781 ] |
| 776 } | 782 } |
| 777 | 783 |
| 778 bundle_data(_target_name) { | 784 bundle_data(_target_name) { |
| 779 forward_variables_from(invoker, "*", [ "source" ]) | 785 forward_variables_from(invoker, "*", [ "source" ]) |
| 780 | 786 |
| 781 if (!defined(public_deps)) { | 787 if (!defined(public_deps)) { |
| 782 public_deps = [] | 788 public_deps = [] |
| 783 } | 789 } |
| 784 public_deps += [ ":$_compile_xib" ] | 790 public_deps += [ ":$_compile_ib_file" ] |
| 785 | 791 |
| 786 sources = get_target_outputs(":$_compile_xib") | 792 sources = get_target_outputs(":$_compile_ib_file") |
| 787 | 793 |
| 788 outputs = [ | 794 outputs = [ |
| 789 "{{bundle_resources_dir}}/{{source_file_part}}", | 795 "{{bundle_resources_dir}}/{{source_file_part}}", |
| 790 ] | 796 ] |
| 791 } | 797 } |
| 792 } | 798 } |
| 793 | 799 |
| 794 # Compile a strings file and add it to a bundle_data so that it is available | 800 # Compile a strings file and add it to a bundle_data so that it is available |
| 795 # at runtime in the bundle. | 801 # at runtime in the bundle. |
| 796 # | 802 # |
| (...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1413 "-rpath", | 1419 "-rpath", |
| 1414 "-Xlinker", | 1420 "-Xlinker", |
| 1415 "@loader_path/Frameworks", | 1421 "@loader_path/Frameworks", |
| 1416 ] | 1422 ] |
| 1417 } | 1423 } |
| 1418 } | 1424 } |
| 1419 | 1425 |
| 1420 set_defaults("ios_xctest_test") { | 1426 set_defaults("ios_xctest_test") { |
| 1421 configs = default_executable_configs | 1427 configs = default_executable_configs |
| 1422 } | 1428 } |
| OLD | NEW |