Sha256: b11f5d536d20bef36796c9033d333b61d36cc6c493e7e87d0c5511020cdc3631

Contents?: true

Size: 1.69 KB

Versions: 3

Compression:

Stored size: 1.69 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

3 entries across 3 versions & 1 rubygems

Version Path
xcake-0.8.13 lib/xcake/generator/default_project_structure_generator.rb
xcake-0.8.12 lib/xcake/generator/default_project_structure_generator.rb
xcake-0.8.10 lib/xcake/generator/default_project_structure_generator.rb