Class: Xcake::Configuration
- Inherits:
-
Object
- Object
- Xcake::Configuration
- Includes:
- Visitable
- Defined in:
- lib/xcake/dsl/configuration.rb,
lib/xcake/dsl/configuration/sugar.rb,
lib/xcake/dsl/configuration/proxies/preproccessor_definitions_setting_proxy.rb
Overview
This class represents a Build Configuration in a xcode project.
This forms part of the DSL and is usally
stored in files named Cakefile
.
Defined Under Namespace
Classes: PreprocessorDefinitionsSettingProxy
Constant Summary collapse
- SUPPORTED_DEVICES =
Returns the constants for the supported_devices setting.
{ iphone_only: '1', ipad_only: '2', universal: '1,2' }.freeze
Instance Attribute Summary collapse
-
#configuration_file ⇒ String
The path of the xcconfig file to use for the build configuration.
-
#name ⇒ String
The name of the configuration.
-
#settings ⇒ Hash<String, String>
the settings for the configuration this is what is used for the build settings for the build configuration.
-
#type ⇒ Symbol
The type of the configuration, either :debug or :release.
Instance Method Summary collapse
-
#initialize(name) {|_self| ... } ⇒ Configuration
constructor
A new instance of Configuration.
-
#preprocessor_definitions ⇒ Object
Convienence method to easily set preprocessor directives.
-
#product_bundle_identifier=(identifier) ⇒ Object
Convienience method to easily set the product's bundle identifier.
-
#supported_devices=(devices) ⇒ Object
Convienence method to easily set the supported devices for a application.
Methods included from Visitable
Constructor Details
#initialize(name) {|_self| ... } ⇒ Configuration
Returns a new instance of Configuration.
48 49 50 51 52 53 |
# File 'lib/xcake/dsl/configuration.rb', line 48 def initialize(name) self.name = name.to_s self.settings = {} yield(self) if block_given? end |
Instance Attribute Details
#configuration_file ⇒ String
Returns the path of the xcconfig file to use for the build configuration.
This is resolved to a PBXFileReference.
32 33 34 |
# File 'lib/xcake/dsl/configuration.rb', line 32 def configuration_file @configuration_file end |
#name ⇒ String
Returns the name of the configuration.
13 14 15 |
# File 'lib/xcake/dsl/configuration.rb', line 13 def name @name end |
#settings ⇒ Hash<String, String>
the settings for the configuration this is what is used for the build settings for the build configuration.
25 26 27 |
# File 'lib/xcake/dsl/configuration.rb', line 25 def settings @settings end |
#type ⇒ Symbol
Returns the type of the configuration, either :debug or :release.
17 18 19 |
# File 'lib/xcake/dsl/configuration.rb', line 17 def type @type end |
Instance Method Details
#preprocessor_definitions ⇒ Object
Convienence method to easily set preprocessor directives
40 41 42 43 44 45 |
# File 'lib/xcake/dsl/configuration/sugar.rb', line 40 def preprocessor_definitions PreprocessorDefinitionsSettingProxy.new( settings, 'GCC_PREPROCESSOR_DEFINITIONS' ) end |
#product_bundle_identifier=(identifier) ⇒ Object
Convienience method to easily set the product's bundle identifier
34 35 36 |
# File 'lib/xcake/dsl/configuration/sugar.rb', line 34 def product_bundle_identifier=(identifier) settings['PRODUCT_BUNDLE_IDENTIFIER'] = identifier end |
#supported_devices=(devices) ⇒ Object
Convienence method to easily set the supported devices for a application.
Use this when you want to make a Non-Univeral iOS application.
26 27 28 29 |
# File 'lib/xcake/dsl/configuration/sugar.rb', line 26 def supported_devices=(devices) supported_devices = SUPPORTED_DEVICES[devices] settings['TARGETED_DEVICE_FAMILY'] = supported_devices end |