Class: Xcodeproj::Project::Object::XCBuildConfiguration

Inherits:
AbstractObject
  • Object
show all
Defined in:
lib/xcodeproj/project/object/build_configuration.rb

Overview

Encapsulates the information a specific build configuration referenced by a XCConfigurationList which in turn might be referenced by a PBXProject or a PBXNativeTarget.

Attributes collapse

Attributes inherited from AbstractObject

#isa, #project, #uuid

AbstractObject Hooks collapse

Methods inherited from AbstractObject

#<=>, #==, #display_name, #inspect, isa, #remove_from_project, #sort_recursively, #to_hash

Instance Attribute Details

#base_configuration_referencePBXFileReference

Returns an optional file reference to a configuration file (‘.xcconfig`).

Returns:

  • (PBXFileReference)

    an optional file reference to a configuration file (‘.xcconfig`).



22
# File 'lib/xcodeproj/project/object/build_configuration.rb', line 22

has_one :base_configuration_reference, PBXFileReference

#build_settingsHash

Returns the build settings to use for building the target.

Returns:

  • (Hash)

    the build settings to use for building the target.



17
# File 'lib/xcodeproj/project/object/build_configuration.rb', line 17

attribute :build_settings, Hash, {}

#nameString

Returns the name of the Target.

Returns:

  • (String)

    the name of the Target.



13
# File 'lib/xcodeproj/project/object/build_configuration.rb', line 13

attribute :name, String

Instance Method Details

#pretty_printHash{String => Hash}

Returns A hash suitable to display the object to the user.

Returns:

  • (Hash{String => Hash})

    A hash suitable to display the object to the user.



32
33
34
35
36
37
38
39
# File 'lib/xcodeproj/project/object/build_configuration.rb', line 32

def pretty_print
  data = {}
  data['Build Settings'] = sorted_build_settings
  if base_configuration_reference
    data['Base Configuration'] = base_configuration_reference.pretty_print
  end
  { name => data }
end

#sort(_options = nil) ⇒ void

This method returns an undefined value.

Sorts the build settings. Valid only in Ruby > 1.9.2 because in previous versions the hash are not sorted.



46
47
48
# File 'lib/xcodeproj/project/object/build_configuration.rb', line 46

def sort(_options = nil)
  self.build_settings = sorted_build_settings
end