class Pod::Target::BuildSettings::PodTargetSettings

A subclass that generates build settings for a {PodTarget}

Attributes

app_xcconfig[R]

@return [Boolean]

whether settings are being generated for an application bundle
app_xcconfig?[R]

@return [Boolean]

whether settings are being generated for an application bundle
library_xcconfig[R]

@return [Boolean]

whether settings are being generated for an library bundle
library_xcconfig?[R]

@return [Boolean]

whether settings are being generated for an library bundle
non_library_spec[R]

@return [Specification]

The non-library specification these build settings are for or `nil`.
test_xcconfig[R]

@return [Boolean]

whether settings are being generated for a test bundle
test_xcconfig?[R]

@return [Boolean]

whether settings are being generated for a test bundle

Public Class Methods

build_settings_names() click to toggle source

@see BuildSettings.build_settings_names

# File lib/cocoapods/target/build_settings.rb, line 528
def self.build_settings_names
  @build_settings_names | BuildSettings.build_settings_names
end
new(target, non_library_spec = nil, configuration: nil) click to toggle source

Initializes a new instance

@param [PodTarget] target

see {#target}

@param [Specification] non_library_spec

see {#non_library_spec}

@param [Symbol] configuration

see {#configuration}
Calls superclass method Pod::Target::BuildSettings::new
# File lib/cocoapods/target/build_settings.rb, line 570
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

Public Instance Methods

linker_names_from_libraries(libraries) click to toggle source

Converts array of library path references to just the names to use link each library, e.g. from ‘/path/to/libSomething.a’ to ‘Something’

@param [Array<String>] libraries

@return [Array<String>]

# File lib/cocoapods/target/build_settings.rb, line 767
def linker_names_from_libraries(libraries)
  libraries.map { |l| File.basename(l, File.extname(l)).sub(/\Alib/, '') }
end
non_library_xcconfig?() click to toggle source
# File lib/cocoapods/target/build_settings.rb, line 550
def non_library_xcconfig?
  !library_xcconfig?
end
other_swift_flags_without_swift?() click to toggle source

@see BuildSettings#other_swift_flags_without_swift?

# File lib/cocoapods/target/build_settings.rb, line 924
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() click to toggle source

Returns the pod_target_xcconfig for the pod target and its spec consumers grouped by keys

@return [Hash{String,Hash{Target,String}]

# File lib/cocoapods/target/build_settings.rb, line 1048
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
requires_objc_linker_flag?() click to toggle source

@return [Boolean] whether the ‘-ObjC` linker flag is required.

@note this is only true when generating build settings for a test bundle

# File lib/cocoapods/target/build_settings.rb, line 967
def requires_objc_linker_flag?
  test_xcconfig? || app_xcconfig?
end