Class: Xcake::ConfigurationGenerator

Inherits:
Generator
  • Object
show all
Defined in:
lib/xcake/generator/configuration_generator.rb

Overview

This generator processes the configurations and creates xcode build configurations.

Instance Attribute Summary

Attributes inherited from Generator

#context

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Generator

#initialize, plugins_location

Methods included from Xcake::CoreExtensions::ClassDescendants

#descendants

Methods included from Visitor

#item_name, #leave, #visit

Methods included from Plugin

included

Methods included from Dependency

included

Constructor Details

This class inherits a constructor from Xcake::Generator

Class Method Details

.dependenciesObject



8
9
10
# File 'lib/xcake/generator/configuration_generator.rb', line 8

def self.dependencies
  [TargetGenerator, DefaultProjectStructureGenerator]
end

Instance Method Details

#create_build_configurations_for(configuration_object) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/xcake/generator/configuration_generator.rb', line 20

def create_build_configurations_for(configuration_object)
  EventHooks.run_hook :before_creating_build_configurations, configuration_object

  configuration_object.all_configurations.each do |configuration|
    EventHooks.run_hook :before_creating_build_configuration, configuration, configuration_object

    build_configuration = @context.native_object_for(configuration)
    build_configuration.name = configuration.name
    build_configuration.build_settings = configuration.settings

    unless configuration.configuration_file.nil?
      EventHooks.run_hook :before_attaching_xcconfig, configuration
      configuration_file = configuration.configuration_file
      file_reference = @context.file_reference_for_path(configuration_file)
    end

    build_configuration.base_configuration_reference = file_reference

    native_configuration_object = @context.native_object_for(configuration_object)
    native_configuration_object.build_configurations << build_configuration
  end
end

#visit_project(project) ⇒ Object



12
13
14
# File 'lib/xcake/generator/configuration_generator.rb', line 12

def visit_project(project)
  create_build_configurations_for(project)
end

#visit_target(target) ⇒ Object



16
17
18
# File 'lib/xcake/generator/configuration_generator.rb', line 16

def visit_target(target)
  create_build_configurations_for(target)
end