Sha256: 92c4b290720cf5241e96bbf60fe6dbb562b6617c5309bd62af9b41423d28939c

Contents?: true

Size: 1.11 KB

Versions: 16

Compression:

Stored size: 1.11 KB

Contents

require "xcodeproj"

module Xcake
  class XcodeprojContext

    include Context

    attr_accessor :project

    def create_object_for(dsl_object)
      case dsl_object
      when Project
        create_object_for_project(dsl_object)
      when Target
        create_object_for_target(dsl_object)
      when Configuration
        create_object_for_configuration(dsl_object)
      when Node
        create_object_for_node(dsl_object)
      else
        abort "DSL Object not recognized!"
      end
    end

    def create_object_for_project(project)
      puts "Creating Project..."

      # TODO: Make setup of project testable
      @project = Xcode::Project.new("./#{project.name}.xcodeproj", true)
      @project.setup_for_xcake
      @project
    end

    def create_object_for_target(target)
      puts "Creating Target..."
      @project.new_target(target)
    end

    def create_object_for_configuration(configuration)
      puts "Creating Configuration..."
      @project.new_configuration(configuration)
    end

    def create_object_for_node(node)
      puts "Creating Group..."
      @project.new_group(node)
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
xcake-0.6.19 lib/xcake/context/xcodeproj_context.rb
xcake-0.6.18 lib/xcake/context/xcodeproj_context.rb
xcake-0.6.17 lib/xcake/context/xcodeproj_context.rb
xcake-0.6.16 lib/xcake/context/xcodeproj_context.rb
xcake-0.6.14 lib/xcake/context/xcodeproj_context.rb
xcake-0.6.13 lib/xcake/context/xcodeproj_context.rb
xcake-0.6.12 lib/xcake/context/xcodeproj_context.rb
xcake-0.6.11 lib/xcake/context/xcodeproj_context.rb
xcake-0.6.10 lib/xcake/context/xcodeproj_context.rb
xcake-0.6.9 lib/xcake/context/xcodeproj_context.rb
xcake-0.6.8 lib/xcake/context/xcodeproj_context.rb
xcake-0.6.7 lib/xcake/context/xcodeproj_context.rb
xcake-0.6.6 lib/xcake/context/xcodeproj_context.rb
xcake-0.6.5 lib/xcake/context/xcodeproj_context.rb
xcake-0.6.4 lib/xcake/context/xcodeproj_context.rb
xcake-0.6.2 lib/xcake/context/xcodeproj_context.rb