Class: Xcake::Command::Make

Inherits:
Xcake::Command show all
Defined in:
lib/xcake/command/make.rb

Instance Method Summary collapse

Instance Method Details

#runObject

Raises:



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/xcake/command/make.rb', line 7

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

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

  EventHooks.run_hook :before_cakefile_read
  file_contents = File.read(file_path)

  project = Project.new
  project.instance_eval(file_contents, file_path)

  context = XcodeprojContext.new

  dependency_provider = DependencyProvider.new(Generator)
  dependency_provider.tsort.each do |g|
    generator = g.new(context)
    project.accept(generator)
  end
end