Sha256: fc87e48c604e487048891d329980dae5841d516f00b4b803fd1c4b38d8eafabd

Contents?: true

Size: 1.68 KB

Versions: 10

Compression:

Stored size: 1.68 KB

Contents

module Xcake
  # 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.
  #
  class DefaultProjectStructureGenerator < Generator
    def self.dependencies
      [ProjectMetadataGenerator, TargetGenerator]
    end

    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

    def leave_project(project)
    end

    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

    def leave_target(target)
    end

    def visit_configuration(configuration)
    end

    def leave_configuration(configuration)
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
xcake-0.13.0 lib/xcake/generator/default_project_structure_generator.rb
xcake-0.12.1 lib/xcake/generator/default_project_structure_generator.rb
xcake-0.12.0 lib/xcake/generator/default_project_structure_generator.rb
xcake-0.11.0 lib/xcake/generator/default_project_structure_generator.rb
xcake-0.10.0 lib/xcake/generator/default_project_structure_generator.rb
xcake-0.9.4 lib/xcake/generator/default_project_structure_generator.rb
xcake-0.9.3 lib/xcake/generator/default_project_structure_generator.rb
xcake-0.9.2 lib/xcake/generator/default_project_structure_generator.rb
xcake-0.9.1 lib/xcake/generator/default_project_structure_generator.rb
xcake-0.9.0 lib/xcake/generator/default_project_structure_generator.rb