Class: Pod::Target::BuildSettings::AggregateTargetSettings
- Inherits:
-
Pod::Target::BuildSettings
- Object
- Pod::Target::BuildSettings
- Pod::Target::BuildSettings::AggregateTargetSettings
- 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
Public API collapse
-
#configuration_name ⇒ String
readonly
The build configuration these settings will be used for.
Attributes inherited from Pod::Target::BuildSettings
Public API collapse
- .build_settings_names ⇒ Object
-
#initialize(target, configuration_name) ⇒ AggregateTargetSettings
constructor
Intializes a new instance.
-
#xcconfig ⇒ Xcodeproj::Config
The ‘xcconfig` build setting for the #target.
Paths collapse
-
#pods_podfile_dir_path ⇒ String
The ‘pods_podfile_dir_path` build setting for the #target.
-
#pods_root ⇒ String
The ‘pods_root` build setting for the #target.
Frameworks collapse
-
#framework_search_paths ⇒ Array<String>
The ‘framework_search_paths` build setting for the #target.
-
#frameworks ⇒ Array<String>
The ‘frameworks` build setting for the #target.
-
#weak_frameworks ⇒ Array<String>
The ‘weak_frameworks` build setting for the #target.
Libraries collapse
-
#libraries ⇒ Array<String>
The ‘libraries` build setting for the #target.
-
#library_search_paths ⇒ Array<String>
The ‘library_search_paths` build setting for the #target.
Clang collapse
-
#framework_header_paths_for_iquote ⇒ Array<String>
The ‘framework_header_paths_for_iquote` build setting for the #target.
-
#header_search_paths ⇒ Array<String>
The ‘header_search_paths` build setting for the #target.
-
#module_map_files ⇒ Array<String>
The ‘module_map_files` build setting for the #target.
-
#other_cflags ⇒ Array<String>
The ‘other_cflags` build setting for the #target.
Swift collapse
-
#always_embed_swift_standard_libraries ⇒ String
The ‘always_embed_swift_standard_libraries` build setting for the #target.
-
#embedded_content_contains_swift ⇒ String
The ‘embedded_content_contains_swift` build setting for the #target.
-
#must_embed_swift? ⇒ Boolean
The ‘must_embed_swift?` 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.
Linking collapse
-
#any_vendored_dynamic_artifacts? ⇒ Boolean
The ‘any_vendored_dynamic_artifacts?` build setting for the #target.
-
#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
The ‘requires_objc_linker_flag?` build setting for the #target.
Target Properties collapse
-
#merged_user_target_xcconfigs ⇒ Hash{String, String}
Merges the
user_target_xcconfig
for all pod targets into a single hash and warns on conflicting definitions. -
#pod_targets ⇒ Array<PodTarget>
Returns the PodTargets which are active for the current configuration name.
-
#pod_targets_to_link ⇒ Array<PodTarget>
The ‘pod_targets_to_link` build setting for the #target.
-
#search_paths_aggregate_target_pod_target_build_settings ⇒ Array<PodTarget>
The ‘search_paths_aggregate_target_pod_target_build_settings` build setting for the #target.
-
#target_swift_version ⇒ Version
The ‘target_swift_version` build setting for the #target.
-
#user_target_xcconfig_values_by_consumer_by_key ⇒ Hash{String,Hash{Target,String}]
Returns the
user_target_xcconfig
for all pod targets and their spec consumers grouped by keys.
Methods inherited from Pod::Target::BuildSettings
#code_sign_identity, #framework_search_paths_to_import_developer_frameworks, #gcc_preprocessor_definitions, #initialize_copy, #other_ldflags, #other_swift_flags, #pods_build_dir, #pods_configuration_build_dir, #save_as
Constructor Details
#initialize(target, configuration_name) ⇒ AggregateTargetSettings
Intializes a new instance
840 841 842 843 |
# File 'lib/cocoapods/target/build_settings.rb', line 840 def initialize(target, configuration_name) super(target) @configuration_name = configuration_name end |
Instance Attribute Details
#configuration_name ⇒ String (readonly)
Returns The build configuration these settings will be used for.
830 831 832 |
# File 'lib/cocoapods/target/build_settings.rb', line 830 def configuration_name @configuration_name end |
Class Method Details
.build_settings_names ⇒ Object
824 825 826 |
# File 'lib/cocoapods/target/build_settings.rb', line 824 def self.build_settings_names @build_settings_names | BuildSettings.build_settings_names end |
Instance Method Details
#always_embed_swift_standard_libraries ⇒ String
The ‘always_embed_swift_standard_libraries` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘always_embed_swift_standard_libraries, build_setting, memoized`.
952 953 954 955 956 957 |
# File 'lib/cocoapods/target/build_settings.rb', line 952 define_build_settings_method :always_embed_swift_standard_libraries, :build_setting => true, :memoized => true do return unless return if target_swift_version < EMBED_STANDARD_LIBRARIES_MINIMUM_VERSION 'YES' end |
#any_vendored_dynamic_artifacts? ⇒ Boolean
The ‘any_vendored_dynamic_artifacts?` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘any_vendored_dynamic_artifacts?, memoized`.
985 986 987 988 989 990 991 |
# File 'lib/cocoapods/target/build_settings.rb', line 985 define_build_settings_method :any_vendored_dynamic_artifacts?, :memoized => true do pod_targets.any? do |pt| pt.file_accessors.any? do |fa| fa.vendored_dynamic_artifacts.any? end end end |
#embedded_content_contains_swift ⇒ String
The ‘embedded_content_contains_swift` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘embedded_content_contains_swift, build_setting, memoized`.
960 961 962 963 964 965 |
# File 'lib/cocoapods/target/build_settings.rb', line 960 define_build_settings_method :embedded_content_contains_swift, :build_setting => true, :memoized => true do return unless return if target_swift_version >= EMBED_STANDARD_LIBRARIES_MINIMUM_VERSION 'YES' end |
#framework_header_paths_for_iquote ⇒ Array<String>
The ‘framework_header_paths_for_iquote` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘framework_header_paths_for_iquote, memoized, sorted, uniqued`.
924 925 926 927 928 929 930 |
# File 'lib/cocoapods/target/build_settings.rb', line 924 define_build_settings_method :framework_header_paths_for_iquote, :memoized => true, :sorted => true, :uniqued => true do paths = pod_targets. select { |pt| pt.should_build? && pt.requires_frameworks? }. map { |pt| "#{pt.build_product_path}/Headers" } paths.concat target.search_paths_aggregate_targets.flat_map { |at| at.build_settings(configuration_name).framework_header_paths_for_iquote } paths 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, from_pod_targets_to_link, from_search_paths_aggregate_targets`.
880 881 882 |
# File 'lib/cocoapods/target/build_settings.rb', line 880 define_build_settings_method :framework_search_paths, :build_setting => true, :memoized => true, :sorted => true, :uniqued => true, :from_pod_targets_to_link => true, :from_search_paths_aggregate_targets => :framework_search_paths_to_import do [] 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, from_pod_targets_to_link, from_search_paths_aggregate_targets`.
870 871 872 |
# File 'lib/cocoapods/target/build_settings.rb', line 870 define_build_settings_method :frameworks, :memoized => true, :sorted => true, :uniqued => true, :from_pod_targets_to_link => true, :from_search_paths_aggregate_targets => :dynamic_frameworks_to_import do [] 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, uniqued`.
903 904 905 906 907 908 909 910 911 912 913 |
# File 'lib/cocoapods/target/build_settings.rb', line 903 define_build_settings_method :header_search_paths, :build_setting => true, :memoized => true, :sorted => true, :uniqued => true do paths = [] if !target.requires_frameworks? || !pod_targets.all?(&:should_build?) paths.concat target.sandbox.public_headers.search_paths(target.platform) end paths.concat target.search_paths_aggregate_targets.flat_map { |at| at.build_settings(configuration_name).header_search_paths } 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, uniqued`.
977 978 979 980 981 982 |
# File 'lib/cocoapods/target/build_settings.rb', line 977 define_build_settings_method :ld_runpath_search_paths, :build_setting => true, :memoized => true, :uniqued => true do return unless target.requires_frameworks? || any_vendored_dynamic_artifacts? symbol_type = target.user_targets.map(&:symbol_type).uniq.first test_bundle = symbol_type == :octest_bundle || symbol_type == :unit_test_bundle || symbol_type == :ui_test_bundle _ld_runpath_search_paths(:requires_host_target => target.requires_host_target?, :test_bundle => test_bundle) 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, from_pod_targets_to_link, from_search_paths_aggregate_targets`.
889 890 891 |
# File 'lib/cocoapods/target/build_settings.rb', line 889 define_build_settings_method :libraries, :memoized => true, :sorted => true, :uniqued => true, :from_pod_targets_to_link => true, :from_search_paths_aggregate_targets => :dynamic_libraries_to_import do [] 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, from_pod_targets_to_link, from_search_paths_aggregate_targets`.
894 895 896 |
# File 'lib/cocoapods/target/build_settings.rb', line 894 define_build_settings_method :library_search_paths, :build_setting => true, :memoized => true, :sorted => true, :uniqued => true, :from_pod_targets_to_link => true, :from_search_paths_aggregate_targets => :vendored_dynamic_library_search_paths do [] end |
#merged_user_target_xcconfigs ⇒ Hash{String, String}
Merges the user_target_xcconfig
for all pod targets into a single hash and warns on conflicting definitions.
The ‘merged_user_target_xcconfigs` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘merged_user_target_xcconfigs, memoized`.
1067 1068 1069 |
# File 'lib/cocoapods/target/build_settings.rb', line 1067 define_build_settings_method :merged_user_target_xcconfigs, :memoized => true do merged_xcconfigs(user_target_xcconfig_values_by_consumer_by_key, :user_target_xcconfig) 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, sorted, uniqued, compacted, from_search_paths_aggregate_targets`.
933 934 935 |
# File 'lib/cocoapods/target/build_settings.rb', line 933 define_build_settings_method :module_map_files, :memoized => true, :sorted => true, :uniqued => true, :compacted => true, :from_search_paths_aggregate_targets => :module_map_file_to_import do pod_targets.map { |t| t.build_settings.module_map_file_to_import } end |
#must_embed_swift? ⇒ Boolean
The ‘must_embed_swift?` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘must_embed_swift?, memoized`.
968 969 970 |
# File 'lib/cocoapods/target/build_settings.rb', line 968 define_build_settings_method :must_embed_swift?, :memoized => true do !target.requires_host_target? && pod_targets.any?(&:uses_swift?) end |
#other_cflags ⇒ Array<String>
The ‘other_cflags` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘other_cflags, build_setting, memoized`.
916 917 918 919 920 921 |
# File 'lib/cocoapods/target/build_settings.rb', line 916 define_build_settings_method :other_cflags, :build_setting => true, :memoized => true do flags = super() flags + header_search_paths.flat_map { |p| ['-isystem', p] } + framework_header_paths_for_iquote.flat_map { |p| ['-iquote', p] } end |
#other_swift_flags_without_swift? ⇒ Boolean
942 943 944 |
# File 'lib/cocoapods/target/build_settings.rb', line 942 def other_swift_flags_without_swift? module_map_files.any? end |
#pod_targets ⇒ Array<PodTarget>
Returns the PodTargets which are active for the current configuration name.
The ‘pod_targets` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘pod_targets, memoized`.
1025 1026 1027 |
# File 'lib/cocoapods/target/build_settings.rb', line 1025 define_build_settings_method :pod_targets, :memoized => true do target.pod_targets_for_build_configuration(configuration_name) end |
#pod_targets_to_link ⇒ Array<PodTarget>
The ‘pod_targets_to_link` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘pod_targets_to_link, memoized`.
1030 1031 1032 1033 |
# File 'lib/cocoapods/target/build_settings.rb', line 1030 define_build_settings_method :pod_targets_to_link, :memoized => true do pod_targets - target.search_paths_aggregate_targets.flat_map { |at| at.build_settings(configuration_name).pod_targets_to_link } end |
#pods_podfile_dir_path ⇒ String
The ‘pods_podfile_dir_path` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘pods_podfile_dir_path, build_setting, memoized`.
856 857 858 |
# File 'lib/cocoapods/target/build_settings.rb', line 856 define_build_settings_method :pods_podfile_dir_path, :build_setting => true, :memoized => true do target.podfile_dir_relative_path 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, memoized`.
861 862 863 |
# File 'lib/cocoapods/target/build_settings.rb', line 861 define_build_settings_method :pods_root, :build_setting => true, :memoized => true do target.relative_pods_root 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`.
1000 1001 1002 1003 |
# File 'lib/cocoapods/target/build_settings.rb', line 1000 define_build_settings_method :requires_fobjc_arc?, :memoized => true do target.podfile.set_arc_compatibility_flag? && target.spec_consumers.any?(&:requires_arc?) end |
#requires_objc_linker_flag? ⇒ Boolean
The ‘requires_objc_linker_flag?` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘requires_objc_linker_flag?, memoized`.
994 995 996 997 |
# File 'lib/cocoapods/target/build_settings.rb', line 994 define_build_settings_method :requires_objc_linker_flag?, :memoized => true do includes_static_libs = !target.requires_frameworks? includes_static_libs || pod_targets.flat_map(&:file_accessors).any? { |fa| !fa.vendored_static_artifacts.empty? } end |
#search_paths_aggregate_target_pod_target_build_settings ⇒ Array<PodTarget>
The ‘search_paths_aggregate_target_pod_target_build_settings` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘search_paths_aggregate_target_pod_target_build_settings, memoized, uniqued`.
1036 1037 1038 1039 1040 |
# File 'lib/cocoapods/target/build_settings.rb', line 1036 define_build_settings_method :search_paths_aggregate_target_pod_target_build_settings, :memoized => true, :uniqued => true do pod_targets = target.search_paths_aggregate_targets.flat_map { |at| at.build_settings(configuration_name).pod_targets } pod_targets = select_maximal_pod_targets(pod_targets) pod_targets.flat_map(&:build_settings) 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, from_pod_targets_to_link, from_search_paths_aggregate_targets`.
947 948 949 |
# File 'lib/cocoapods/target/build_settings.rb', line 947 define_build_settings_method :swift_include_paths, :build_setting => true, :memoized => true, :sorted => true, :uniqued => true, :from_pod_targets_to_link => true, :from_search_paths_aggregate_targets => :swift_include_paths_to_import do [] end |
#target_swift_version ⇒ Version
The ‘target_swift_version` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘target_swift_version, memoized, frozen`.
1011 1012 1013 1014 1015 |
# File 'lib/cocoapods/target/build_settings.rb', line 1011 define_build_settings_method :target_swift_version, :memoized => true, :frozen => false do swift_version = target.target_definition.swift_version swift_version = nil if swift_version.blank? Version.new(swift_version) end |
#user_target_xcconfig_values_by_consumer_by_key ⇒ Hash{String,Hash{Target,String}]
Returns the user_target_xcconfig
for all pod targets and their spec consumers grouped by keys
1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 |
# File 'lib/cocoapods/target/build_settings.rb', line 1047 def user_target_xcconfig_values_by_consumer_by_key pod_targets.each_with_object({}) do |target, hash| target.spec_consumers.each do |spec_consumer| spec_consumer.user_target_xcconfig.each do |k, v| # TODO: Need to decide how we are going to ensure settings like these # are always excluded from the user's project. # # See https://github.com/CocoaPods/CocoaPods/issues/1216 next if k == 'USE_HEADERMAP' (hash[k] ||= {})[spec_consumer] = v end end 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, sorted, uniqued, from_pod_targets_to_link, from_search_paths_aggregate_targets`.
875 876 877 |
# File 'lib/cocoapods/target/build_settings.rb', line 875 define_build_settings_method :weak_frameworks, :memoized => true, :sorted => true, :uniqued => true, :from_pod_targets_to_link => true, :from_search_paths_aggregate_targets => :weak_frameworks do [] end |
#xcconfig ⇒ Xcodeproj::Config
The ‘xcconfig` build setting for the Pod::Target::BuildSettings#target.
The return value from this method will be: ‘xcconfig, memoized`.
846 847 848 849 |
# File 'lib/cocoapods/target/build_settings.rb', line 846 define_build_settings_method :xcconfig, :memoized => true do xcconfig = super() xcconfig.merge(merged_user_target_xcconfigs) end |