Sha256: 8c96faba2d059093670118fbe2fb404fca58176df39a9c3de8fecb61947a3bd4

Contents?: true

Size: 1.48 KB

Versions: 1

Compression:

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

1 entries across 1 versions & 1 rubygems

Version Path
xcake-0.8.9 lib/xcake/generator/default_project_structure_generator.rb