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.
-
#ascii_plist_annotation ⇒ Object
———————————————————————#.
-
#build_settings(build_configuration_name) ⇒ Hash {String=>String}
Returns the build settings of the build configuration with the given name.
-
#get_setting(key, resolve_against_xcconfig = false, root_target = nil) ⇒ 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.
- #target ⇒ Object
Methods inherited from AbstractObject
#<=>, #==, #display_name, #inspect, isa, #nested_object_for_hash, #pretty_print, #remove_from_project, #sort, #sort_recursively, #to_ascii_plist, #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 |
#ascii_plist_annotation ⇒ Object
———————————————————————#
107 108 109 110 111 112 113 |
# 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_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, resolve_against_xcconfig = false, root_target = nil) ⇒ Hash{String => String}
Gets the value for the given build setting in all the build configurations.
75 76 77 78 79 80 81 |
# 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) ⇒ 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.
94 95 96 97 98 |
# 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 ⇒ Object
100 101 102 103 |
# 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 |