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



64
65
66
# File 'lib/fastlane/plugin/sentry/actions/sentry_upload_proguard.rb', line 64

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
# 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: :android_manifest_path,
                                 env_name: "ANDROID_MANIFEST_PATH",
                                 description: "Path to your merged AndroidManifest file. This is usually found under `app/build/intermediates/manifests/full`",
                                 optional: false,
                                 verify_block: proc do |value|
                                                 UI.user_error! "Could not find your merged AndroidManifest file at path '#{value}'" unless File.exist?(value)
                                               end)
  ]
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)


68
69
70
# File 'lib/fastlane/plugin/sentry/actions/sentry_upload_proguard.rb', line 68

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

.return_valueObject



60
61
62
# File 'lib/fastlane/plugin/sentry/actions/sentry_upload_proguard.rb', line 60

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)

  # Params - mapping & manifest
  mapping_path = params[:mapping_path]
  android_manifest_path = params[:android_manifest_path]

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

  command = [
    "upload-proguard",
    "--android-manifest",
    android_manifest_path,
    mapping_path
  ]

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