Class: Xcake::DefaultProjectStructureGenerator

Inherits:
Generator show all
Defined in:
lib/xcake/generator/default_project_structure_generator.rb

Overview

This class handles generating the default structure of a project. Making sure that the structure of the project is one Xcode can open and makes sense.

It will create default configurations or schemes if none are provided and will make sure both the project and targets have all of the same 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 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



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

def self.dependencies
  [ProjectMetadataGenerator, TargetGenerator]
end

Instance Method Details

#leave_configuration(configuration) ⇒ Object



58
59
# File 'lib/xcake/generator/default_project_structure_generator.rb', line 58

def leave_configuration(configuration)
end

#leave_project(project) ⇒ Object



26
27
# File 'lib/xcake/generator/default_project_structure_generator.rb', line 26

def leave_project(project)
end

#leave_target(target) ⇒ Object



52
53
# File 'lib/xcake/generator/default_project_structure_generator.rb', line 52

def leave_target(target)
end

#visit_configuration(configuration) ⇒ Object



55
56
# File 'lib/xcake/generator/default_project_structure_generator.rb', line 55

def visit_configuration(configuration)
end

#visit_project(project) ⇒ Object



16
17
18
19
20
21
22
23
24
# File 'lib/xcake/generator/default_project_structure_generator.rb', line 16

def visit_project(project)
  EventHooks.run_hook :before_resolving_project_structure, project
  @project = project

  # Make sure we always have a Release and Debug configuration as Xcode expects these
  # and these fixes bugs that can happen.
  @project.debug_configuration
  @project.release_configuration
end

#visit_target(target) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/xcake/generator/default_project_structure_generator.rb', line 29

def visit_target(target)
  EventHooks.run_hook :before_resolving_target_structure, target

  @project.all_configurations.each do |c|
    target.configuration(c.name, c.type)
  end

  native_target = @context.native_object_for(target)

  return if native_target.test_target_type?
  return unless target.schemes.empty?

  target.all_configurations.each do |c|
    target.scheme "#{target.name}-#{c.name}" do |s|
        s.test_configuration = c.name
        s.launch_configuration = c.name
        s.profile_configuration = c.name
        s.analyze_configuration = c.name
        s.archive_configuration = c.name
    end
  end
end