Sha256: bc8e8ad753b1f3509439a05759be6dc2467a304431c5f87a83336509c81ebdc9

Contents?: true

Size: 1.24 KB

Versions: 7

Compression:

Stored size: 1.24 KB

Contents

module Xcake
  class Configuration
    # @return [Hash<Symbol, String>] the constants for the
    #                                supported_devices setting
    #
    SUPPORTED_DEVICES = {
      iphone_only: '1',
      ipad_only: '2',
      universal: '1,2'
    }.freeze

    # Convienence method to easily set the
    # supported devices for a application.
    #
    # Use this when you want to make a
    # Non-Univeral iOS application.
    #
    # @example Using Supported Devices
    #
    #          Target.new(project) do |t|
    #             t.all_configurations.each do |c|
    #                c.supported_devices = :ipad_only
    #             end
    #          end
    #
    def supported_devices=(devices)
      supported_devices = SUPPORTED_DEVICES[devices]
      settings['TARGETED_DEVICE_FAMILY'] = supported_devices
    end

    # Convienience method to easily set the
    # product's bundle identifier
    #
    def product_bundle_identifier=(identifier)
      settings['PRODUCT_BUNDLE_IDENTIFIER'] = identifier
    end

    # Convienence method to easily set preprocessor directives
    #
    def preprocessor_definitions
      PreprocessorDefinitionsSettingProxy.new(
        settings,
        'GCC_PREPROCESSOR_DEFINITIONS'
      )
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
xcake-0.13.0 lib/xcake/dsl/configuration/sugar.rb
xcake-0.12.1 lib/xcake/dsl/configuration/sugar.rb
xcake-0.12.0 lib/xcake/dsl/configuration/sugar.rb
xcake-0.11.0 lib/xcake/dsl/configuration/sugar.rb
xcake-0.10.0 lib/xcake/dsl/configuration/sugar.rb
xcake-0.9.4 lib/xcake/dsl/configuration/sugar.rb
xcake-0.9.3 lib/xcake/dsl/configuration/sugar.rb