Class: Fastlane::Actions::SentryUploadProguardAction

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

Documentation collapse

Class Method Summary collapse

Class Method Details

.authorsObject



79
80
81
# File 'lib/fastlane/plugin/sentry/actions/sentry_upload_proguard.rb', line 79

def self.authors
  ["mpp-anasa"]
end

.available_optionsObject



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
# File 'lib/fastlane/plugin/sentry/actions/sentry_upload_proguard.rb', line 41

def self.available_options
  Helper::SentryConfig.common_api_config_items + [
    FastlaneCore::ConfigItem.new(key: :mapping_path,
                                 env_name: "ANDROID_MAPPING_PATH",
                                 description: "Path to your proguard mapping.txt file",
                                 optional: false,
                                 verify_block: proc do |value|
                                                 UI.user_error! "Could not find your mapping file at path '#{value}'" unless File.exist?(value)
                                               end),
    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 \
                                 mapping files and write the proguard UUIDs into a properties file",
                                 is_string: false,
                                 optional: true),
    FastlaneCore::ConfigItem.new(key: :write_properties,
                                 description: "Write the UUIDs for the processed mapping files into the given \
                                 properties file",
                                 optional: true),
    FastlaneCore::ConfigItem.new(key: :require_one,
                                 description: "Requires at least one file to upload or the command will error",
                                 is_string: false,
                                 optional: true),
    FastlaneCore::ConfigItem.new(key: :uuid,
                                 description: "Explicitly override the UUID of the mapping file with another one. \
                                 This should be used with caution as it means that you can upload multiple mapping \
                                 files if you don't take care. This however can be useful if you have a build \
                                 process in which you need to know the UUID of the proguard file before it was \
                                 created. If you upload a file with a forced UUID you can only upload a single \
                                 proguard file",
                                 optional: true)
  ]
end

.descriptionObject



30
31
32
# File 'lib/fastlane/plugin/sentry/actions/sentry_upload_proguard.rb', line 30

def self.description
  "Upload mapping to a project on Sentry"
end

.detailsObject



34
35
36
37
38
39
# File 'lib/fastlane/plugin/sentry/actions/sentry_upload_proguard.rb', line 34

def self.details
  [
    "This action allows you to upload the proguard mapping file to Sentry.",
    "See https://docs.sentry.io/product/cli/dif/#proguard-mapping-upload for more information."
  ].join(" ")
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


83
84
85
# File 'lib/fastlane/plugin/sentry/actions/sentry_upload_proguard.rb', line 83

def self.is_supported?(platform)
  platform == :android
end

.return_valueObject



75
76
77
# File 'lib/fastlane/plugin/sentry/actions/sentry_upload_proguard.rb', line 75

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
# File 'lib/fastlane/plugin/sentry/actions/sentry_upload_proguard.rb', line 4

def self.run(params)
  Helper::SentryConfig.parse_api_params(params)

  mapping_path = params[:mapping_path]

  # Verify file exists
  UI.user_error!("Mapping file does not exist at path: #{mapping_path}") unless File.exist? mapping_path

  command = [
    "upload-proguard",
    mapping_path
  ]

  command.push('--no-upload') if params[:no_upload]
  command.push('--write-properties').push(params[:write_properties]) unless params[:write_properties].nil?
  command.push('--require-one') if params[:require_one]
  command.push('--uuid').push(params[:uuid]) unless params[:uuid].nil?

  Helper::SentryHelper.call_sentry_cli(params, command)
  UI.success("Successfully uploaded mapping file!")
end