Class: XamarinTestCloud::Dsym
- Inherits:
-
Object
- Object
- XamarinTestCloud::Dsym
- Defined in:
- lib/xamarin-test-cloud/dsym.rb
Overview
TODO validate dsym against the current application.
-
put the dSYM.zip and .ipa in a directory
-
$ unzip <the>.ipa
-
$ unzip <the>.dSYM.zip
-
$ xcrun dwarfdump –uuid Payload/My.app/My
-
$ xcrun dwarfdump –uuid My.app.dSYM
-
confirm that they match.
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#dwarf_symbol_files ⇒ Object
Cannot use Dir.glob github.com/xamarinhq/test-cloud-command-line/issues/52.
-
#initialize(path) ⇒ Dsym
constructor
Caller should rescue RuntimeError and re-raise.
- #inspect ⇒ Object
- #remote_path(path_to_app) ⇒ Object
- #symbol_file ⇒ Object
- #to_s ⇒ Object
- #validate! ⇒ Object
Constructor Details
#initialize(path) ⇒ Dsym
Caller should rescue RuntimeError and re-raise.
16 17 18 19 |
# File 'lib/xamarin-test-cloud/dsym.rb', line 16 def initialize(path) @path = path validate! end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
12 13 14 |
# File 'lib/xamarin-test-cloud/dsym.rb', line 12 def path @path end |
Instance Method Details
#dwarf_symbol_files ⇒ Object
Cannot use Dir.glob github.com/xamarinhq/test-cloud-command-line/issues/52
96 97 98 99 100 101 102 103 |
# File 'lib/xamarin-test-cloud/dsym.rb', line 96 def dwarf_symbol_files @dwarf_symbol_files ||= begin base = File.join(path, "Contents", "Resources", "DWARF") Dir.entries(base).select do |entry| !(entry.end_with?('..') || entry.end_with?('.')) end.map { |entry| File.join(base, entry) } end end |
#inspect ⇒ Object
25 26 27 |
# File 'lib/xamarin-test-cloud/dsym.rb', line 25 def inspect to_s end |
#remote_path(path_to_app) ⇒ Object
86 87 88 |
# File 'lib/xamarin-test-cloud/dsym.rb', line 86 def remote_path(path_to_app) "#{File.basename(path_to_app)}_dSym" end |
#symbol_file ⇒ Object
90 91 92 |
# File 'lib/xamarin-test-cloud/dsym.rb', line 90 def symbol_file File.(dwarf_symbol_files[0]) end |
#to_s ⇒ Object
21 22 23 |
# File 'lib/xamarin-test-cloud/dsym.rb', line 21 def to_s "#<DSYM #{@path}>" end |
#validate! ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/xamarin-test-cloud/dsym.rb', line 29 def validate! extension = File.extname(path) if extension != ".dSYM" raise RuntimeError, %Q[Invalid dSYM directory. The --dsym-file must have a dSYM extension. Found: #{path} ] end if !File.exist?(path) raise RuntimeError, %Q[Invalid dSYM directory. The --dsym-file does not exist: #{path} ] end if !File.directory?(path) raise RuntimeError, %Q[Invalid dSYM directory. The --dsym-file is not a directory: #{path} ] end if dwarf_symbol_files.count > 1 raise RuntimeError, %Q[Invalid dSYM directory. The --dsym-file contains more than one symbol file. Check the contents of #{File.join("Contents", "Resources", "DWARF")} in: #{path} ] end if dwarf_symbol_files.count < 1 raise RuntimeError, %Q[Invalid dSYM directory. The --dsym-file contains no symbol file. Check the contents of #{File.join("Contents", "Resources", "DWARF")} in: #{path} #{Dir.glob(File.join(path, "Contents", "Resources", "DWARF", "*" ))} ] end true end |