Module: Xcode::ConfigurationList
- Defined in:
- lib/xcode/configuration_list.rb
Class Method Summary collapse
- .configuration_list ⇒ Object
-
.symbol_config_name_to_config_name ⇒ Hash
A hash of symbol names to configuration names.
Instance Method Summary collapse
-
#create_config(name) {|new_config| ... } ⇒ Object
Create a configuration for this ConfigurationList.
-
#default_config ⇒ BuildConfiguration
The build configuration that is set to default; nil if no configuration has been set as default.
-
#default_config_name ⇒ String
The name of the default build configuration; nil if no configuration has been set as default.
- #set_default_config(name) ⇒ Object
Class Method Details
.configuration_list ⇒ Object
16 17 18 19 20 21 |
# File 'lib/xcode/configuration_list.rb', line 16 def self.configuration_list { 'isa' => 'XCConfigurationList', 'buildConfigurations' => [], 'defaultConfigurationIsVisible' => '0', 'defaultConfigurationName' => '' } end |
.symbol_config_name_to_config_name ⇒ Hash
Returns a hash of symbol names to configuration names.
26 27 28 |
# File 'lib/xcode/configuration_list.rb', line 26 def self.symbol_config_name_to_config_name { :debug => 'Debug', :release => 'Release' } end |
Instance Method Details
#create_config(name) {|new_config| ... } ⇒ Object
unique names are currently not enforced but likely necessary for the the target to be build successfully.
Create a configuration for this ConfigurationList. This configuration needs to have a name.
39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/xcode/configuration_list.rb', line 39 def create_config(name) name = ConfigurationList.symbol_config_name_to_config_name[name] if ConfigurationList.symbol_config_name_to_config_name[name] # @todo a configuration has additional fields that are ususally set with # some target information for the title. new_config = @registry.add_object(Configuration.default_properties(name)) @properties['buildConfigurations'] << new_config.identifier yield new_config if block_given? new_config.save! end |
#default_config ⇒ BuildConfiguration
Returns the build configuration that is set to default; nil if no configuration has been set as default.
58 59 60 |
# File 'lib/xcode/configuration_list.rb', line 58 def default_config build_configurations.find {|config| config.name == default_configuration_name } end |
#default_config_name ⇒ String
Returns the name of the default build configuration; nil if no configuration has been set as default.
66 67 68 |
# File 'lib/xcode/configuration_list.rb', line 66 def default_config_name default_configuration_name end |
#set_default_config(name) ⇒ Object
allow the ability for a configuration to set itself as default and/or let a configuration be specified as a parameter here. Though we need to check to see that the configuration is part of the this configuration list.
79 80 81 82 |
# File 'lib/xcode/configuration_list.rb', line 79 def set_default_config(name) # @todo ensure that the name specified is one of the available configurations @properties['defaultConfigurationName'] = name end |