Class: Pod::Target::BuildSettings::PodTargetSettings
- Inherits:
-
Pod::Target::BuildSettings
- Object
- Pod::Target::BuildSettings
- Pod::Target::BuildSettings::PodTargetSettings
- Defined in:
- lib/cocoapods/target/build_settings.rb
Overview
A subclass that generates build settings for a PodTarget
Constant Summary
Constants inherited from Pod::Target::BuildSettings
CONFIGURATION_BUILD_DIR_VARIABLE, PLURAL_SETTINGS, XCFRAMEWORKS_BUILD_DIR_VARIABLE
Public API collapse
-
#app_xcconfig ⇒ Boolean
(also: #app_xcconfig?)
readonly
Whether settings are being generated for an application bundle.
-
#library_xcconfig ⇒ Boolean
(also: #library_xcconfig?)
readonly
Whether settings are being generated for an library bundle.
-
#non_library_spec ⇒ Specification
readonly
The non-library specification these build settings are for or ‘nil`.
-
#test_xcconfig ⇒ Boolean
(also: #test_xcconfig?)
readonly
Whether settings are being generated for a test bundle.
Attributes inherited from Pod::Target::BuildSettings
Public API collapse
- .build_settings_names ⇒ Object
-
#initialize(target, non_library_spec = nil, configuration: nil) ⇒ PodTargetSettings
constructor
Initializes a new instance.
- #non_library_xcconfig? ⇒ Boolean
-
#xcconfig ⇒ Xcodeproj::Xconfig
The ‘xcconfig` build setting for the #target.
Paths collapse
-
#pods_development_language ⇒ String
The ‘pods_development_language` build setting for the #target.
-
#pods_root ⇒ String
The ‘pods_root` build setting for the #target.
-
#pods_target_srcroot ⇒ String
The ‘pods_target_srcroot` build setting for the #target.
Frameworks collapse
-
#consumer_frameworks ⇒ Array<String>
The ‘consumer_frameworks` build setting for the #target.
-
#dynamic_frameworks_to_import ⇒ Array<String>
The ‘dynamic_frameworks_to_import` build setting for the #target.
-
#framework_header_search_path ⇒ String
The ‘framework_header_search_path` build setting for the #target.
-
#framework_search_paths ⇒ Array<String>
The ‘framework_search_paths` build setting for the #target.
-
#framework_search_paths_to_import ⇒ Array<String>
The ‘framework_search_paths_to_import` build setting for the #target.
-
#frameworks ⇒ Array<String>
The ‘frameworks` build setting for the #target.
-
#frameworks_to_import ⇒ Array<String>
The ‘frameworks_to_import` build setting for the #target.
-
#static_frameworks_to_import ⇒ Array<String>
The ‘static_frameworks_to_import` build setting for the #target.
-
#system_framework_search_paths ⇒ Array<String>
The ‘system_framework_search_paths` build setting for the #target.
-
#vendored_dynamic_frameworks ⇒ Array<String>
The ‘vendored_dynamic_frameworks` build setting for the #target.
-
#vendored_framework_search_paths ⇒ Array<String>
The ‘vendored_framework_search_paths` build setting for the #target.
-
#vendored_static_frameworks ⇒ Array<String>
The ‘vendored_static_frameworks` build setting for the #target.
-
#vendored_xcframeworks ⇒ Array<Xcode::XCFramework>
The ‘vendored_xcframeworks` build setting for the #target.
-
#weak_frameworks ⇒ Array<String>
The ‘weak_frameworks` build setting for the #target.
-
#weak_frameworks_to_import ⇒ Array<String>
The ‘weak_frameworks_to_import` build setting for the #target.
Libraries collapse
-
#dynamic_libraries_to_import ⇒ Array<String>
The ‘dynamic_libraries_to_import` build setting for the #target.
-
#libraries ⇒ Array<String>
The ‘libraries` build setting for the #target.
-
#libraries_to_import ⇒ Array<String>
The ‘libraries_to_import` build setting for the #target.
-
#library_search_paths ⇒ Array<String>
The ‘library_search_paths` build setting for the #target.
-
#library_search_paths_to_import ⇒ Array<String>
The ‘library_search_paths_to_import` build setting for the #target.
-
#linker_names_from_libraries(libraries) ⇒ Array<String>
Converts array of library path references to just the names to use link each library, e.g.
-
#static_libraries_to_import ⇒ Array<String>
The ‘static_libraries_to_import` build setting for the #target.
-
#vendored_dynamic_libraries ⇒ Array<String>
The ‘vendored_dynamic_libraries` build setting for the #target.
-
#vendored_dynamic_library_search_paths ⇒ Array<String>
The ‘vendored_dynamic_library_search_paths` build setting for the #target.
-
#vendored_static_libraries ⇒ Array<String>
The ‘vendored_static_libraries` build setting for the #target.
-
#vendored_static_library_search_paths ⇒ Array<String>
The ‘vendored_static_library_search_paths` build setting for the #target.
Clang collapse
-
#header_search_paths ⇒ Array<String>
The ‘header_search_paths` build setting for the #target.
-
#module_map_file_to_import ⇒ Array<String>
The ‘module_map_file_to_import` build setting for the #target.
-
#module_map_files ⇒ Array<String>
The ‘module_map_files` build setting for the #target.
-
#public_header_search_paths ⇒ Array<String>
The ‘public_header_search_paths` build setting for the #target.
Swift collapse
-
#other_swift_flags ⇒ Array<String>
The ‘other_swift_flags` build setting for the #target.
- #other_swift_flags_without_swift? ⇒ Boolean
-
#swift_include_paths ⇒ Array<String>
The ‘swift_include_paths` build setting for the #target.
-
#swift_include_paths_to_import ⇒ Array<String>
The ‘swift_include_paths_to_import` build setting for the #target.
Linking collapse
-
#ld_runpath_search_paths ⇒ Array<String>
The ‘ld_runpath_search_paths` build setting for the #target.
-
#requires_fobjc_arc? ⇒ Boolean
The ‘requires_fobjc_arc?` build setting for the #target.
-
#requires_objc_linker_flag? ⇒ Boolean
Whether the ‘-ObjC` linker flag is required.
Packaging collapse
-
#application_extension_api_only ⇒ String
The ‘application_extension_api_only` build setting for the #target.
-
#build_library_for_distribution ⇒ String
The ‘build_library_for_distribution` build setting for the #target.
-
#configuration_build_dir ⇒ String
The ‘configuration_build_dir` build setting for the #target.
-
#product_bundle_identifier ⇒ String
The ‘product_bundle_identifier` build setting for the #target.
-
#skip_install ⇒ String
The ‘skip_install` build setting for the #target.
Target Properties collapse
-
#dependent_targets ⇒ Array<PodTarget>
The ‘dependent_targets` build setting for the #target.
-
#dependent_targets_to_link ⇒ Array<PodTarget>
The ‘dependent_targets_to_link` build setting for the #target.
-
#file_accessors ⇒ Array<Sandbox::FileAccessor>
The ‘file_accessors` build setting for the #target.
-
#merged_pod_target_xcconfigs ⇒ Hash{String, String}
Merges the
pod_target_xcconfig
for all pod targets into a single hash and warns on conflicting definitions. -
#pod_target_xcconfig_values_by_consumer_by_key ⇒ Hash{String,Hash{Target,String}]
Returns the
pod_target_xcconfig
for the pod target and its spec consumers grouped by keys. -
#should_apply_xctunwrap_fix? ⇒ Boolean
Xcode 11 causes an issue with frameworks or libraries before 12.2 deployment target that link or are part of test bundles that use XCTUnwrap.
-
#spec_consumers ⇒ Array<Specification::Consumer>
The ‘spec_consumers` build setting for the #target.
Methods inherited from Pod::Target::BuildSettings
#clang_warn_quoted_include_in_framework_header, #code_sign_identity, #framework_search_paths_to_import_developer_frameworks, #gcc_preprocessor_definitions, #initialize_copy, #other_cflags, #other_ldflags, #other_module_verifier_flags, #pods_build_dir, #pods_configuration_build_dir, #pods_xcframeworks_build_dir, #save_as, #use_recursive_script_inputs_in_script_phases, xcframework_intermediate_dir
Constructor Details
#initialize(target, non_library_spec = nil, configuration: nil) ⇒ PodTargetSettings
Initializes a new instance
576 577 578 579 580 581 582 583 584 585 586 587 588 589 |
# File 'lib/cocoapods/target/build_settings.rb', line 576 def initialize(target, non_library_spec = nil, configuration: nil) super(target) if @non_library_spec = non_library_spec @test_xcconfig = non_library_spec.test_specification? @app_xcconfig = non_library_spec.app_specification? @xcconfig_spec_type = non_library_spec.spec_type @library_xcconfig = false else @test_xcconfig = @app_xcconfig = false @xcconfig_spec_type = :library @library_xcconfig = true end (@configuration = configuration) || raise("No configuration for #{self}.") end |
Instance Attribute Details
#app_xcconfig ⇒ Boolean (readonly) Also known as: app_xcconfig?
Returns whether settings are being generated for an application bundle.
547 548 549 |
# File 'lib/cocoapods/target/build_settings.rb', line 547 def app_xcconfig @app_xcconfig end |
#library_xcconfig ⇒ Boolean (readonly) Also known as: library_xcconfig?
Returns whether settings are being generated for an library bundle.
553 554 555 |
# File 'lib/cocoapods/target/build_settings.rb', line 553 def library_xcconfig @library_xcconfig end |
#non_library_spec ⇒ Specification (readonly)
Returns The non-library specification these build settings are for or ‘nil`.
563 564 565 |
# File 'lib/cocoapods/target/build_settings.rb', line 563 def non_library_spec @non_library_spec end |
#test_xcconfig ⇒ Boolean (readonly) Also known as: test_xcconfig?
Returns whether settings are being generated for a test bundle.
541 542 543 |
# File 'lib/cocoapods/target/build_settings.rb', line 541 def test_xcconfig @test_xcconfig end |
Class Method Details
.build_settings_names ⇒ Object
534 535 536 |
# File 'lib/cocoapods/target/build_settings.rb', line 534 def self.build_settings_names @build_settings_names | BuildSettings.build_settings_names end |
Instance Method Details
#application_extension_api_only ⇒ String
The ‘application_extension_api_only` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘application_extension_api_only, build_setting, memoized`.
1012 1013 1014 |
# File 'lib/cocoapods/target/build_settings.rb', line 1012 define_build_settings_method :application_extension_api_only, :build_setting => true, :memoized => true do target.application_extension_api_only ? 'YES' : nil end |
#build_library_for_distribution ⇒ String
The ‘build_library_for_distribution` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘build_library_for_distribution, build_setting, memoized`.
1017 1018 1019 |
# File 'lib/cocoapods/target/build_settings.rb', line 1017 define_build_settings_method :build_library_for_distribution, :build_setting => true, :memoized => true do target.build_library_for_distribution ? 'YES' : nil end |
#configuration_build_dir ⇒ String
The ‘configuration_build_dir` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘configuration_build_dir, build_setting, memoized`.
1006 1007 1008 1009 |
# File 'lib/cocoapods/target/build_settings.rb', line 1006 define_build_settings_method :configuration_build_dir, :build_setting => true, :memoized => true do return if non_library_xcconfig? target.configuration_build_dir(CONFIGURATION_BUILD_DIR_VARIABLE) end |
#consumer_frameworks ⇒ Array<String>
The ‘consumer_frameworks` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘consumer_frameworks, memoized`.
621 622 623 |
# File 'lib/cocoapods/target/build_settings.rb', line 621 define_build_settings_method :consumer_frameworks, :memoized => true do spec_consumers.flat_map(&:frameworks) end |
#dependent_targets ⇒ Array<PodTarget>
The ‘dependent_targets` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘dependent_targets, memoized`.
1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 |
# File 'lib/cocoapods/target/build_settings.rb', line 1026 define_build_settings_method :dependent_targets, :memoized => true do select_maximal_pod_targets( if test_xcconfig? target.dependent_targets_for_test_spec(non_library_spec, :configuration => @configuration) elsif app_xcconfig? target.dependent_targets_for_app_spec(non_library_spec, :configuration => @configuration) else target.recursive_dependent_targets(:configuration => @configuration) end, ) end |
#dependent_targets_to_link ⇒ Array<PodTarget>
The ‘dependent_targets_to_link` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘dependent_targets_to_link, memoized`.
1039 1040 1041 1042 1043 1044 1045 1046 1047 |
# File 'lib/cocoapods/target/build_settings.rb', line 1039 define_build_settings_method :dependent_targets_to_link, :memoized => true do if test_xcconfig? # we're embedding into an app defined by an app spec host_targets = target.app_host_dependent_targets_for_spec(non_library_spec, :configuration => @configuration) dependent_targets - host_targets else dependent_targets end end |
#dynamic_frameworks_to_import ⇒ Array<String>
The ‘dynamic_frameworks_to_import` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘dynamic_frameworks_to_import, memoized`.
671 672 673 674 675 676 677 678 679 680 |
# File 'lib/cocoapods/target/build_settings.rb', line 671 define_build_settings_method :dynamic_frameworks_to_import, :memoized => true do dynamic_frameworks_to_import = vendored_dynamic_frameworks.map { |f| File.basename(f, '.framework') } dynamic_frameworks_to_import.concat vendored_xcframeworks. select { |xcf| xcf.build_type.dynamic_framework? }. map(&:name). uniq dynamic_frameworks_to_import << target.product_basename if target.should_build? && target.build_as_dynamic_framework? dynamic_frameworks_to_import.concat consumer_frameworks dynamic_frameworks_to_import end |
#dynamic_libraries_to_import ⇒ Array<String>
The ‘dynamic_libraries_to_import` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘dynamic_libraries_to_import, memoized`.
814 815 816 817 818 819 |
# File 'lib/cocoapods/target/build_settings.rb', line 814 define_build_settings_method :dynamic_libraries_to_import, :memoized => true do dynamic_libraries_to_import = linker_names_from_libraries(vendored_dynamic_libraries) dynamic_libraries_to_import.concat spec_consumers.flat_map(&:libraries) dynamic_libraries_to_import << target.product_basename if target.should_build? && target.build_as_dynamic_library? dynamic_libraries_to_import end |
#file_accessors ⇒ Array<Sandbox::FileAccessor>
The ‘file_accessors` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘file_accessors, memoized`.
1073 1074 1075 1076 1077 1078 1079 |
# File 'lib/cocoapods/target/build_settings.rb', line 1073 define_build_settings_method :file_accessors, :memoized => true do if non_library_xcconfig? target.file_accessors.select { |fa| non_library_spec == fa.spec } else target.file_accessors.select { |fa| fa.spec.spec_type == @xcconfig_spec_type } end end |
#framework_header_search_path ⇒ String
The ‘framework_header_search_path` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘framework_header_search_path, memoized`.
711 712 713 714 |
# File 'lib/cocoapods/target/build_settings.rb', line 711 define_build_settings_method :framework_header_search_path, :memoized => true do return unless target.build_as_framework? "#{target.build_product_path}/Headers" end |
#framework_search_paths ⇒ Array<String>
The ‘framework_search_paths` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘framework_search_paths, build_setting, memoized, sorted, uniqued`.
702 703 704 705 706 707 708 |
# File 'lib/cocoapods/target/build_settings.rb', line 702 define_build_settings_method :framework_search_paths, :build_setting => true, :memoized => true, :sorted => true, :uniqued => true do paths = super().dup paths.concat dependent_targets.flat_map { |pt| pt.build_settings[@configuration].framework_search_paths_to_import } paths.concat framework_search_paths_to_import paths.delete(target.configuration_build_dir(CONFIGURATION_BUILD_DIR_VARIABLE)) if library_xcconfig? paths end |
#framework_search_paths_to_import ⇒ Array<String>
The ‘framework_search_paths_to_import` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘framework_search_paths_to_import, memoized`.
731 732 733 734 735 736 737 |
# File 'lib/cocoapods/target/build_settings.rb', line 731 define_build_settings_method :framework_search_paths_to_import, :memoized => true do paths = framework_search_paths_to_import_developer_frameworks(consumer_frameworks) paths.concat vendored_framework_search_paths return paths unless target.build_as_framework? && target.should_build? paths + [target.configuration_build_dir(CONFIGURATION_BUILD_DIR_VARIABLE)] end |
#frameworks ⇒ Array<String>
The ‘frameworks` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘frameworks, memoized, sorted, uniqued`.
626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 |
# File 'lib/cocoapods/target/build_settings.rb', line 626 define_build_settings_method :frameworks, :memoized => true, :sorted => true, :uniqued => true do return [] if target.build_as_static? && library_xcconfig? frameworks = [] frameworks.concat consumer_frameworks if library_xcconfig? # We know that this library target is being built dynamically based # on the guard above, so include any vendored static frameworks and vendored xcframeworks. if target.should_build? frameworks.concat vendored_static_frameworks.map { |l| File.basename(l, '.framework') } frameworks.concat vendored_xcframeworks. select { |xcf| xcf.build_type.static_framework? }. map(&:name). uniq # Include direct dynamic dependencies to the linker flags. We used to add those in the 'Link Binary With Libraries' # phase but we no longer do since we cannot differentiate between debug or release configurations within # that phase. frameworks.concat target.dependent_targets_by_config[@configuration].flat_map { |pt| pt.build_settings[@configuration].dynamic_frameworks_to_import } else # Also include any vendored dynamic frameworks of dependencies. frameworks.concat dependent_targets.reject(&:should_build?).flat_map { |pt| pt.build_settings[@configuration].dynamic_frameworks_to_import } end else frameworks.concat dependent_targets_to_link.flat_map { |pt| pt.build_settings[@configuration].frameworks_to_import } end frameworks end |
#frameworks_to_import ⇒ Array<String>
The ‘frameworks_to_import` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘frameworks_to_import, memoized, sorted, uniqued`.
692 693 694 |
# File 'lib/cocoapods/target/build_settings.rb', line 692 define_build_settings_method :frameworks_to_import, :memoized => true, :sorted => true, :uniqued => true do static_frameworks_to_import + dynamic_frameworks_to_import end |
#header_search_paths ⇒ Array<String>
The ‘header_search_paths` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘header_search_paths, build_setting, memoized, sorted`.
907 908 909 910 911 912 913 914 915 916 917 918 |
# File 'lib/cocoapods/target/build_settings.rb', line 907 define_build_settings_method :header_search_paths, :build_setting => true, :memoized => true, :sorted => true do paths = target.header_search_paths(:include_dependent_targets_for_test_spec => test_xcconfig? && non_library_spec, :include_dependent_targets_for_app_spec => app_xcconfig? && non_library_spec, :configuration => @configuration) dependent_vendored_xcframeworks = [] dependent_vendored_xcframeworks.concat vendored_xcframeworks dependent_vendored_xcframeworks.concat dependent_targets.flat_map { |pt| pt.build_settings[@configuration].vendored_xcframeworks } paths.concat dependent_vendored_xcframeworks. select { |xcf| xcf.build_type.static_library? }. map { |xcf| "#{BuildSettings.xcframework_intermediate_dir(xcf)}/Headers" }. compact paths end |
#ld_runpath_search_paths ⇒ Array<String>
The ‘ld_runpath_search_paths` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘ld_runpath_search_paths, build_setting, memoized`.
985 986 987 988 989 |
# File 'lib/cocoapods/target/build_settings.rb', line 985 define_build_settings_method :ld_runpath_search_paths, :build_setting => true, :memoized => true do return if library_xcconfig? _ld_runpath_search_paths(:test_bundle => test_xcconfig?, :uses_swift => other_swift_flags_without_swift? || dependent_targets.any?(&:uses_swift?)) end |
#libraries ⇒ Array<String>
The ‘libraries` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘libraries, memoized, sorted, uniqued`.
778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 |
# File 'lib/cocoapods/target/build_settings.rb', line 778 define_build_settings_method :libraries, :memoized => true, :sorted => true, :uniqued => true do return [] if library_xcconfig? && target.build_as_static? libraries = [] if non_library_xcconfig? || target.build_as_dynamic? libraries.concat linker_names_from_libraries(vendored_static_libraries) libraries.concat libraries_to_import xcframework_libraries = vendored_xcframeworks. select { |xcf| xcf.build_type.static_library? }. flat_map { |xcf| linker_names_from_libraries([xcf.slices.first.binary_path]) }. uniq libraries.concat xcframework_libraries end if non_library_xcconfig? libraries.concat dependent_targets.flat_map { |pt| pt.build_settings[@configuration].dynamic_libraries_to_import } libraries.concat dependent_targets_to_link.flat_map { |pt| pt.build_settings[@configuration].static_libraries_to_import } end libraries end |
#libraries_to_import ⇒ Array<String>
The ‘libraries_to_import` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘libraries_to_import, memoized, sorted, uniqued`.
822 823 824 |
# File 'lib/cocoapods/target/build_settings.rb', line 822 define_build_settings_method :libraries_to_import, :memoized => true, :sorted => true, :uniqued => true do static_libraries_to_import + dynamic_libraries_to_import end |
#library_search_paths ⇒ Array<String>
The ‘library_search_paths` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘library_search_paths, build_setting, memoized, sorted, uniqued`.
827 828 829 830 831 832 833 834 835 836 837 838 839 840 |
# File 'lib/cocoapods/target/build_settings.rb', line 827 define_build_settings_method :library_search_paths, :build_setting => true, :memoized => true, :sorted => true, :uniqued => true do library_search_paths = should_apply_xctunwrap_fix? ? ['$(PLATFORM_DIR)/Developer/usr/lib'] : [] return library_search_paths if library_xcconfig? && target.build_as_static? library_search_paths.concat library_search_paths_to_import.dup library_search_paths.concat dependent_targets.flat_map { |pt| pt.build_settings[@configuration].vendored_dynamic_library_search_paths } if library_xcconfig? library_search_paths.delete(target.configuration_build_dir(CONFIGURATION_BUILD_DIR_VARIABLE)) else library_search_paths.concat(dependent_targets.flat_map { |pt| pt.build_settings[@configuration].library_search_paths_to_import }) end library_search_paths end |
#library_search_paths_to_import ⇒ Array<String>
The ‘library_search_paths_to_import` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘library_search_paths_to_import, memoized`.
871 872 873 874 875 876 877 878 879 880 881 |
# File 'lib/cocoapods/target/build_settings.rb', line 871 define_build_settings_method :library_search_paths_to_import, :memoized => true do search_paths = vendored_static_library_search_paths + vendored_dynamic_library_search_paths if target.uses_swift? || other_swift_flags_without_swift? search_paths << '/usr/lib/swift' search_paths << '${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}' search_paths << '$(PLATFORM_DIR)/Developer/Library/Frameworks' if test_xcconfig? end return search_paths if target.build_as_framework? || !target.should_build? search_paths << target.configuration_build_dir(CONFIGURATION_BUILD_DIR_VARIABLE) end |
#linker_names_from_libraries(libraries) ⇒ Array<String>
Converts array of library path references to just the names to use link each library, e.g. from ‘/path/to/libSomething.a’ to ‘Something’
773 774 775 |
# File 'lib/cocoapods/target/build_settings.rb', line 773 def linker_names_from_libraries(libraries) libraries.map { |l| File.basename(l, File.extname(l)).sub(/\Alib/, '') } end |
#merged_pod_target_xcconfigs ⇒ Hash{String, String}
Merges the pod_target_xcconfig
for all pod targets into a single hash and warns on conflicting definitions.
The ‘merged_pod_target_xcconfigs` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘merged_pod_target_xcconfigs, memoized`.
1067 1068 1069 1070 |
# File 'lib/cocoapods/target/build_settings.rb', line 1067 define_build_settings_method :merged_pod_target_xcconfigs, :memoized => true do merged_xcconfigs(pod_target_xcconfig_values_by_consumer_by_key, :pod_target_xcconfig, :overriding => non_library_xcconfig? ? target.build_settings[@configuration].merged_pod_target_xcconfigs : {}) end |
#module_map_file_to_import ⇒ Array<String>
The ‘module_map_file_to_import` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘module_map_file_to_import, memoized`.
893 894 895 896 897 898 899 900 901 902 903 904 |
# File 'lib/cocoapods/target/build_settings.rb', line 893 define_build_settings_method :module_map_file_to_import, :memoized => true do return unless target.should_build? return if target.build_as_framework? # framework module maps are automatically discovered return unless target.defines_module? if target.uses_swift? # for swift, we have a custom build phase that copies in the module map, appending the .Swift module "${PODS_CONFIGURATION_BUILD_DIR}/#{target.label}/#{target.product_module_name}.modulemap" else "${PODS_ROOT}/#{target.module_map_path.relative_path_from(target.sandbox.root)}" end end |
#module_map_files ⇒ Array<String>
The ‘module_map_files` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘module_map_files, memoized`.
888 889 890 |
# File 'lib/cocoapods/target/build_settings.rb', line 888 define_build_settings_method :module_map_files, :memoized => true do dependent_targets.map { |pt| pt.build_settings[@configuration].module_map_file_to_import }.compact.sort end |
#non_library_xcconfig? ⇒ Boolean
556 557 558 |
# File 'lib/cocoapods/target/build_settings.rb', line 556 def non_library_xcconfig? !library_xcconfig? end |
#other_swift_flags ⇒ Array<String>
The ‘other_swift_flags` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘other_swift_flags, build_setting, memoized`.
937 938 939 940 941 942 943 944 945 946 |
# File 'lib/cocoapods/target/build_settings.rb', line 937 define_build_settings_method :other_swift_flags, :build_setting => true, :memoized => true do return unless target.uses_swift? || other_swift_flags_without_swift? flags = super() flags << '-suppress-warnings' if target.inhibit_warnings? && library_xcconfig? if !target.build_as_framework? && target.defines_module? && library_xcconfig? flags.concat %w( -import-underlying-module -Xcc -fmodule-map-file=${SRCROOT}/${MODULEMAP_FILE} ) end flags end |
#other_swift_flags_without_swift? ⇒ Boolean
930 931 932 933 934 |
# File 'lib/cocoapods/target/build_settings.rb', line 930 def other_swift_flags_without_swift? return false if library_xcconfig? target.uses_swift_for_spec?(non_library_spec) end |
#pod_target_xcconfig_values_by_consumer_by_key ⇒ Hash{String,Hash{Target,String}]
Returns the pod_target_xcconfig
for the pod target and its spec consumers grouped by keys
1054 1055 1056 1057 1058 1059 1060 |
# File 'lib/cocoapods/target/build_settings.rb', line 1054 def pod_target_xcconfig_values_by_consumer_by_key spec_consumers.each_with_object({}) do |spec_consumer, hash| spec_consumer.pod_target_xcconfig.each do |k, v| (hash[k] ||= {})[spec_consumer] = v end end end |
#pods_development_language ⇒ String
The ‘pods_development_language` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘pods_development_language, build_setting`.
612 613 614 |
# File 'lib/cocoapods/target/build_settings.rb', line 612 define_build_settings_method :pods_development_language, :build_setting => true do '${DEVELOPMENT_LANGUAGE}' end |
#pods_root ⇒ String
The ‘pods_root` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘pods_root, build_setting`.
602 603 604 |
# File 'lib/cocoapods/target/build_settings.rb', line 602 define_build_settings_method :pods_root, :build_setting => true do '${SRCROOT}' end |
#pods_target_srcroot ⇒ String
The ‘pods_target_srcroot` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘pods_target_srcroot, build_setting`.
607 608 609 |
# File 'lib/cocoapods/target/build_settings.rb', line 607 define_build_settings_method :pods_target_srcroot, :build_setting => true do target.pod_target_srcroot end |
#product_bundle_identifier ⇒ String
The ‘product_bundle_identifier` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘product_bundle_identifier, build_setting`.
1001 1002 1003 |
# File 'lib/cocoapods/target/build_settings.rb', line 1001 define_build_settings_method :product_bundle_identifier, :build_setting => true do 'org.cocoapods.${PRODUCT_NAME:rfc1034identifier}' end |
#public_header_search_paths ⇒ Array<String>
The ‘public_header_search_paths` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘public_header_search_paths, memoized, sorted`.
921 922 923 |
# File 'lib/cocoapods/target/build_settings.rb', line 921 define_build_settings_method :public_header_search_paths, :memoized => true, :sorted => true do target.header_search_paths(:include_dependent_targets_for_test_spec => test_xcconfig? && non_library_spec, :include_dependent_targets_for_app_spec => app_xcconfig? && non_library_spec, :include_private_headers => false, :configuration => @configuration) end |
#requires_fobjc_arc? ⇒ Boolean
The ‘requires_fobjc_arc?` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘requires_fobjc_arc?, memoized`.
979 980 981 982 |
# File 'lib/cocoapods/target/build_settings.rb', line 979 define_build_settings_method :requires_fobjc_arc?, :memoized => true do target.podfile.set_arc_compatibility_flag? && file_accessors.any? { |fa| fa.spec_consumer.requires_arc? } end |
#requires_objc_linker_flag? ⇒ Boolean
this is only true when generating build settings for a test bundle
Returns whether the ‘-ObjC` linker flag is required.
973 974 975 |
# File 'lib/cocoapods/target/build_settings.rb', line 973 def requires_objc_linker_flag? test_xcconfig? || app_xcconfig? end |
#should_apply_xctunwrap_fix? ⇒ Boolean
Xcode 11 causes an issue with frameworks or libraries before 12.2 deployment target that link or are part of test bundles that use XCTUnwrap. Apple has provided an official work around for this.
The ‘should_apply_xctunwrap_fix?` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘should_apply_xctunwrap_fix?, memoized`.
1097 1098 1099 1100 1101 1102 |
# File 'lib/cocoapods/target/build_settings.rb', line 1097 define_build_settings_method :should_apply_xctunwrap_fix?, :memoized => true do library_xcconfig? && target.platform.name == :ios && Version.new(target.platform.deployment_target) < Version.new('12.2') && (frameworks_to_import + weak_frameworks_to_import).uniq.include?('XCTest') end |
#skip_install ⇒ String
The ‘skip_install` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘skip_install, build_setting`.
996 997 998 |
# File 'lib/cocoapods/target/build_settings.rb', line 996 define_build_settings_method :skip_install, :build_setting => true do 'YES' end |
#spec_consumers ⇒ Array<Specification::Consumer>
The ‘spec_consumers` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘spec_consumers, memoized`.
1082 1083 1084 1085 1086 1087 1088 |
# File 'lib/cocoapods/target/build_settings.rb', line 1082 define_build_settings_method :spec_consumers, :memoized => true do if non_library_xcconfig? target.spec_consumers.select { |sc| non_library_spec == sc.spec } else target.spec_consumers.select { |sc| sc.spec.spec_type == @xcconfig_spec_type } end end |
#static_frameworks_to_import ⇒ Array<String>
The ‘static_frameworks_to_import` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘static_frameworks_to_import, memoized`.
657 658 659 660 661 662 663 664 665 666 667 668 |
# File 'lib/cocoapods/target/build_settings.rb', line 657 define_build_settings_method :static_frameworks_to_import, :memoized => true do static_frameworks_to_import = [] static_frameworks_to_import.concat vendored_static_frameworks.map { |f| File.basename(f, '.framework') } unless target.should_build? && target.build_as_dynamic? unless target.should_build? && target.build_as_dynamic? static_frameworks_to_import.concat vendored_xcframeworks. select { |xcf| xcf.build_type.static_framework? }. map(&:name). uniq end static_frameworks_to_import << target.product_basename if target.should_build? && target.build_as_static_framework? static_frameworks_to_import end |
#static_libraries_to_import ⇒ Array<String>
The ‘static_libraries_to_import` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘static_libraries_to_import, memoized`.
799 800 801 802 803 804 805 806 807 808 809 810 811 |
# File 'lib/cocoapods/target/build_settings.rb', line 799 define_build_settings_method :static_libraries_to_import, :memoized => true do static_libraries_to_import = [] unless target.should_build? && target.build_as_dynamic? static_libraries_to_import.concat linker_names_from_libraries(vendored_static_libraries) xcframework_libraries = vendored_xcframeworks. select { |xcf| xcf.build_type.static_library? }. flat_map { |xcf| linker_names_from_libraries([xcf.slices.first.binary_path]) }. uniq static_libraries_to_import.concat linker_names_from_libraries(xcframework_libraries) end static_libraries_to_import << target.product_basename if target.should_build? && target.build_as_static_library? static_libraries_to_import end |
#swift_include_paths ⇒ Array<String>
The ‘swift_include_paths` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘swift_include_paths, build_setting, memoized, sorted, uniqued`.
949 950 951 952 953 954 955 956 |
# File 'lib/cocoapods/target/build_settings.rb', line 949 define_build_settings_method :swift_include_paths, :build_setting => true, :memoized => true, :sorted => true, :uniqued => true do paths = dependent_targets.flat_map { |pt| pt.build_settings[@configuration].swift_include_paths_to_import } paths.concat swift_include_paths_to_import if non_library_xcconfig? vendored_static_library_search_paths = dependent_targets.flat_map { |pt| pt.build_settings[@configuration].vendored_static_library_search_paths } paths.concat vendored_static_library_search_paths paths.concat ['$(PLATFORM_DIR)/Developer/usr/lib'] if should_apply_xctunwrap_fix? paths end |
#swift_include_paths_to_import ⇒ Array<String>
The ‘swift_include_paths_to_import` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘swift_include_paths_to_import, memoized`.
959 960 961 962 963 |
# File 'lib/cocoapods/target/build_settings.rb', line 959 define_build_settings_method :swift_include_paths_to_import, :memoized => true do return [] unless target.uses_swift? && !target.build_as_framework? [target.configuration_build_dir(CONFIGURATION_BUILD_DIR_VARIABLE)] end |
#system_framework_search_paths ⇒ Array<String>
The ‘system_framework_search_paths` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘system_framework_search_paths, build_setting, memoized, sorted, uniqued`.
757 758 759 760 |
# File 'lib/cocoapods/target/build_settings.rb', line 757 define_build_settings_method :system_framework_search_paths, :build_setting => true, :memoized => true, :sorted => true, :uniqued => true do return ['$(PLATFORM_DIR)/Developer/Library/Frameworks'] if should_apply_xctunwrap_fix? [] end |
#vendored_dynamic_frameworks ⇒ Array<String>
The ‘vendored_dynamic_frameworks` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘vendored_dynamic_frameworks, memoized`.
745 746 747 |
# File 'lib/cocoapods/target/build_settings.rb', line 745 define_build_settings_method :vendored_dynamic_frameworks, :memoized => true do file_accessors.flat_map(&:vendored_dynamic_frameworks) end |
#vendored_dynamic_libraries ⇒ Array<String>
The ‘vendored_dynamic_libraries` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘vendored_dynamic_libraries, memoized`.
848 849 850 |
# File 'lib/cocoapods/target/build_settings.rb', line 848 define_build_settings_method :vendored_dynamic_libraries, :memoized => true do file_accessors.flat_map(&:vendored_dynamic_libraries) end |
#vendored_dynamic_library_search_paths ⇒ Array<String>
The ‘vendored_dynamic_library_search_paths` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘vendored_dynamic_library_search_paths, memoized`.
862 863 864 865 866 867 868 |
# File 'lib/cocoapods/target/build_settings.rb', line 862 define_build_settings_method :vendored_dynamic_library_search_paths, :memoized => true do paths = vendored_dynamic_libraries.map { |f| File.join '${PODS_ROOT}', f.dirname.relative_path_from(target.sandbox.root) } paths.concat vendored_xcframeworks. select { |xcf| xcf.build_type.dynamic_library? }. map { |xcf| BuildSettings.xcframework_intermediate_dir(xcf) } paths end |
#vendored_framework_search_paths ⇒ Array<String>
The ‘vendored_framework_search_paths` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘vendored_framework_search_paths, memoized`.
717 718 719 720 721 722 723 724 725 726 727 728 |
# File 'lib/cocoapods/target/build_settings.rb', line 717 define_build_settings_method :vendored_framework_search_paths, :memoized => true do search_paths = [] search_paths.concat file_accessors. flat_map(&:vendored_frameworks). map { |f| File.join '${PODS_ROOT}', f.dirname.relative_path_from(target.sandbox.root) } xcframework_intermediates = vendored_xcframeworks. select { |xcf| xcf.build_type.framework? }. map { |xcf| BuildSettings.xcframework_intermediate_dir(xcf) }. uniq search_paths.concat xcframework_intermediates search_paths end |
#vendored_static_frameworks ⇒ Array<String>
The ‘vendored_static_frameworks` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘vendored_static_frameworks, memoized`.
740 741 742 |
# File 'lib/cocoapods/target/build_settings.rb', line 740 define_build_settings_method :vendored_static_frameworks, :memoized => true do file_accessors.flat_map(&:vendored_static_frameworks) end |
#vendored_static_libraries ⇒ Array<String>
The ‘vendored_static_libraries` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘vendored_static_libraries, memoized`.
843 844 845 |
# File 'lib/cocoapods/target/build_settings.rb', line 843 define_build_settings_method :vendored_static_libraries, :memoized => true do file_accessors.flat_map(&:vendored_static_libraries) end |
#vendored_static_library_search_paths ⇒ Array<String>
The ‘vendored_static_library_search_paths` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘vendored_static_library_search_paths, memoized`.
853 854 855 856 857 858 859 |
# File 'lib/cocoapods/target/build_settings.rb', line 853 define_build_settings_method :vendored_static_library_search_paths, :memoized => true do paths = vendored_static_libraries.map { |f| File.join '${PODS_ROOT}', f.dirname.relative_path_from(target.sandbox.root) } paths.concat vendored_xcframeworks. select { |xcf| xcf.build_type.static_library? }. map { |xcf| BuildSettings.xcframework_intermediate_dir(xcf) } paths end |
#vendored_xcframeworks ⇒ Array<Xcode::XCFramework>
The ‘vendored_xcframeworks` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘vendored_xcframeworks, memoized`.
750 751 752 753 754 |
# File 'lib/cocoapods/target/build_settings.rb', line 750 define_build_settings_method :vendored_xcframeworks, :memoized => true do file_accessors.flat_map do |file_accessor| file_accessor.vendored_xcframeworks.map { |path| load_xcframework(file_accessor.spec.name, path) } end end |
#weak_frameworks ⇒ Array<String>
The ‘weak_frameworks` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘weak_frameworks, memoized`.
683 684 685 686 687 688 689 |
# File 'lib/cocoapods/target/build_settings.rb', line 683 define_build_settings_method :weak_frameworks, :memoized => true do return [] if target.build_as_static? && library_xcconfig? weak_frameworks = spec_consumers.flat_map(&:weak_frameworks) weak_frameworks.concat dependent_targets.flat_map { |pt| pt.build_settings[@configuration].weak_frameworks_to_import } weak_frameworks end |
#weak_frameworks_to_import ⇒ Array<String>
The ‘weak_frameworks_to_import` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘weak_frameworks_to_import, memoized, sorted, uniqued`.
697 698 699 |
# File 'lib/cocoapods/target/build_settings.rb', line 697 define_build_settings_method :weak_frameworks_to_import, :memoized => true, :sorted => true, :uniqued => true do spec_consumers.flat_map(&:weak_frameworks) end |
#xcconfig ⇒ Xcodeproj::Xconfig
The ‘xcconfig` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘xcconfig, memoized`.
592 593 594 595 |
# File 'lib/cocoapods/target/build_settings.rb', line 592 define_build_settings_method :xcconfig, :memoized => true do xcconfig = super() merge_spec_xcconfig_into_xcconfig(merged_pod_target_xcconfigs, xcconfig) end |