Class: Xcake::Configuration
- Includes:
- Visitable
- Defined in:
- lib/xcake/configuration.rb,
lib/xcake/configuration/sugar.rb,
lib/xcake/configuration/proxies/preproccessor_definitions_setting_proxy.rb
Overview
This class repesents configurations in a xcode project. This is an abstraction of Schemes and Build Configurations.
This forms part of the DSL and is usally
stored in files named Cakefile.
It holds the build settings and defines how many schemes are created for each target.
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.
53 54 55 56 57 58 |
# File 'lib/xcake/configuration.rb', line 53 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.
37 38 39 |
# File 'lib/xcake/configuration.rb', line 37 def configuration_file @configuration_file end |
#name ⇒ String
Returns the name of the configuration.
18 19 20 |
# File 'lib/xcake/configuration.rb', line 18 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.
30 31 32 |
# File 'lib/xcake/configuration.rb', line 30 def settings @settings end |
#type ⇒ Symbol
Returns the type of the configuration, either :debug or :release.
22 23 24 |
# File 'lib/xcake/configuration.rb', line 22 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/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/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/configuration/sugar.rb', line 26 def supported_devices=(devices) supported_devices = SUPPORTED_DEVICES[devices] settings['TARGETED_DEVICE_FAMILY'] = supported_devices end |