class Xcodeproj::Project::Object::XCConfigurationList

The primary purpose of this class is to maintain a collection of related build configurations of a {PBXProject} or a {PBXNativeTarget}.

Public Instance Methods

[](name) click to toggle source

Returns the build configuration with the given name.

@param [String] name

The name of the build configuration.

@return [XCBuildConfiguration] The build configuration. @return [Nil] If not build configuration with the given name is found.

# File lib/xcodeproj/project/object/configuration_list.rb, line 41
def [](name)
  build_configurations.find { |bc| bc.name == name }
end
ascii_plist_annotation() click to toggle source
# File lib/xcodeproj/project/object/configuration_list.rb, line 107
def ascii_plist_annotation
  if target.nil?
    ' Build configuration list for <deleted target> '
  else
    " Build configuration list for #{target.isa} \"#{target}\" "
  end
end
build_settings(build_configuration_name) click to toggle source

Returns the build settings of the build configuration with the given name.

@param [String] build_configuration_name

The name of the build configuration.

@return [Hash {String=>String}] the build settings

# File lib/xcodeproj/project/object/configuration_list.rb, line 53
def build_settings(build_configuration_name)
  if config = self[build_configuration_name]
    config.build_settings
  end
end
get_setting(key, resolve_against_xcconfig = false, root_target = nil) click to toggle source

Gets the value for the given build setting in all the build configurations.

@param [String] key

the key of the build setting.

@param [Bool] resolve_against_xcconfig

wether the retrieved setting should take in consideration any
configuration file present.

@param [PBXNativeTarget] root_target

use this to resolve complete recursion between project and targets

@return [Hash{String => String}] The value of the build setting

grouped by the name of the build configuration.
# File lib/xcodeproj/project/object/configuration_list.rb, line 75
def get_setting(key, resolve_against_xcconfig = false, root_target = nil)
  result = {}
  build_configurations.each do |bc|
    result[bc.name] = resolve_against_xcconfig ? bc.resolve_build_setting(key, root_target) : bc.build_settings[key]
  end
  result
end
set_setting(key, value) click to toggle source

Sets the given value for the build setting associated with the given key across all the build configurations.

@param [String] key

the key of the build setting.

@param [String] value

the value for the build setting.

@return [void]

# File lib/xcodeproj/project/object/configuration_list.rb, line 94
def set_setting(key, value)
  build_configurations.each do |bc|
    bc.build_settings[key] = value
  end
end
target() click to toggle source
# File lib/xcodeproj/project/object/configuration_list.rb, line 100
def target
  return project.root_object if project.build_configuration_list.uuid == uuid
  project.targets.find { |t| t.build_configuration_list.uuid == uuid }
end