fastlane-plugin-sentry 1.11.1 → 1.12.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c53121ea7f7c00d665e77435c5fef8f378efe2a718fd8268b0cda6833592eb10
4
- data.tar.gz: 4fac12d2ad679a0ec2ea2311192fd18d9eff66a0be91987cdfa1bfdce0136e16
3
+ metadata.gz: 8e45e9018f65e93450dd418c3a2ff4568b9098c84c59be28a502f26d088d83c7
4
+ data.tar.gz: 9bb0b7eb1e0300dc10a1b605b3115838ec234eaf4a361f7a288d5a31d836a568
5
5
  SHA512:
6
- metadata.gz: 8a1ce6458533a6244d154588f78c1376d862bb425e37d08351a89203210588d1d6a5d4345d3f01e43d900a9185416fb3e3cd96f2aafbcb47eb5996f19bd12278
7
- data.tar.gz: 3224bd013b9221dd2feca2c740d686bfa4abe5633cceeda742ad4acf02897d71f402bf74704cf5d4f33472dac081d8dd693a4825640ed8c490e64cb2a3cab018
6
+ metadata.gz: b1fb02191b9ad8333ff0bee6d3112aed1eca0532dbcdea51fa73aa6e589106003226eb5a65be44b09ee75623b2ffe7fe4df72d58b5bb2566651f2ee63784755c
7
+ data.tar.gz: f721c6840dc15c23edd3fbe099ecee3e97ec9863667afa1d5dc6453ae08ade79128fd26f3fdce665afce19ac3f923ea41b3b442c110a058c1521a497e928d408
@@ -2,7 +2,7 @@ module Fastlane
2
2
  module Actions
3
3
  class SentryCheckCliInstalledAction < Action
4
4
  def self.run(params)
5
- Helper::SentryHelper.check_sentry_cli!
5
+ Helper::SentryHelper.find_and_check_sentry_cli_path!(params)
6
6
  UI.success("Successfully checked that sentry-cli is installed")
7
7
  end
8
8
 
@@ -32,6 +32,10 @@ module Fastlane
32
32
  def self.is_supported?(platform)
33
33
  true
34
34
  end
35
+
36
+ def self.available_options
37
+ Helper::SentryConfig.common_cli_config_items
38
+ end
35
39
  end
36
40
  end
37
41
  end
@@ -4,7 +4,6 @@ module Fastlane
4
4
  def self.run(params)
5
5
  require 'shellwords'
6
6
 
7
- Helper::SentryHelper.check_sentry_cli!
8
7
  Helper::SentryConfig.parse_api_params(params)
9
8
 
10
9
  version = params[:version]
@@ -12,7 +11,6 @@ module Fastlane
12
11
  version = "#{version}+#{params[:build]}" if params[:build]
13
12
 
