Class: Pod::Target::BuildSettings
- Inherits:
-
Object
- Object
- Pod::Target::BuildSettings
- Defined in:
- lib/cocoapods/target/build_settings.rb
Overview
Direct Known Subclasses
Defined Under Namespace
Classes: AggregateTargetSettings, PodTargetSettings
Constants collapse
- PLURAL_SETTINGS =
Returns The build settings that should be treated as arrays, rather than strings.
%w( ALTERNATE_PERMISSIONS_FILES ARCHS BUILD_VARIANTS EXCLUDED_SOURCE_FILE_NAMES FRAMEWORK_SEARCH_PATHS GCC_PREPROCESSOR_DEFINITIONS GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS HEADER_SEARCH_PATHS INFOPLIST_PREPROCESSOR_DEFINITIONS LD_RUNPATH_SEARCH_PATHS LIBRARY_SEARCH_PATHS OTHER_CFLAGS OTHER_CPLUSPLUSFLAGS OTHER_LDFLAGS OTHER_SWIFT_FLAGS REZ_SEARCH_PATHS SECTORDER_FLAGS SWIFT_ACTIVE_COMPILATION_CONDITIONS SWIFT_INCLUDE_PATHS WARNING_CFLAGS WARNING_LDFLAGS ).to_set.freeze
- CONFIGURATION_BUILD_DIR_VARIABLE =
Returns The variable for the configuration build directory used when building pod targets.
'${PODS_CONFIGURATION_BUILD_DIR}'.freeze
Public API collapse
-
.build_settings_names ⇒ Set<String>
readonly
be present in the #xcconfig.
-
#target ⇒ Target
readonly
The target this build settings object is generating build settings for.
Public API collapse
-
#initialize(target) ⇒ BuildSettings
constructor
Initialize a new instance.
- #initialize_copy(other) ⇒ Object
-
#save_as(path) ⇒ Xcodeproj::Config
Saves the generated xcconfig to the given path.
-
#xcconfig ⇒ Xcodeproj::Config
(also: #generate)
The ‘xcconfig` build setting for the #target.
Paths collapse
-
#pods_build_dir ⇒ String
The ‘pods_build_dir` build setting for the #target.
-
#pods_configuration_build_dir ⇒ String
The ‘pods_configuration_build_dir` build setting for the #target.
Code Signing collapse
-
#code_sign_identity ⇒ String
The ‘code_sign_identity` build setting for the #target.
Frameworks collapse
-
#framework_search_paths ⇒ Array<String>
The ‘framework_search_paths` build setting for the #target.
-
#framework_search_paths_to_import_developer_frameworks(frameworks) ⇒ Array<String>
The ‘FRAMEWORK_SEARCH_PATHS` needed to import developer frameworks.
-
#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.
Clang collapse
-
#gcc_preprocessor_definitions ⇒ Array<String>
The ‘gcc_preprocessor_definitions` 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
-
#other_swift_flags ⇒ Array<String>
The ‘other_swift_flags` build setting for the #target.
-
#other_swift_flags_without_swift? ⇒ Boolean
Whether ‘OTHER_SWIFT_FLAGS` should be generated when the target does not use swift.
Linking collapse
-
#other_ldflags ⇒ Array<String>
The ‘other_ldflags` 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.
Constructor Details
#initialize(target) ⇒ BuildSettings
Initialize a new instance
157 158 159 160 |
# File 'lib/cocoapods/target/build_settings.rb', line 157 def initialize(target) @target = target @__memoized = {} end |
Class Attribute Details
.build_settings_names ⇒ Set<String> (readonly)
be present in the #xcconfig
140 141 142 |
# File 'lib/cocoapods/target/build_settings.rb', line 140 def build_settings_names @build_settings_names end |
Instance Attribute Details
#target ⇒ Target (readonly)
Returns The target this build settings object is generating build settings for.
150 151 152 |
# File 'lib/cocoapods/target/build_settings.rb', line 150 def target @target end |
Instance Method Details
#code_sign_identity ⇒ String
The ‘code_sign_identity` build setting for the #target.
The return value from this method will be: ‘code_sign_identity, build_setting`.
207 208 209 210 211 |
# File 'lib/cocoapods/target/build_settings.rb', line 207 define_build_settings_method :code_sign_identity, :build_setting => true do return unless target.requires_frameworks? return unless target.platform.to_sym == :osx '' end |
#framework_search_paths ⇒ Array<String>
The ‘framework_search_paths` build setting for the #target.
The return value from this method will be: ‘framework_search_paths, build_setting, memoized`.
228 229 230 |
# File 'lib/cocoapods/target/build_settings.rb', line 228 define_build_settings_method :framework_search_paths, :build_setting => true, :memoized => true do framework_search_paths_to_import_developer_frameworks(frameworks) end |
#framework_search_paths_to_import_developer_frameworks(frameworks) ⇒ Array<String>
Returns the ‘FRAMEWORK_SEARCH_PATHS` needed to import developer frameworks.
237 238 239 240 241 242 243 |
# File 'lib/cocoapods/target/build_settings.rb', line 237 def framework_search_paths_to_import_developer_frameworks(frameworks) if frameworks.include?('XCTest') || frameworks.include?('SenTestingKit') %w[ $(PLATFORM_DIR)/Developer/Library/Frameworks ] else [] end end |
#frameworks ⇒ Array<String>
The ‘frameworks` build setting for the #target.
The return value from this method will be: ‘frameworks`.
218 219 220 |
# File 'lib/cocoapods/target/build_settings.rb', line 218 define_build_settings_method :frameworks do [] end |
#gcc_preprocessor_definitions ⇒ Array<String>
The ‘gcc_preprocessor_definitions` build setting for the #target.
The return value from this method will be: ‘gcc_preprocessor_definitions, build_setting`.
259 260 261 |
# File 'lib/cocoapods/target/build_settings.rb', line 259 define_build_settings_method :gcc_preprocessor_definitions, :build_setting => true do %w( COCOAPODS=1 ) end |
#initialize_copy(other) ⇒ Object
162 163 164 165 |
# File 'lib/cocoapods/target/build_settings.rb', line 162 def initialize_copy(other) super @__memoized = {} end |
#libraries ⇒ Array<String>
The ‘libraries` build setting for the #target.
The return value from this method will be: ‘libraries`.
250 251 252 |
# File 'lib/cocoapods/target/build_settings.rb', line 250 define_build_settings_method :libraries do [] end |
#module_map_files ⇒ Array<String>
The ‘module_map_files` build setting for the #target.
The return value from this method will be: ‘module_map_files`.
269 270 271 |
# File 'lib/cocoapods/target/build_settings.rb', line 269 define_build_settings_method :module_map_files do [] end |
#other_cflags ⇒ Array<String>
The ‘other_cflags` build setting for the #target.
The return value from this method will be: ‘other_cflags, build_setting, memoized`.
264 265 266 |
# File 'lib/cocoapods/target/build_settings.rb', line 264 define_build_settings_method :other_cflags, :build_setting => true, :memoized => true do module_map_files.map { |f| "-fmodule-map-file=#{f}" } end |
#other_ldflags ⇒ Array<String>
The ‘other_ldflags` build setting for the #target.
The return value from this method will be: ‘other_ldflags, build_setting, memoized`.
330 331 332 333 334 335 336 337 338 339 340 |
# File 'lib/cocoapods/target/build_settings.rb', line 330 define_build_settings_method :other_ldflags, :build_setting => true, :memoized => true do ld_flags = [] ld_flags << '-ObjC' if requires_objc_linker_flag? if requires_fobjc_arc? ld_flags << '-fobjc-arc' end libraries.each { |l| ld_flags << %(-l"#{l}") } frameworks.each { |f| ld_flags << '-framework' << %("#{f}") } weak_frameworks.each { |f| ld_flags << '-weak_framework' << %("#{f}") } ld_flags end |
#other_swift_flags ⇒ Array<String>
The ‘other_swift_flags` build setting for the #target.
The return value from this method will be: ‘other_swift_flags, build_setting, memoized`.
286 287 288 289 290 291 |
# File 'lib/cocoapods/target/build_settings.rb', line 286 define_build_settings_method :other_swift_flags, :build_setting => true, :memoized => true do return unless target.uses_swift? || other_swift_flags_without_swift? flags = %w(-D COCOAPODS) flags.concat module_map_files.flat_map { |f| ['-Xcc', "-fmodule-map-file=#{f}"] } flags end |
#other_swift_flags_without_swift? ⇒ Boolean
Returns Whether ‘OTHER_SWIFT_FLAGS` should be generated when the target does not use swift.
281 282 283 |
# File 'lib/cocoapods/target/build_settings.rb', line 281 def other_swift_flags_without_swift? false end |
#pods_build_dir ⇒ String
The ‘pods_build_dir` build setting for the #target.
The return value from this method will be: ‘pods_build_dir, build_setting`.
193 194 195 |
# File 'lib/cocoapods/target/build_settings.rb', line 193 define_build_settings_method :pods_build_dir, :build_setting => true do '${BUILD_DIR}' end |
#pods_configuration_build_dir ⇒ String
The ‘pods_configuration_build_dir` build setting for the #target.
The return value from this method will be: ‘pods_configuration_build_dir, build_setting`.
198 199 200 |
# File 'lib/cocoapods/target/build_settings.rb', line 198 define_build_settings_method :pods_configuration_build_dir, :build_setting => true do '${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)' end |
#requires_fobjc_arc? ⇒ Boolean
The ‘requires_fobjc_arc?` build setting for the #target.
The return value from this method will be: ‘requires_fobjc_arc?`.
303 304 305 |
# File 'lib/cocoapods/target/build_settings.rb', line 303 define_build_settings_method :requires_fobjc_arc? do false end |
#requires_objc_linker_flag? ⇒ Boolean
The ‘requires_objc_linker_flag?` build setting for the #target.
The return value from this method will be: ‘requires_objc_linker_flag?`.
298 299 300 |
# File 'lib/cocoapods/target/build_settings.rb', line 298 define_build_settings_method :requires_objc_linker_flag? do false end |
#save_as(path) ⇒ Xcodeproj::Config
Saves the generated xcconfig to the given path
184 185 186 |
# File 'lib/cocoapods/target/build_settings.rb', line 184 def save_as(path) xcconfig.save_as(path) end |
#weak_frameworks ⇒ Array<String>
The ‘weak_frameworks` build setting for the #target.
The return value from this method will be: ‘weak_frameworks`.
223 224 225 |
# File 'lib/cocoapods/target/build_settings.rb', line 223 define_build_settings_method :weak_frameworks do [] end |
#xcconfig ⇒ Xcodeproj::Config Also known as: generate
The ‘xcconfig` build setting for the #target.
The return value from this method will be: ‘xcconfig, memoized`.
168 169 170 171 |
# File 'lib/cocoapods/target/build_settings.rb', line 168 define_build_settings_method :xcconfig, :memoized => true do settings = add_inherited_to_plural(to_h) Xcodeproj::Config.new(settings) end |