Class: Fastlane::Actions::SentryDebugFilesUploadAction

Inherits:
Action
  • Object
show all
Defined in:
lib/fastlane/plugin/sentry/actions/sentry_debug_files_upload.rb

Documentation collapse

Class Method Summary collapse

Class Method Details

.authorsObject



153
154
155
# File 'lib/fastlane/plugin/sentry/actions/sentry_debug_files_upload.rb', line 153

def self.authors
  ["denrase"]
end

.available_optionsObject



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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# File 'lib/fastlane/plugin/sentry/actions/sentry_debug_files_upload.rb', line 60

def self.available_options
  Helper::SentryConfig.common_api_config_items + [
    FastlaneCore::ConfigItem.new(key: :path,
                                 description: "Path or an array of paths to search recursively for symbol files. Defaults to DSYM_OUTPUT_PATH from fastlane context if available, otherwise '.' (current directory)",
                                 type: Array,
                                 optional: true),
    FastlaneCore::ConfigItem.new(key: :type,
                                 short_option: "-t",
                                 description: "Only consider debug information files of the given \
                                 type.  By default, all types are considered",
                                 optional: true,
                                 verify_block: proc do |value|
                                   UI.user_error! "Invalid value '#{value}'" unless ['bcsymbolmap', 'breakpad', 'dsym', 'elf', 'jvm', 'pdb', 'pe', 'portablepdb', 'sourcebundle', 'wasm'].include? value
                                 end),
    FastlaneCore::ConfigItem.new(key: :no_unwind,
                                 description: "Do not scan for stack unwinding information. Specify \
                                 this flag for builds with disabled FPO, or when \
                                 stackwalking occurs on the device. This usually \
                                 excludes executables and dynamic libraries. They might \
                                 still be uploaded, if they contain additional \
                                 processable information (see other flags)",
                                 is_string: false,
                                 optional: true),
    FastlaneCore::ConfigItem.new(key: :no_debug,
                                 description: "Do not scan for debugging information. This will \
                                 usually exclude debug companion files. They might \
                                 still be uploaded, if they contain additional \
                                 processable information (see other flags)",
                                 conflicting_options: [:no_unwind],
                                 is_string: false,
                                 optional: true),
    FastlaneCore::ConfigItem.new(key: :no_sources,
                                 description: "Do not scan for source information. This will \
                                 usually exclude source bundle files. They might \
                                 still be uploaded, if they contain additional \
                                 processable information (see other flags)",
                                 is_string: false,
                                 optional: true),
    FastlaneCore::ConfigItem.new(key: :id,
                                 description: "Search for specific debug identifiers",
                                 optional: true),
    FastlaneCore::ConfigItem.new(key: :require_all,
                                 description: "Errors if not all identifiers specified with --id could be found",
                                 is_string: false,
                                 optional: true),
    FastlaneCore::ConfigItem.new(key: :symbol_maps,
                                 description: "Optional path to BCSymbolMap files which are used to \
                                 resolve hidden symbols in dSYM files downloaded from \
                                 iTunes Connect. This requires the dsymutil tool to be \
                                 available",
                                 optional: true),
    FastlaneCore::ConfigItem.new(key: :derived_data,
                                 description: "Search for debug symbols in Xcode's derived data",
                                 is_string: false,
                                 optional: true),
    FastlaneCore::ConfigItem.new(key: :no_zips,
                                 description: "Do not search in ZIP files",
                                 is_string: false,
                                 optional: true),
    FastlaneCore::ConfigItem.new(key: :no_upload,
                                 description: "Disable the actual upload. This runs all steps for the \
                                 processing but does not trigger the upload. This is useful if \
                                 you just want to verify the setup or skip the upload in tests",
                                 is_string: false,
                                 optional: true),
    FastlaneCore::ConfigItem.new(key: :include_sources,
                                 description: "Include sources from the local file system and upload \
                                 them as source bundles",
                                 is_string: false,
                                 optional: true),
    FastlaneCore::ConfigItem.new(key: :wait,
                                 description: "Wait for the server to fully process uploaded files. Errors \
                                 can only be displayed if --wait or --wait-for is specified, but this will \
                                 significantly slow down the upload process",
                                 is_string: false,
                                 optional: true),
    FastlaneCore::ConfigItem.new(key: :wait_for,
                                 description: "Wait for the server to fully process uploaded files, but at most \
                                 for the given number of seconds. Errors can only be displayed if --wait or \
                                 --wait-for is specified, but this will significantly slow down the upload process",
                                 type: Integer,
                                 optional: true),
    FastlaneCore::ConfigItem.new(key: :il2cpp_mapping,
                                 description: "Compute il2cpp line mappings and upload them along with sources",
                                 is_string: false,
                                 optional: true)
  ]
end

.descriptionObject



49
50
51
# File 'lib/fastlane/plugin/sentry/actions/sentry_debug_files_upload.rb', line 49

def self.description
  "Upload debugging information files."
end

.detailsObject



53
54
55
56
57
58
# File 'lib/fastlane/plugin/sentry/actions/sentry_debug_files_upload.rb', line 53

def self.details
  [
    "Files can be uploaded using the `debug-files upload` command. This command will scan a given folder recursively for files and upload them to Sentry.",
    "See https://docs.sentry.io/product/cli/dif/#uploading-files for more information."
  ].join(" ")
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


157
158
159
# File 'lib/fastlane/plugin/sentry/actions/sentry_debug_files_upload.rb', line 157

def self.is_supported?(platform)
  true
end

.return_valueObject



149
150
151
# File 'lib/fastlane/plugin/sentry/actions/sentry_debug_files_upload.rb', line 149

def self.return_value
  nil
end

.run(params) ⇒ 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
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/fastlane/plugin/sentry/actions/sentry_debug_files_upload.rb', line 4

def self.run(params)
  require 'shellwords'

  Helper::SentryConfig.parse_api_params(params)

  paths = params[:path]
  # Use DSYM_OUTPUT_PATH from fastlane context if available, otherwise default to current directory
  if paths.nil?
    dsym_path = Actions.lane_context[SharedValues::DSYM_OUTPUT_PATH]
    if dsym_path && !dsym_path.to_s.empty?
      paths = [dsym_path]
    else
      paths = ['.']
    end
  end

  command = [
    "debug-files",
    "upload"
  ]
  command += paths

  command.push('--type').push(params[:type]) unless params[:type].nil?
  command.push('--no-unwind') unless params[:no_unwind].nil?
  command.push('--no-debug') unless params[:no_debug].nil?
  command.push('--no-sources') unless params[:no_sources].nil?
  command.push('--id').push(params[:id]) unless params[:id].nil?
  command.push('--require-all') unless params[:require_all].nil?
  command.push('--symbol-maps').push(params[:symbol_maps]) unless params[:symbol_maps].nil?
  command.push('--derived-data') unless params[:derived_data].nil?
  command.push('--no-zips') unless params[:no_zips].nil?
  command.push('--no-upload') unless params[:no_upload].nil?
  command.push('--include-sources') if params[:include_sources] == true
  command.push('--wait') unless params[:wait].nil?
  command.push('--wait-for').push(params[:wait_for]) unless params[:wait_for].nil?
  command.push('--il2cpp-mapping') unless params[:il2cpp_mapping].nil?

  Helper::SentryHelper.call_sentry_cli(params, command)
  UI.success("Successfully ran debug-files upload")
end