Class: Xcodeproj::Project::Object::XCConfigurationList
- Inherits:
-
AbstractObject
- Object
- AbstractObject
- Xcodeproj::Project::Object::XCConfigurationList
- Defined in:
- lib/xcodeproj/project/object/configuration_list.rb
Overview
The primary purpose of this class is to maintain a collection of related build configurations of a PBXProject or a PBXNativeTarget.
Attributes collapse
-
#default_configuration_is_visible ⇒ String
Whether the default configuration is visible.
-
#default_configuration_name ⇒ String
The name of the default configuration.
Attributes inherited from AbstractObject
Attributes collapse
-
#build_configurations ⇒ ObjectList<XCBuildConfiguration>
The build configurations of the target.
Helpers collapse
-
#[](name) ⇒ XCBuildConfiguration, Nil
Returns the build configuration with the given name.
-
#build_settings(build_configuration_name) ⇒ Hash {String=>String}
Returns the build settings of the build configuration with the given name.
-
#get_setting(key) ⇒ Hash{String => String}
Gets the value for the given build setting in all the build configurations.
-
#set_setting(key, value) ⇒ void
Sets the given value for the build setting associated with the given key across all the build configurations.
Methods inherited from AbstractObject
#<=>, #==, #display_name, #inspect, isa, #pretty_print, #remove_from_project, #sort, #sort_recursively, #to_hash
Instance Attribute Details
#default_configuration_is_visible ⇒ String
Returns whether the default configuration is visible. Usually ‘0`. The purpose of this flag and how Xcode displays it in the UI is unknown.
14 |
# File 'lib/xcodeproj/project/object/configuration_list.rb', line 14 attribute :default_configuration_is_visible, String, '0' |
#default_configuration_name ⇒ String
Returns the name of the default configuration. Usually ‘Release`. Xcode exposes this attribute as the configuration for the command line tools and only allows to set it at the project level.
21 |
# File 'lib/xcodeproj/project/object/configuration_list.rb', line 21 attribute :default_configuration_name, String, 'Release' |
Instance Method Details
#[](name) ⇒ XCBuildConfiguration, Nil
Returns the build configuration with the given name.
41 42 43 |
# File 'lib/xcodeproj/project/object/configuration_list.rb', line 41 def [](name) build_configurations.find { |bc| bc.name == name } end |
#build_configurations ⇒ ObjectList<XCBuildConfiguration>
Returns the build configurations of the target.
26 |
# File 'lib/xcodeproj/project/object/configuration_list.rb', line 26 has_many :build_configurations, XCBuildConfiguration |
#build_settings(build_configuration_name) ⇒ Hash {String=>String}
Returns the build settings of the build configuration with the given name.
53 54 55 56 57 |
# 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) ⇒ Hash{String => String}
Gets the value for the given build setting in all the build configurations.
68 69 70 71 72 73 74 |
# File 'lib/xcodeproj/project/object/configuration_list.rb', line 68 def get_setting(key) result = {} build_configurations.each do |bc| result[bc.name] = bc.build_settings[key] end result end |
#set_setting(key, value) ⇒ void
This method returns an undefined value.
Sets the given value for the build setting associated with the given key across all the build configurations.
87 88 89 90 91 |
# File 'lib/xcodeproj/project/object/configuration_list.rb', line 87 def set_setting(key, value) build_configurations.each do |bc| bc.build_settings[key] = value end end |