Sha256: 42c24b85069c60110998054a422e54e2e8d86e079bf2b778726f1437ea3ee376

Contents?: true

Size: 1.14 KB

Versions: 16

Compression:

Stored size: 1.14 KB

Contents

require 'molinillo'

#TODO: Reduce lines of code here :)
module Xcake
  class Command
    class Make < Command
      self.summary = "Makes the Xcode project from a Cakefile"
      self.description = "Makes the Xcode project from a Cakefile"

      def run
        file_path = "#{Dir.pwd}/Cakefile"

        unless File.exist?(file_path)
          raise Xcake::Informative, "Couldn't find Cakefile"
        end

        puts "Reading Cakefile..."
        file_contents = File.read(file_path)

        project = Project.new
        project.instance_eval(file_contents)

        context = XcodeprojContext.new

        #TODO: Debug logs for generator
        repository = Generator.repository
        #puts "Registered Generators #{repository}"

        #TODO: Don't use class as name
        dependency_provider = DependencyProvider.new(repository)
        resolver = Molinillo::Resolver.new(dependency_provider, UI.new)
        resolution = resolver.resolve(Generator.repository)
        resolution.tsort.map do |g|
          #puts "Running #{g.name}..."
          generator = g.name.new(context)
          project.accept(generator)
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

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