14
13
  command = [
15
- "sentry-cli",
16
14
  "releases",
17
15
  "deploys",
18
16
  version,
@@ -25,7 +23,7 @@ module Fastlane
25
23
  command.push('--finished').push(params[:finished]) unless params[:finished].nil?
26
24
  command.push('--time').push(params[:time]) unless params[:time].nil?
27
25
 
28
- Helper::SentryHelper.call_sentry_cli(command)
26
+ Helper::SentryHelper.call_sentry_cli(params, command)
29
27
  UI.success("Successfully created deploy: #{version}")
30
28
  end
31
29
 
@@ -4,7 +4,6 @@ module Fastlane
4
4
  def self.run(params)
5
5
  require 'shellwords'
6
6
 
7
- Helper::SentryHelper.check_sentry_cli!
8
7
  Helper::SentryConfig.parse_api_params(params)
9
8
 
10
9
  version = params[:version]
@@ -12,14 +11,13 @@ module Fastlane
12
11
  version = "#{version}+#{params[:build]}" if params[:build]
13
12
 
14
13
  command = [
15
- "sentry-cli",
16
14
  "releases",
17
15
  "new",
18
16
  version
19
17
  ]
20
18
  command.push("--finalize") if params[:finalize] == true
21
19
 
22
- Helper::SentryHelper.call_sentry_cli(command)
20
+ Helper::SentryHelper.call_sentry_cli(params, command)
23
21
  UI.success("Successfully created release: #{version}")
24
22
  end
25
23
 
@@ -43,14 +41,14 @@ module Fastlane
43
41
  FastlaneCore::ConfigItem.new(key: :version,
44
42
  description: "Release version to create on Sentry"),
45
43
  FastlaneCore::ConfigItem.new(key: :app_identifier,
46
- short_option: "-a",
47
- env_name: "SENTRY_APP_IDENTIFIER",
48
- description: "App Bundle Identifier, prepended to version",
49
- optional: true),
44
+ short_option: "-a",
45
+ env_name: "SENTRY_APP_IDENTIFIER",
46
+ description: "App Bundle Identifier, prepended to version",
47
+ optional: true),
50
48
  FastlaneCore::ConfigItem.new(key: :build,
51
- short_option: "-b",
52
- description: "Release build to create on Sentry",
53
- optional: true),
49
+ short_option: "-b",
50
+ description: "Release build to create on Sentry",
51
+ optional: true),
54
52
  FastlaneCore::ConfigItem.new(key: :finalize,
55
53
  description: "Whether to finalize the release. If not provided or false, the release can be finalized using the finalize_release action",
56
54
  default_value: false,
@@ -4,7 +4,6 @@ module Fastlane
4
4
  def self.run(params)
5
5
  require 'shellwords'
6
6
 
7
- Helper::SentryHelper.check_sentry_cli!
8
7
  Helper::SentryConfig.parse_api_params(params)
9
8
 
10
9
  version = params[:version]
@@ -12,13 +11,12 @@ module Fastlane
12
11
  version = "#{version}+#{params[:build]}" if params[:build]
13
12
 
14
13
  command = [
15
- "sentry-cli",
16
14
  "releases",
17
15
  "finalize",
18
16
  version
19
17
  ]
20
18
 
21
- Helper::SentryHelper.call_sentry_cli(command)
19
+ Helper::SentryHelper.call_sentry_cli(params, command)
22
20
  UI.success("Successfully finalized release: #{version}")
23
21
  end
24
22
 
@@ -42,14 +40,14 @@ module Fastlane
42
40
  FastlaneCore::ConfigItem.new(key: :version,
43
41
  description: "Release version to finalize on Sentry"),
44
42
  FastlaneCore::ConfigItem.new(key: :app_identifier,
45
- short_option: "-a",
46
- env_name: "SENTRY_APP_IDENTIFIER",
47
- description: "App Bundle Identifier, prepended to version",
48
- optional: true),
43
+ short_option: "-a",
44
+ env_name: "SENTRY_APP_IDENTIFIER",
45
+ description: "App Bundle Identifier, prepended to version",
46
+ optional: true),
49
47
  FastlaneCore::ConfigItem.new(key: :build,
50
- short_option: "-b",
51
- description: "Release build to finalize on Sentry",
52
- optional: true)
48
+ short_option: "-b",
49
+ description: "Release build to finalize on Sentry",
50
+ optional: true)
53
51
  ]
54
52
  end
55
53
 
@@ -4,7 +4,6 @@ module Fastlane
4
4
  def self.run(params)
5
5
  require 'shellwords'
6
6
 
7
- Helper::SentryHelper.check_sentry_cli!
8
7
  Helper::SentryConfig.parse_api_params(params)
9
8
 
10
9
  version = params[:version]
@@ -12,7 +11,6 @@ module Fastlane
12
11
  version = "#{version}+#{params[:build]}" if params[:build]
13
12
 
