Class: Fastlane::ActHelper::XCArchive

Inherits:
Object
  • Object
show all
Defined in:
lib/fastlane/plugin/act/helper/xc_archive.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(xcarchive_path, app_name) ⇒ XCArchive

Returns a new instance of XCArchive.



4
5
6
7
8
9
# File 'lib/fastlane/plugin/act/helper/xc_archive.rb', line 4

def initialize(xcarchive_path, app_name)
  @xcarchive_path = xcarchive_path
  
  @app_path = "Products/Applications/#{app_name}" if app_name
  @app_path = "Products/#{XCArchive.extract_app_path(xcarchive_path)}" unless app_name
end

Class Method Details

.extract_app_path(archive_path) ⇒ Object



44
45
46
47
48
# File 'lib/fastlane/plugin/act/helper/xc_archive.rb', line 44

def self.extract_app_path(archive_path)
  plist_buddy = PlistBuddy.new "#{archive_path}/Info.plist"

  (plist_buddy.exec "Print :ApplicationProperties:ApplicationPath").strip
end

Instance Method Details

#app_path(path) ⇒ Object

Returns an archive-relative path to the given application file



17
18
19
# File 'lib/fastlane/plugin/act/helper/xc_archive.rb', line 17

def app_path(path)
  "#{@app_path}/#{path}"
end

#cleanObject



40
41
42
# File 'lib/fastlane/plugin/act/helper/xc_archive.rb', line 40

def clean
  `rm -rf #{temp_dir.shellescape}/*`
end

#contains(path = nil) ⇒ Object



36
37
38
# File 'lib/fastlane/plugin/act/helper/xc_archive.rb', line 36

def contains(path = nil)
  File.exist? local_path(path)
end

#delete(path) ⇒ Object

Delete path inside the ipa



30
31
32
33
34
# File 'lib/fastlane/plugin/act/helper/xc_archive.rb', line 30

def delete(path)
  UI.verbose("Deleting #{path}")

  Dir.glob(local_path(path)).each { |f| File.delete(f) }
end

#extract(path) ⇒ Object

Extract files to the temp dir



22
23
# File 'lib/fastlane/plugin/act/helper/xc_archive.rb', line 22

def extract(path)
end

#local_path(path) ⇒ Object

Returns the full path to the given file that can be modified



12
13
14
# File 'lib/fastlane/plugin/act/helper/xc_archive.rb', line 12

def local_path(path)
  "#{@xcarchive_path}/#{path}"
end

#replace(path) ⇒ Object

Restore extracted files from the temp dir



26
27
# File 'lib/fastlane/plugin/act/helper/xc_archive.rb', line 26

def replace(path)
end