Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(257)

Side by Side Diff: build/config/ios/rules.gni

Issue 2559323005: Add support for generating PkgInfo for application bundle on iOS. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | build/config/mac/write_pkg_info.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 # default to ios_enable_code_signing if not defined. 413 # default to ios_enable_code_signing if not defined.
414 # 414 #
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")
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
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 "$target_gen_dir/$target_name",
rohitrao (ping after 24h) 2016/12/09 12:14:42 Why is the output of this step not a file named Pk
sdefresne 2016/12/09 13:50:19 $target_gen_dir does not depends on the current ta
rohitrao (ping after 24h) 2016/12/09 13:51:51 Nope, it was just unexpected. Perhaps summarize w
656 ]
657 args = [ "--plist" ] + rebase_path(sources, root_build_dir) +
658 [ "--output" ] + rebase_path(outputs, root_build_dir)
659 deps = [
660 ":$_generate_info_plist",
661 ]
662 }
663
664 _bundle_data_pkg_info = target_name + "_bundle_data_pkg_info"
665 bundle_data(_bundle_data_pkg_info) {
666 forward_variables_from(invoker, [ "testonly" ])
667 sources = get_target_outputs(":$_create_pkg_info")
668 outputs = [
669 "{{bundle_resources_dir}}/PkgInfo",
670 ]
671 public_deps = [
672 ":$_create_pkg_info",
673 ]
674 }
675 }
676
637 create_signed_bundle(_target_name) { 677 create_signed_bundle(_target_name) {
638 forward_variables_from(invoker, 678 forward_variables_from(invoker,
639 [ 679 [
640 "bundle_deps", 680 "bundle_deps",
641 "bundle_deps_filter", 681 "bundle_deps_filter",
642 "bundle_extension", 682 "bundle_extension",
643 "data_deps", 683 "data_deps",
644 "deps", 684 "deps",
645 "enable_code_signing", 685 "enable_code_signing",
646 "entitlements_path", 686 "entitlements_path",
647 "entitlements_target", 687 "entitlements_target",
648 "extra_system_frameworks", 688 "extra_system_frameworks",
649 "product_type", 689 "product_type",
650 "public_configs", 690 "public_configs",
651 "public_deps", 691 "public_deps",
652 "testonly", 692 "testonly",
653 "visibility", 693 "visibility",
654 ]) 694 ])
655 695
656 output_name = _output_name 696 output_name = _output_name
657 bundle_binary_target = ":$_lipo_executable_target" 697 bundle_binary_target = ":$_lipo_executable_target"
658 bundle_binary_output = _output_name 698 bundle_binary_output = _output_name
659 699
660 if (!defined(bundle_deps)) { 700 if (!defined(bundle_deps)) {
661 bundle_deps = [] 701 bundle_deps = []
662 } 702 }
663 bundle_deps += [ ":$_bundle_data_info_plist" ] 703 bundle_deps += [ ":$_bundle_data_info_plist" ]
704 if (_write_pkg_info) {
705 bundle_deps += [ ":$_bundle_data_pkg_info" ]
706 }
664 707
665 if (use_ios_simulator) { 708 if (use_ios_simulator) {
666 if (!defined(data_deps)) { 709 if (!defined(data_deps)) {
667 data_deps = [] 710 data_deps = []
668 } 711 }
669 data_deps += [ "//testing/iossim" ] 712 data_deps += [ "//testing/iossim" ]
670 } 713 }
671 714
672 if (!defined(product_type)) { 715 if (!defined(product_type)) {
673 product_type = "com.apple.product-type.application" 716 product_type = "com.apple.product-type.application"
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after
1413 "-rpath", 1456 "-rpath",
1414 "-Xlinker", 1457 "-Xlinker",
1415 "@loader_path/Frameworks", 1458 "@loader_path/Frameworks",
1416 ] 1459 ]
1417 } 1460 }
1418 } 1461 }
1419 1462
1420 set_defaults("ios_xctest_test") { 1463 set_defaults("ios_xctest_test") {
1421 configs = default_executable_configs 1464 configs = default_executable_configs
1422 } 1465 }
OLDNEW
« no previous file with comments | « no previous file | build/config/mac/write_pkg_info.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698