Sha256: 18e0d85f0b33a0830efd991365be7957f19171029d4346f1de93a558ae392d7b

Contents?: true

Size: 1.32 KB

Versions: 4

Compression:

Stored size: 1.32 KB

Contents

require 'xcodeproj'

module Xcake
  module Generator
    class Project

      include Visitor

      attr_accessor :project
      attr_accessor :root_node

      def initialize
        @root_node = Node.new
      end

      def output_filepath_for_project(project)
        "./#{project.project_name}.xcodeproj"
      end

      def visit_project(project)

        puts "Creating Project..."

        output_filepath = output_filepath_for_project(project)

        @project = Xcode::Project.new(output_filepath, true)
        @project.setup_for_xcake

        @project.class_prefix = project.class_prefix if project.class_prefix
        @project.organization = project.organization if project.organization
      end

      def leave_project(project)

        generator = Path.new(@project)
        @root_node.accept(generator)

        puts "Writing Project..."
        @project.recreate_user_schemes
        @project.save

        puts "Done!"
      end

      def visit_target(target)
        generator = Target.new(@project, @root_node)
        target.accept(generator)
      end

      def leave_target(target)
      end

      def visit_configuration(configuration)
        generator = Configuration.new(@project, @project)
        configuration.accept(generator)
      end

      def leave_configuration(configuration)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
xcake-0.3.0 lib/xcake/generator/project.rb
xcake-0.1.9 lib/xcake/generator/project.rb
xcake-0.1.8 lib/xcake/generator/project.rb
xcake-0.1.7 lib/xcake/generator/project.rb