Class: PodBuilder::Install

Inherits:
Object
  • Object
show all
Defined in:
lib/pod_builder/install.rb

Class Method Summary collapse

Class Method Details

.podfile(podfile_content, podfile_items, build_configuration) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/pod_builder/install.rb', line 4

def self.podfile(podfile_content, podfile_items, build_configuration)
  PodBuilder::safe_rm_rf(Configuration.build_path)
  FileUtils.mkdir_p(Configuration.build_path)
  
  init_git(Configuration.build_path) # this is needed to be able to call safe_rm_rf

  podfile_path = "#{Configuration.build_path}/Podfile"
  File.write(podfile_path, podfile_content)
  Podfile.update_path_entires(podfile_path, true)
  Podfile.update_project_entries(podfile_path, true)

  begin  
    lock_file = "#{Configuration.build_path}/pod_builder.lock"
    FileUtils.touch(lock_file)
  
    install
    
    cleanup_frameworks(podfile_items)
    copy_frameworks(podfile_items)
    if build_configuration != "debug"
      copy_dsyms(podfile_items)
    end
  rescue Exception => e
    raise e
  ensure
    FileUtils.rm(lock_file)
  end
end