14
13
  command = [
15
- "sentry-cli",
16
14
  "releases",
17
15
  "set-commits",
18
16
  version
@@ -22,7 +20,7 @@ module Fastlane
22
20
  command.push('--clear') if params[:clear]
23
21
  command.push('--commit').push(params[:commit]) unless params[:commit].nil?
24
22
 
25
- Helper::SentryHelper.call_sentry_cli(command)
23
+ Helper::SentryHelper.call_sentry_cli(params, command)
26
24
  UI.success("Successfully set commits for release: #{version}")
27
25
  end
28
26
 
@@ -46,25 +44,25 @@ module Fastlane
46
44
  FastlaneCore::ConfigItem.new(key: :version,
47
45
  description: "Release version on Sentry"),
48
46
  FastlaneCore::ConfigItem.new(key: :app_identifier,
49
- short_option: "-a",
50
- env_name: "SENTRY_APP_IDENTIFIER",
51
- description: "App Bundle Identifier, prepended to version",
52
- optional: true),
47
+ short_option: "-a",
48
+ env_name: "SENTRY_APP_IDENTIFIER",
49
+ description: "App Bundle Identifier, prepended to version",
50
+ optional: true),
53
51
  FastlaneCore::ConfigItem.new(key: :build,
54
- short_option: "-b",
55
- description: "Release build on Sentry",
56
- optional: true),
52
+ short_option: "-b",
53
+ description: "Release build on Sentry",
54
+ optional: true),
57
55
  FastlaneCore::ConfigItem.new(key: :auto,
58
- description: "Enable completely automated commit management",
59
- is_string: false,
60
- default_value: false),
56
+ description: "Enable completely automated commit management",
57
+ is_string: false,
58
+ default_value: false),
61
59
  FastlaneCore::ConfigItem.new(key: :clear,
62
- description: "Clear all current commits from the release",
63
- is_string: false,
64
- default_value: false),
60
+ description: "Clear all current commits from the release",
61
+ is_string: false,
62
+ default_value: false),
65
63
  FastlaneCore::ConfigItem.new(key: :commit,
66
- description: "Commit spec, see `sentry-cli releases help set-commits` for more information",
67
- optional: true)
64
+ description: "Commit spec, see `sentry-cli releases help set-commits` for more information",
65
+ optional: true)
68
66
  ]
69
67
  end
70
68
 
@@ -4,14 +4,12 @@ module Fastlane
4
4
  def self.run(params)
5
5
  require 'shellwords'
6
6
 
7
- Helper::SentryHelper.check_sentry_cli!
8
7
  Helper::SentryConfig.parse_api_params(params)
9
8
 
10
9
  path = params[:path]
11
10
  path = '.' if path.nil?
12
11
 
13
12
  command = [
14
- "sentry-cli",
15
13
  "upload-dif",
16
14
  path
17
15
  ]
@@ -31,7 +29,7 @@ module Fastlane
31
29
  command.push('--wait') unless params[:wait].nil?
32
30
  command.push('--upload-symbol-maps') unless params[:upload_symbol_maps].nil?
33
31
 
34
- Helper::SentryHelper.call_sentry_cli(command)
32
+ Helper::SentryHelper.call_sentry_cli(params, command)
35
33
  UI.success("Successfully ran upload-dif")
36
34
  end
37
35
 
@@ -61,7 +59,7 @@ module Fastlane
61
59
  type. By default, all types are considered",
62
60
  optional: true,
63
61
  verify_block: proc do |value|
64
- UI.user_error! "Invalid value '#{value}'" unless ['dsym', 'elf', 'breakpad', 'pdb', 'pe', 'sourcebundle', 'bcsymbolmap'].include? value
62
+ UI.user_error! "Invalid value '#{value}'" unless ['dsym', 'elf', 'breakpad', 'pdb', 'pe', 'sourcebundle', 'bcsymbolmap'].include? value
65
63
  end),
66
64
  FastlaneCore::ConfigItem.new(key: :no_unwind,
67
65
  description: "Do not scan for stack unwinding information. Specify \
@@ -72,7 +70,7 @@ module Fastlane
72
70
  processable information (see other flags)",
73
71
  is_string: false,
74
72
  optional: true),
