Class: Objc::Test::XcodeProject

Inherits:
Object
  • Object
show all
Defined in:
lib/objc/xcode_project.rb

Instance Method Summary collapse

Instance Method Details

#add(files) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/objc/xcode_project.rb', line 11

def add(files)
  project = Xcode.project(project_path)

  puts "Loading files into #{project} at #{project_path}"

  target = project.target(target_name)
  test_group = project.group(group_name)

  source_files_in_project = files.data.map do |path_data|
    test_group.create_file path_data
  end

  files_required_to_be_built = source_files_in_project.reject do |file|
    file.name.end_with?("h")
  end

  target.sources_build_phase do
    files_required_to_be_built.each do |source_file|
      add_build_file source_file
    end
  end

  project.save!
end

#execute!Object



37
38
39
40
# File 'lib/objc/xcode_project.rb', line 37

def execute!
  pid = spawn xctool_command
  Process.wait
end

#install!Object



5
6
7
8
# File 'lib/objc/xcode_project.rb', line 5

def install!
  clean
  extract
end