Class: Xcake::DefaultProjectStructureGenerator

Inherits:
Generator
  • Object
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 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



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

def self.dependencies
  [ProjectMetadataGenerator, TargetGenerator]
end

Instance Method Details

#leave_configuration(configuration) ⇒ Object



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

def leave_configuration(configuration)
end

#leave_project(project) ⇒ Object



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

def leave_project(project)
end

#leave_target(target) ⇒ Object



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

def leave_target(target)
end

#visit_configuration(configuration) ⇒ Object



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

def visit_configuration(configuration)
end

#visit_project(project) ⇒ Object



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

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



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

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