75
- FastlaneCore::ConfigItem.new(key: :no_debug,
73
+ FastlaneCore::ConfigItem.new(key: :no_debug,
76
74
  description: "Do not scan for debugging information. This will \
77
75
  usually exclude debug companion files. They might \
78
76
  still be uploaded, if they contain additional \
@@ -80,46 +78,46 @@ module Fastlane
80
78
  conflicting_options: [:no_unwind],
81
79
  is_string: false,
82
80
  optional: true),
83
- FastlaneCore::ConfigItem.new(key: :no_sources,
81
+ FastlaneCore::ConfigItem.new(key: :no_sources,
84
82
  description: "Do not scan for source information. This will \
85
83
  usually exclude source bundle files. They might \
86
84
  still be uploaded, if they contain additional \
87
85
  processable information (see other flags)",
88
86
  is_string: false,
89
87
  optional: true),
90
- FastlaneCore::ConfigItem.new(key: :ids,
88
+ FastlaneCore::ConfigItem.new(key: :ids,
91
89
  description: "Search for specific debug identifiers",
92
90
  optional: true),
93
- FastlaneCore::ConfigItem.new(key: :require_all,
91
+ FastlaneCore::ConfigItem.new(key: :require_all,
94
92
  description: "Errors if not all identifiers specified with --id could be found",
95
93
  is_string: false,
96
94
  optional: true),
97
- FastlaneCore::ConfigItem.new(key: :symbol_maps,
95
+ FastlaneCore::ConfigItem.new(key: :symbol_maps,
98
96
  description: "Optional path to BCSymbolMap files which are used to \
99
97
  resolve hidden symbols in dSYM files downloaded from \
100
98
  iTunes Connect. This requires the dsymutil tool to be \
101
99
  available",
102
100
  optional: true),
103
- FastlaneCore::ConfigItem.new(key: :derived_data,
101
+ FastlaneCore::ConfigItem.new(key: :derived_data,
104
102
  description: "Search for debug symbols in Xcode's derived data",
105
103
  is_string: false,
106
104
  optional: true),
107
- FastlaneCore::ConfigItem.new(key: :no_zips,
105
+ FastlaneCore::ConfigItem.new(key: :no_zips,
108
106
  description: "Do not search in ZIP files",
109
107
  is_string: false,
110
108
  optional: true),
111
- FastlaneCore::ConfigItem.new(key: :info_plist,
109
+ FastlaneCore::ConfigItem.new(key: :info_plist,
112
110
  description: "Optional path to the Info.plist.{n}We will try to find this \
113
111
  automatically if run from Xcode. Providing this information \
114
112
  will associate the debug symbols with a specific ITC application \
115
113
  and build in Sentry. Note that if you provide the plist \
116
114
  explicitly it must already be processed",
117
115
  optional: true),
118
- FastlaneCore::ConfigItem.new(key: :no_reprocessing,
116
+ FastlaneCore::ConfigItem.new(key: :no_reprocessing,
119
117
  description: "Do not trigger reprocessing after uploading",
120
118
  is_string: false,
121
119
  optional: true),
122
- FastlaneCore::ConfigItem.new(key: :force_foreground,
120
+ FastlaneCore::ConfigItem.new(key: :force_foreground,
123
121
  description: "Wait for the process to finish.{n}\
124
122
  By default, the upload process will detach and continue in the \
125
123
  background when triggered from Xcode. When an error happens, \
@@ -128,24 +126,24 @@ module Fastlane
128
126
  will be shown in the Xcode build output",
129
127
  is_string: false,
130
128
  optional: true),
131
- FastlaneCore::ConfigItem.new(key: :include_sources,
129
+ FastlaneCore::ConfigItem.new(key: :include_sources,
132
130
  description: "Include sources from the local file system and upload \
133
131
  them as source bundles",
134
132
  is_string: false,
135
133
  optional: true),
136
- FastlaneCore::ConfigItem.new(key: :wait,
134
+ FastlaneCore::ConfigItem.new(key: :wait,
137
135
  description: "Wait for the server to fully process uploaded files. Errors \
138
136
  can only be displayed if --wait is specified, but this will \
139
137
  significantly slow down the upload process",
140
138
  is_string: false,
141
139
  optional: true),
142
- FastlaneCore::ConfigItem.new(key: :upload_symbol_maps,
140
+ FastlaneCore::ConfigItem.new(key: :upload_symbol_maps,
143
141
  description: "Upload any BCSymbolMap files found to allow Sentry to resolve \
144
142
  hidden symbols, e.g. when it downloads dSYMs directly from App \
145
143
  Store Connect or when you upload dSYMs without first resolving \
146
144
  the hidden symbols using --symbol-maps",
147
145
  is_string: false,
148
- optional: true),
146
+ optional: true)
149
147
  ]
150
148
  end
151
149
 
@@ -2,7 +2,6 @@ module Fastlane
2
2
  module Actions
3
3
  class SentryUploadDsymAction < Action
4
4
  def self.run(params)
5
- Helper::SentryHelper.check_sentry_cli!
6
5
  Helper::SentryConfig.parse_api_params(params)
7
6
 
8
7
  # Params - dSYM
@@ -16,14 +15,14 @@ module Fastlane
16
15
  UI.user_error!("dSYM does not exist at path: #{path}") unless File.exist? path
17
16
  end
18
17
 
19
- command = ["sentry-cli", "upload-dsym"]
18
+ command = ["upload-dsym"]
20
19
  command.push("--symbol-maps") unless params[:symbol_maps].nil?
21
20
  command.push(params[:symbol_maps]) unless params[:symbol_maps].nil?
22
21
  command.push("--info-plist") unless params[:info_plist].nil?
23
22
  command.push(params[:info_plist]) unless params[:info_plist].nil?
24
23
  command += dsym_paths
25
24
 
26
- Helper::SentryHelper.call_sentry_cli(command)
25
+ Helper::SentryHelper.call_sentry_cli(params, command)
27
26
  UI.success("Successfully uploaded dSYMs!")
28
27
  end
29
28
 
@@ -46,13 +45,13 @@ module Fastlane
46
45
  def self.available_options
47
46
  Helper::SentryConfig.common_api_config_items + [
48
47
  FastlaneCore::ConfigItem.new(key: :dsym_path,
49
- env_name: "SENTRY_DSYM_PATH",
50
- description: "Path to your symbols file. For iOS and Mac provide path to app.dSYM.zip",
51
- default_value: Actions.lane_context[SharedValues::DSYM_OUTPUT_PATH],
52
- optional: true,
53
- verify_block: proc do |value|
54
- UI.user_error! "Could not find Path to your symbols file at path '#{value}'" unless File.exist?(value)
55
- end),
48
+ env_name: "SENTRY_DSYM_PATH",
49
+ description: "Path to your symbols file. For iOS and Mac provide path to app.dSYM.zip",
50
+ default_value: Actions.lane_context[SharedValues::DSYM_OUTPUT_PATH],
51
+ optional: true,
52
+ verify_block: proc do |value|
53
+ UI.user_error! "Could not find Path to your symbols file at path '#{value}'" unless File.exist?(value)
54
+ end),
56
55
  FastlaneCore::ConfigItem.new(key: :dsym_paths,
57
56
  env_name: "SENTRY_DSYM_PATHS",
58
57
  description: "Path to an array of your symbols file. For iOS and Mac provide path to app.dSYM.zip",
@@ -60,19 +59,19 @@ module Fastlane
60
59
  is_string: false,
61
60
  optional: true),
62
61
  FastlaneCore::ConfigItem.new(key: :symbol_maps,
63
- env_name: "SENTRY_SYMBOL_MAPS",
64
- description: "Optional path to bcsymbolmap files which are used to resolve hidden symbols in the actual dsym files. This requires the dsymutil tool to be available",
65
- optional: true,
66
- verify_block: proc do |value|
67
- UI.user_error! "Could not find bcsymbolmap at path '#{value}'" unless File.exist?(value)
68
- end),
62
+ env_name: "SENTRY_SYMBOL_MAPS",
63
+ description: "Optional path to bcsymbolmap files which are used to resolve hidden symbols in the actual dsym files. This requires the dsymutil tool to be available",
64
+ optional: true,
65
+ verify_block: proc do |value|
66
+ UI.user_error! "Could not find bcsymbolmap at path '#{value}'" unless File.exist?(value)
67
+ end),
69
68
  FastlaneCore::ConfigItem.new(key: :info_plist,
70
- env_name: "SENTRY_INFO_PLIST",
71
- description: "Optional path to Info.plist to add version information when uploading debug symbols",
72
- optional: true,
73
- verify_block: proc do |value|
74
- UI.user_error! "Could not find Info.plist at path '#{value}'" unless File.exist?(value)
75
- end)
69
+ env_name: "SENTRY_INFO_PLIST",
70
+ description: "Optional path to Info.plist to add version information when uploading debug symbols",
71
+ optional: true,
72
+ verify_block: proc do |value|
73
+ UI.user_error! "Could not find Info.plist at path '#{value}'" unless File.exist?(value)
74
+ end)
76
75
  ]
77
76
  end
78
77
 
@@ -4,7 +4,6 @@ module Fastlane
4
4
  def self.run(params)
5
5
  require 'shellwords'
6
6
 
7
- Helper::SentryHelper.check_sentry_cli!
8
7
  Helper::SentryConfig.parse_api_params(params)
9
8
 
10
9
  version = params[:version]
@@ -14,7 +13,6 @@ module Fastlane
14
13
  file = params[:file]
15
14
 
16
15
  command = [
17
- "sentry-cli",
18
16
  "releases",
19
17
  "files",
20
18
  version,
@@ -24,7 +22,7 @@ module Fastlane
24
22
  command.push(params[:file_url]) unless params[:file_url].nil?
25
23
  command.push("--dist").push(params[:dist]) unless params[:dist].nil?
26
24
 
27
- Helper::SentryHelper.call_sentry_cli(command)
25
+ Helper::SentryHelper.call_sentry_cli(params, command)
28
26
  UI.success("Successfully uploaded files to release: #{version}")
29
27
  end
30
28
 
@@ -48,14 +46,14 @@ module Fastlane
48
46
  FastlaneCore::ConfigItem.new(key: :version,
49
47
  description: "Release version on Sentry"),
50
48
  FastlaneCore::ConfigItem.new(key: :app_identifier,
51
- short_option: "-a",
52
- env_name: "SENTRY_APP_IDENTIFIER",
53
- description: "App Bundle Identifier, prepended to version",
54
- optional: true),
49
+ short_option: "-a",
50
+ env_name: "SENTRY_APP_IDENTIFIER",
51
+ description: "App Bundle Identifier, prepended to version",
52
+ optional: true),
55
53
  FastlaneCore::ConfigItem.new(key: :build,
56
- short_option: "-b",
57
- description: "Release build on Sentry",
58
- optional: true),
54
+ short_option: "-b",
55
+ description: "Release build on Sentry",
56
+ optional: true),
59
57
  FastlaneCore::ConfigItem.new(key: :dist,
60
58
  description: "Distribution in release",
61
59
  optional: true),
@@ -2,7 +2,6 @@ module Fastlane
2
2
  module Actions
3
3
  class SentryUploadProguardAction < Action
4
4
  def self.run(params)
5
- Helper::SentryHelper.check_sentry_cli!
6
5
  Helper::SentryConfig.parse_api_params(params)
7
6
 
8
7
  # Params - mapping & manifest
@@ -14,14 +13,13 @@ module Fastlane
14
13
  UI.user_error!("AndroidManifest.xml file does not exist at path: #{android_manifest_path}") unless File.exist? android_manifest_path
15
14
 
16
15
  command = [
17
- "sentry-cli",
18
16
  "upload-proguard",
19
17
  "--android-manifest",
20
18
  android_manifest_path,
21
19
  mapping_path
22
20
  ]
23
21
 
24
- Helper::SentryHelper.call_sentry_cli(command)
22
+ Helper::SentryHelper.call_sentry_cli(params, command)
25
23
  UI.success("Successfully uploaded mapping file!")
26
24
  end
27
25
 
@@ -43,19 +41,19 @@ module Fastlane
43
41
  def self.available_options
44
42
  Helper::SentryConfig.common_api_config_items + [
45
43
  FastlaneCore::ConfigItem.new(key: :mapping_path,
46
- env_name: "ANDROID_MAPPING_PATH",
47
- description: "Path to your proguard mapping.txt file",
48
- optional: false,
49
- verify_block: proc do |value|
50
- UI.user_error! "Could not find your mapping file at path '#{value}'" unless File.exist?(value)
51
- end),
44
+ env_name: "ANDROID_MAPPING_PATH",
45
+ description: "Path to your proguard mapping.txt file",
46
+ optional: false,
47
+ verify_block: proc do |value|
48
+ UI.user_error! "Could not find your mapping file at path '#{value}'" unless File.exist?(value)
49
+ end),
52
50
  FastlaneCore::ConfigItem.new(key: :android_manifest_path,
53
- env_name: "ANDROID_MANIFEST_PATH",
54
- description: "Path to your merged AndroidManifest file. This is usually found under `app/build/intermediates/manifests/full`",
55
- optional: false,
56
- verify_block: proc do |value|
57
- UI.user_error! "Could not find your merged AndroidManifest file at path '#{value}'" unless File.exist?(value)
58
- end)
51
+ env_name: "ANDROID_MANIFEST_PATH",
52
+ description: "Path to your merged AndroidManifest file. This is usually found under `app/build/intermediates/manifests/full`",
53
+ optional: false,
54
+ verify_block: proc do |value|
55
+ UI.user_error! "Could not find your merged AndroidManifest file at path '#{value}'" unless File.exist?(value)
56
+ end)
59
57
  ]
60
58
  end
61
59
 
@@ -4,7 +4,6 @@ module Fastlane
4
4
  def self.run(params)
5
5
  require 'shellwords'
6
6
 
7
- Helper::SentryHelper.check_sentry_cli!
8
7
  Helper::SentryConfig.parse_api_params(params)
9
8
 
10
9
  version = params[:version]
@@ -14,7 +13,6 @@ module Fastlane
14
13
  sourcemap = params[:sourcemap]
15
14
 
16
15
  command = [
17
- "sentry-cli",
18
16
  "releases",
19
17
  "files",
20
18
  version,
@@ -35,13 +33,17 @@ module Fastlane
35
33
  params[:ignore] = [params[:ignore]]
36
34
  end
37
35
  # no nil or empty strings
38
- params[:ignore].reject! { |e| e.strip.empty? rescue true }
36
+ params[:ignore].reject! do |e|
37
+ e.strip.empty?
38
+ rescue StandardError
39
+ true
40
+ end
39
41
  command.push('--ignore').push(*params[:ignore]) if params[:ignore].any?
40
42
  end
41
43
 
42
44
  command.push('--ignore-file').push(params[:ignore_file]) unless params[:ignore_file].nil?
43
45
 
44
- Helper::SentryHelper.call_sentry_cli(command)
46
+ Helper::SentryHelper.call_sentry_cli(params, command)
45
47
  UI.success("Successfully uploaded files to release: #{version}")
46
48
  end
47
49
 
@@ -70,9 +72,9 @@ module Fastlane
70
72
  description: "App Bundle Identifier, prepended to version",
71
73
  optional: true),
72
74
  FastlaneCore::ConfigItem.new(key: :build,
73
- short_option: "-b",
74
- description: "Release build on Sentry",
75
- optional: true),
75
+ short_option: "-b",
76
+ description: "Release build on Sentry",
77
+ optional: true),
76
78
  FastlaneCore::ConfigItem.new(key: :dist,
77
79
  description: "Distribution in release",
78
80
  optional: true),
@@ -108,7 +110,6 @@ module Fastlane
108
110
  FastlaneCore::ConfigItem.new(key: :ignore_file,
109
111
  description: "Ignore all files and folders specified in the given ignore file, e.g. .gitignore",
110
112
  optional: true)
111
-
112
113
  ]
113
114
  end
114
115
 
@@ -1,6 +1,18 @@
1
1
  module Fastlane
2
2
  module Helper
3
3
  class SentryConfig
4
+ def self.common_cli_config_items
5
+ [
6
+ FastlaneCore::ConfigItem.new(key: :sentry_cli_path,
7
+ env_name: "SENTRY_CLI_PATH",
8
+ description: "Path to your sentry-cli. Defaults to `which sentry-cli`",
9
+ optional: true,
10
+ verify_block: proc do |value|
11
+ UI.user_error! "'#{value}' is not executable" unless FastlaneCore::Helper.executable?(value)
12
+ end)
13
+ ]
14
+ end
15
+
4
16
  def self.common_api_config_items
5
17
  [
6
18
  FastlaneCore::ConfigItem.new(key: :url,
@@ -24,7 +36,7 @@ module Fastlane
24
36
  env_name: "SENTRY_PROJECT_SLUG",
25
37
  description: "Project slug for Sentry",
26
38
  optional: true)
27
- ]
39
+ ] + self.common_cli_config_items
28
40
  end
29
41
 
30
42
  def self.parse_api_params(params)
@@ -45,8 +57,8 @@ module Fastlane
45
57
  ENV['SENTRY_LOG_LEVEL'] = 'DEBUG' if FastlaneCore::Globals.verbose?
46
58
 
47
59
  # Fallback to .sentryclirc if possible when no auth token is provided
48
- if !has_api_key && !has_auth_token && fallback_sentry_cli_auth
49
- UI.important("No auth config provided, will fallback to .sentryclirc")
60
+ if !has_api_key && !has_auth_token && fallback_sentry_cli_auth(params)
61
+ UI.important("No auth config provided, will fallback to .sentryclirc")
50
62
  else
51
63
  # Will fail if none or both authentication methods are provided
52
64
  if !has_api_key && !has_auth_token
@@ -68,8 +80,14 @@ module Fastlane
68
80
  end
69
81
  end
70
82
 
71
- def self.fallback_sentry_cli_auth
72
- sentry_cli_result = JSON.parse(`sentry-cli info --config-status-json`)
83
+ def self.fallback_sentry_cli_auth(params)
84
+ sentry_cli_result = JSON.parse(SentryHelper.call_sentry_cli(
85
+ params,
86
+ [
87
+ "info",
88
+ "--config-status-json"
89
+ ]
90
+ ))
73
91
  return (sentry_cli_result["auth"]["successful"] &&
74
92
  !sentry_cli_result["auth"]["type"].nil?)
75
93
  end
@@ -1,8 +1,9 @@
1
1
  module Fastlane
2
2
  module Helper
3
3
  class SentryHelper
4
- def self.check_sentry_cli!
5
- unless `which sentry-cli`.include?('sentry-cli')
4
+ def self.find_and_check_sentry_cli_path!(params)
5
+ sentry_path = params[:sentry_cli_path] || FastlaneCore::CommandExecutor.which('sentry-cli')
6
+ if sentry_path.nil?
6
7
  UI.error("You have to install sentry-cli version #{Fastlane::Sentry::CLI_VERSION} to use this plugin")
7
8
  UI.error("")
8
9
  UI.error("Install it using:")
@@ -13,27 +14,33 @@ module Fastlane
13
14
  UI.user_error!("Install sentry-cli and start your lane again!")
14
15
  end
15
16
 
16
- sentry_cli_version = Gem::Version.new(`sentry-cli --version`.scan(/(?:\d+\.?){3}/).first)
17
+ sentry_cli_version = Gem::Version.new(`#{sentry_path} --version`.scan(/(?:\d+\.?){3}/).first)
18
+
17
19
  required_version = Gem::Version.new(Fastlane::Sentry::CLI_VERSION)
18
20
  if sentry_cli_version < required_version
19
21
  UI.user_error!("Your sentry-cli is outdated, please upgrade to at least version #{Fastlane::Sentry::CLI_VERSION} and start your lane again!")
20
22
  end
21
23
 
22
24
  UI.success("sentry-cli #{sentry_cli_version} installed!")
25
+ sentry_path
23
26
  end
24
27
 
25
- def self.call_sentry_cli(command)
28
+ def self.call_sentry_cli(params, sub_command)
29
+ sentry_path = self.find_and_check_sentry_cli_path!(params)
30
+ command = [sentry_path] + sub_command
26
31
  UI.message "Starting sentry-cli..."
27
32
  require 'open3'
28
- error = []
29
33
  if FastlaneCore::Globals.verbose?
30
34
  UI.verbose("sentry-cli command:\n\n")
31
35
  UI.command(command.to_s)
32
36
  UI.verbose("\n\n")
33
37
  end
34
38
  final_command = command.map { |arg| Shellwords.escape(arg) }.join(" ")
39
+ out = []
40
+ error = []
35
41
  Open3.popen3(final_command) do |stdin, stdout, stderr, wait_thr|
36
42
  while (line = stdout.gets)
43
+ out << line
37
44
  UI.message(line.strip!)
38
45
  end
39
46
  while (line = stderr.gets)
@@ -44,6 +51,7 @@ module Fastlane
44
51
  handle_error(error)
45
52
  end
46
53
  end
54
+ out.join
47
55
  end
48
56
 
49
57
  def self.handle_error(errors)
@@ -1,6 +1,6 @@
1
1
  module Fastlane
2
2
  module Sentry
3
- VERSION = "1.11.1"
3
+ VERSION = "1.12.0"
4
4
  CLI_VERSION = "1.72.0"
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-sentry
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.11.1
4
+ version: 1.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sentry
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-25 00:00:00.000000000 Z
11
+ date: 2022-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: pry
14
+ name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
@@ -25,21 +25,21 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: bundler
28
+ name: fastlane
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: 2.10.0
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: 2.10.0
41
41
  - !ruby/object:Gem::Dependency
42
- name: rspec
42
+ name: pry
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
@@ -53,7 +53,7 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: rubocop
56
+ name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - ">="
@@ -67,19 +67,19 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: fastlane
70
+ name: rubocop
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: 2.10.0
75
+ version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: 2.10.0
82
+ version: '0'
83
83
  description:
84
84
  email: hello@sentry.io
85
85
  executables: []
@@ -114,7 +114,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - ">="
116
116
  - !ruby/object:Gem::Version
117
- version: '0'
117
+ version: 2.5.0
118
118
  required_rubygems_version: !ruby/object:Gem::Requirement
119
119
  requirements:
120
120
  - - ">="