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

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

Instance Method Details

#leave_configuration(configuration) ⇒ Object



49
50
# File 'lib/xcake/generator/default_project_structure_generator.rb', line 49

def leave_configuration(configuration)
end

#leave_project(project) ⇒ Object



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

def leave_project(project)
end

#leave_target(target) ⇒ Object



43
44
# File 'lib/xcake/generator/default_project_structure_generator.rb', line 43

def leave_target(target)
end

#visit_configuration(configuration) ⇒ Object



46
47
# File 'lib/xcake/generator/default_project_structure_generator.rb', line 46

def visit_configuration(configuration)
end

#visit_project(project) ⇒ Object



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

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

#visit_target(target) ⇒ 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/default_project_structure_generator.rb', line 20

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