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 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
404 # (optional) bundle extension including the dot, default to ".app". | 404 # (optional) bundle extension including the dot, default to ".app". |
405 # | 405 # |
406 # product_type | 406 # product_type |
407 # (optional) string, product type for the generated Xcode project, | 407 # (optional) string, product type for the generated Xcode project, |
408 # default to "com.apple.product-type.application". Should generally | 408 # default to "com.apple.product-type.application". Should generally |
409 # not be overridden. | 409 # not be overridden. |
410 # | 410 # |
411 # enable_code_signing | 411 # enable_code_signing |
412 # (optional) boolean, control whether code signing is enabled or not, | 412 # (optional) boolean, control whether code signing is enabled or not, |
413 # default to ios_enable_code_signing if not defined. | 413 # default to ios_enable_code_signing if not defined. |
414 # | 414 # |
Robert Sesek
2016/12/09 15:55:08
Document write_pkg_info ?
sdefresne
2016/12/09 16:03:06
It will be removed in three CLs. It is undocumente
| |
415 # For more information, see "gn help executable". | 415 # For more information, see "gn help executable". |
416 template("ios_app_bundle") { | 416 template("ios_app_bundle") { |
417 _output_name = target_name | 417 _output_name = target_name |
418 _target_name = target_name | 418 _target_name = target_name |
419 if (defined(invoker.output_name)) { | 419 if (defined(invoker.output_name)) { |
420 _output_name = invoker.output_name | 420 _output_name = invoker.output_name |
421 } | 421 } |
422 | 422 |
423 # TODO(sdefresne): some target downstream manually pack an PkgInfo, so | |
424 # allow controlling the generation of the PkgInfo file via an undocumented | |
425 # parameter until they are fixed. | |
426 _write_pkg_info = false | |
427 if (defined(invoker.write_pkg_info)) { | |
428 _write_pkg_info = invoker.write_pkg_info | |
429 } | |
430 | |
431 assert(_write_pkg_info || !_write_pkg_info, | |
432 "prevents 'Assignment had no effect.' errors") | |
Robert Sesek
2016/12/09 15:55:07
🙄
sdefresne
2016/12/09 16:03:06
I know.
| |
433 | |
423 _arch_executable_source = _target_name + "_arch_executable_sources" | 434 _arch_executable_source = _target_name + "_arch_executable_sources" |
424 _arch_executable_target = _target_name + "_arch_executable" | 435 _arch_executable_target = _target_name + "_arch_executable" |
425 _lipo_executable_target = _target_name + "_executable" | 436 _lipo_executable_target = _target_name + "_executable" |
426 | 437 |
427 source_set(_arch_executable_source) { | 438 source_set(_arch_executable_source) { |
428 forward_variables_from(invoker, | 439 forward_variables_from(invoker, |
429 "*", | 440 "*", |
430 [ | 441 [ |
431 "bundle_deps", | 442 "bundle_deps", |
432 "bundle_deps_filter", | 443 "bundle_deps_filter", |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
627 | 638 |
628 sources = get_target_outputs(":$_generate_info_plist") | 639 sources = get_target_outputs(":$_generate_info_plist") |
629 outputs = [ | 640 outputs = [ |
630 "{{bundle_root_dir}}/Info.plist", | 641 "{{bundle_root_dir}}/Info.plist", |
631 ] | 642 ] |
632 public_deps = [ | 643 public_deps = [ |
633 ":$_generate_info_plist", | 644 ":$_generate_info_plist", |
634 ] | 645 ] |
635 } | 646 } |
636 | 647 |
648 if (_write_pkg_info) { | |
649 _create_pkg_info = target_name + "_pkg_info" | |
650 action(_create_pkg_info) { | |
651 forward_variables_from(invoker, [ "testonly" ]) | |
652 script = "//build/config/mac/write_pkg_info.py" | |
653 sources = get_target_outputs(":$_generate_info_plist") | |
654 outputs = [ | |
655 # Cannot name the output PkgInfo as the name will not be unique if | |
656 # multiple ios_app_bundle are defined in the same BUILD.gn file. The | |
657 # file is renamed in the bundle_data outputs to the correct name. | |
658 "$target_gen_dir/$target_name", | |
659 ] | |
660 args = [ "--plist" ] + rebase_path(sources, root_build_dir) + | |
661 [ "--output" ] + rebase_path(outputs, root_build_dir) | |
662 deps = [ | |
663 ":$_generate_info_plist", | |
664 ] | |
665 } | |
666 | |
667 _bundle_data_pkg_info = target_name + "_bundle_data_pkg_info" | |
668 bundle_data(_bundle_data_pkg_info) { | |
669 forward_variables_from(invoker, [ "testonly" ]) | |
670 sources = get_target_outputs(":$_create_pkg_info") | |
671 outputs = [ | |
672 "{{bundle_resources_dir}}/PkgInfo", | |
673 ] | |
674 public_deps = [ | |
675 ":$_create_pkg_info", | |
676 ] | |
677 } | |
678 } | |
679 | |
637 create_signed_bundle(_target_name) { | 680 create_signed_bundle(_target_name) { |
638 forward_variables_from(invoker, | 681 forward_variables_from(invoker, |
639 [ | 682 [ |
640 "bundle_deps", | 683 "bundle_deps", |
641 "bundle_deps_filter", | 684 "bundle_deps_filter", |
642 "bundle_extension", | 685 "bundle_extension", |
643 "data_deps", | 686 "data_deps", |
644 "deps", | 687 "deps", |
645 "enable_code_signing", | 688 "enable_code_signing", |
646 "entitlements_path", | 689 "entitlements_path", |
647 "entitlements_target", | 690 "entitlements_target", |
648 "extra_system_frameworks", | 691 "extra_system_frameworks", |
649 "product_type", | 692 "product_type", |
650 "public_configs", | 693 "public_configs", |
651 "public_deps", | 694 "public_deps", |
652 "testonly", | 695 "testonly", |
653 "visibility", | 696 "visibility", |
654 ]) | 697 ]) |
655 | 698 |
656 output_name = _output_name | 699 output_name = _output_name |
657 bundle_binary_target = ":$_lipo_executable_target" | 700 bundle_binary_target = ":$_lipo_executable_target" |
658 bundle_binary_output = _output_name | 701 bundle_binary_output = _output_name |
659 | 702 |
660 if (!defined(bundle_deps)) { | 703 if (!defined(bundle_deps)) { |
661 bundle_deps = [] | 704 bundle_deps = [] |
662 } | 705 } |
663 bundle_deps += [ ":$_bundle_data_info_plist" ] | 706 bundle_deps += [ ":$_bundle_data_info_plist" ] |
707 if (_write_pkg_info) { | |
708 bundle_deps += [ ":$_bundle_data_pkg_info" ] | |
709 } | |
664 | 710 |
665 if (use_ios_simulator) { | 711 if (use_ios_simulator) { |
666 if (!defined(data_deps)) { | 712 if (!defined(data_deps)) { |
667 data_deps = [] | 713 data_deps = [] |
668 } | 714 } |
669 data_deps += [ "//testing/iossim" ] | 715 data_deps += [ "//testing/iossim" ] |
670 } | 716 } |
671 | 717 |
672 if (!defined(product_type)) { | 718 if (!defined(product_type)) { |
673 product_type = "com.apple.product-type.application" | 719 product_type = "com.apple.product-type.application" |
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1413 "-rpath", | 1459 "-rpath", |
1414 "-Xlinker", | 1460 "-Xlinker", |
1415 "@loader_path/Frameworks", | 1461 "@loader_path/Frameworks", |
1416 ] | 1462 ] |
1417 } | 1463 } |
1418 } | 1464 } |
1419 | 1465 |
1420 set_defaults("ios_xctest_test") { | 1466 set_defaults("ios_xctest_test") { |
1421 configs = default_executable_configs | 1467 configs = default_executable_configs |
1422 } | 1468 } |
OLD | NEW |