Class: BetaBuilder::Xcode4ArchivedBuild

Inherits:
Object
  • Object
show all
Defined in:
lib/beta_builder/archived_build.rb

Instance Method Summary collapse

Constructor Details

#initialize(configuration) ⇒ Xcode4ArchivedBuild

Returns a new instance of Xcode4ArchivedBuild.



30
31
32
# File 'lib/beta_builder/archived_build.rb', line 30

def initialize(configuration)
  @configuration = configuration
end

Instance Method Details

#applications_pathObject



42
43
44
# File 'lib/beta_builder/archived_build.rb', line 42

def applications_path
  File.join("Products", "Applications")
end

#archive_file_nameObject



34
35
36
# File 'lib/beta_builder/archived_build.rb', line 34

def archive_file_name
  "#{@configuration.archive_name} #{Time.now.strftime('%Y-%m-%d %H.%M')}.xcarchive"
end

#archive_path_within(path) ⇒ Object



38
39
40
# File 'lib/beta_builder/archived_build.rb', line 38

def archive_path_within(path)
  File.join(path, "#{Time.now.strftime('%Y-%m-%d')}", archive_file_name)
end

#dsyms_pathObject



46
47
48
# File 'lib/beta_builder/archived_build.rb', line 46

def dsyms_path
  "dSYMs"
end

#plist_info_pathObject



50
51
52
# File 'lib/beta_builder/archived_build.rb', line 50

def plist_info_path
  File.join(@configuration.built_app_path, "Info.plist")
end

#save_to(path) ⇒ Object



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/beta_builder/archived_build.rb', line 54

def save_to(path)
  archive_path = archive_path_within(path)
  FileUtils.mkdir_p(archive_path)
  
  application_path = File.join(archive_path, applications_path)
  FileUtils.mkdir_p(application_path)
  FileUtils.cp_r(@configuration.built_app_path, application_path)
  
  dsym_path = File.join(archive_path, dsyms_path)
  FileUtils.mkdir_p(dsym_path)
  FileUtils.cp_r(@configuration.built_app_dsym_path, dsym_path)
  
  write_plist_to(archive_path)
  archive_path
end