fastlane-plugin-bugsnag 2.2.1 → 2.3.1

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: 9db2dd9937b3d36dfd9e9ec8d8d49e22e9fc5bb4e9450adcbc0b76dfa301ebee
4
- data.tar.gz: 87dc97643eaa14270da1eda4fe8d8028f24bccc60afc1180e9490bc7a51a2d1b
3
+ metadata.gz: ee3c60f5a8e31661e3a0e828b3e792535c6b31088924f48a25f8ae935e982986
4
+ data.tar.gz: 77589505109ad61b5bc91d19bfa07ff7b79f7b0a910fe7c84ebd311bdb8b8b99
5
5
  SHA512:
6
- metadata.gz: 3cef53d8d700b3ead9b320c57df1616c3bd5d3f8b349e9cec806b7dda5a3449be146b2eebf3983acc2e6e6011c721752d386c830efc8a639f8c112c32b037052
7
- data.tar.gz: 3c44e6932d491420bcf7a715f3d3d91bfadeae5bd48bea179085f02a4b87539ae1d33f731f28bed061dd8512b1cba82e489b0caf1150acff71ffc699a6f24ba7
6
+ metadata.gz: 23c3d24f139d1a5249a74419bce45ac37beb6e24e94793cce45ccaf1df74ba4056f68d36b1af743cb6a9e9a3293119b8c48f9543784edcd3edbf11656f9a3093
7
+ data.tar.gz: d4dba2b84a6feb931045c5777928f76c29b472206d6c1e886b5a332c32d6e9c6acec7b3ce96b23d7b7df48754a69973bc7e5d1754d279ed9cab53436c897763d
@@ -0,0 +1,7 @@
1
+ class FindInfoPlist
2
+ def self.default_info_plist_path
3
+ # Find first 'Info.plist' in the current working directory
4
+ # ignoring any in 'build', or 'test' folders
5
+ return Dir.glob("./{ios/,}*/Info.plist").reject{|path| path =~ /build|test/i }.sort.first
6
+ end
7
+ end
@@ -1,5 +1,6 @@
1
1
  require "xmlsimple"
2
2
  require "json"
3
+ require_relative "find_info_plist_path"
3
4
 
4
5
  module Fastlane
5
6
  module Actions
@@ -38,6 +39,9 @@ module Fastlane
38
39
  payload[:sourceControl][:repository] = params[:repository] if params[:repository]
39
40
  payload[:sourceControl][:provider] = params[:provider] if params[:provider]
40
41
 
42
+ # If provided apply metadata to payload.
43
+ payload[:metadata] = params[:metadata]
44
+
41
45
  payload.reject! {|k,v| v == nil || (v.is_a?(Hash) && v.empty?)}
42
46
 
43
47
  if payload[:apiKey].nil? || !payload[:apiKey].is_a?(String)
@@ -167,7 +171,12 @@ module Fastlane
167
171
  FastlaneCore::ConfigItem.new(key: :endpoint,
168
172
  description: "Bugsnag deployment endpoint",
169
173
  optional: true,
170
- default_value: "https://build.bugsnag.com")
174
+ default_value: "https://build.bugsnag.com"),
175
+ FastlaneCore::ConfigItem.new(key: :metadata,
176
+ description: "Metadata",
177
+ optional:true,
178
+ type: Object,
179
+ default_value: nil)
171
180
  ]
172
181
  end
173
182
 
@@ -196,7 +205,7 @@ module Fastlane
196
205
  when nil
197
206
  if file_path = default_android_manifest_path
198
207
  return file_path
199
- elsif file_path = default_info_plist_path
208
+ elsif file_path = FindInfoPlist.default_info_plist_path
200
209
  return file_path
201
210
  end
202
211
  when :android
@@ -204,7 +213,7 @@ module Fastlane
204
213
  return file_path
205
214
  end
206
215
  else
207
- if file_path = default_info_plist_path
216
+ if file_path = FindInfoPlist.default_info_plist_path
208
217
  return file_path
209
218
  end
210
219
  end
@@ -224,10 +233,6 @@ module Fastlane
224
233
  end
225
234
  end
226
235
 
227
- def self.default_info_plist_path
228
- Dir.glob("./{ios/,}*/Info.plist").reject {|path| path =~ /build|test/i }.sort.first
229
- end
230
-
231
236
  def self.load_options_from_plist file_path
232
237
  options = {}
233
238
  plist_getter = Fastlane::Actions::GetInfoPlistValueAction
@@ -319,7 +324,7 @@ module Fastlane
319
324
  nil
320
325
  end
321
326
  end
322
-
327
+
323
328
  def self.send_notification(url, body)
324
329
  require "net/http"
325
330
  uri = URI.parse(url)
@@ -1,3 +1,5 @@
1
+ require_relative "find_info_plist_path"
2
+
1
3
  module Fastlane
2
4
  module Actions
3
5
  class UploadSymbolsToBugsnagAction < Action
@@ -56,7 +58,7 @@ module Fastlane
56
58
  end
57
59
 
58
60
  def self.is_supported?(platform)
59
- [:ios, :mac, :tvos].include?(platform)
61
+ [:ios, :mac, :tvos, :catalyst].include?(platform)
60
62
  end
61
63
 
62
64
  def self.available_options
@@ -131,18 +133,12 @@ module Fastlane
131
133
  env_name: "BUGSNAG_CONFIG_FILE",
132
134
  description: "Info.plist location",
133
135
  optional: true,
134
- default_value: default_info_plist_path)
136
+ default_value: FindInfoPlist.default_info_plist_path)
135
137
  ]
136
138
  end
137
139
 
138
140
  private
139
141
 
140
- def self.default_info_plist_path
141
- # Find first 'Info.plist' in the current working directory
142
- # ignoring any in 'build', or 'test' folders
143
- return Dir.glob("./{ios/,}*/Info.plist").reject{|path| path =~ /build|test/i }.sort.first
144
- end
145
-
146
142
  def self.options_from_info_plist file_path
147
143
  plist_getter = Fastlane::Actions::GetInfoPlistValueAction
148
144
  bugsnag_dict = plist_getter.run(path: file_path, key: "bugsnag")
@@ -211,4 +207,4 @@ module Fastlane
211
207
  end
212
208
  end
213
209
  end
214
- end
210
+ end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Bugsnag
3
- VERSION = "2.2.1"
3
+ VERSION = "2.3.1"
4
4
  end
5
5
  end
@@ -121,5 +121,41 @@ describe BuildAction do
121
121
  end
122
122
  end
123
123
  end
124
+
125
+ context 'metadata added to payload' do
126
+ it "single key:value pair added" do
127
+ expect(BuildAction).to receive(:send_notification) do |url, body|
128
+ payload = ::JSON.load(body)
129
+ expect(payload['appVersion']).to eq '4.0-project'
130
+ expect(payload['apiKey']).to eq '12345678901234567890123456789DDD'
131
+ expect(payload['metadata']).to eq '"test1": "First test"'
132
+ end
133
+
134
+ Dir.chdir(File.join(FIXTURE_PATH, 'ios_proj')) do
135
+ run_with({
136
+ app_version: '4.0-project',
137
+ api_key: '12345678901234567890123456789DDD',
138
+ metadata: '"test1": "First test"'
139
+ })
140
+ end
141
+ end
142
+
143
+ it "multiple key:value pairs added" do
144
+ expect(BuildAction).to receive(:send_notification) do |url, body|
145
+ payload = ::JSON.load(body)
146
+ expect(payload['appVersion']).to eq '4.0-project'
147
+ expect(payload['apiKey']).to eq '12345678901234567890123456789DDD'
148
+ expect(payload['metadata']).to eq '"test1": "First test", "test2": "Second test", "test3": "Third test"'
149
+ end
150
+
151
+ Dir.chdir(File.join(FIXTURE_PATH, 'ios_proj')) do
152
+ run_with({
153
+ app_version: '4.0-project',
154
+ api_key: '12345678901234567890123456789DDD',
155
+ metadata: '"test1": "First test", "test2": "Second test", "test3": "Third test"'
156
+ })
157
+ end
158
+ end
159
+ end
124
160
  end
125
161
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-bugsnag
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.1
4
+ version: 2.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Delisa Mason
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-19 00:00:00.000000000 Z
11
+ date: 2024-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xml-simple
@@ -136,7 +136,7 @@ dependencies:
136
136
  - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: 2.28.5
139
- description:
139
+ description:
140
140
  email: iskanamagus@gmail.com
141
141
  executables: []
142
142
  extensions: []
@@ -145,6 +145,7 @@ files:
145
145
  - LICENSE.txt
146
146
  - bugsnag-dsym-upload
147
147
  - lib/fastlane/plugin/bugsnag.rb
148
+ - lib/fastlane/plugin/bugsnag/actions/find_info_plist_path.rb
148
149
  - lib/fastlane/plugin/bugsnag/actions/send_build_to_bugsnag.rb
149
150
  - lib/fastlane/plugin/bugsnag/actions/upload_symbols_to_bugsnag.rb
150
151
  - lib/fastlane/plugin/bugsnag/version.rb
@@ -167,7 +168,7 @@ homepage: https://github.com/bugsnag/bugsnag-dsym-upload
167
168
  licenses:
168
169
  - MIT
169
170
  metadata: {}
170
- post_install_message:
171
+ post_install_message:
171
172
  rdoc_options: []
172
173
  require_paths:
173
174
  - lib
@@ -182,8 +183,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
182
183
  - !ruby/object:Gem::Version
183
184
  version: '0'
184
185
  requirements: []
185
- rubygems_version: 3.0.3
186
- signing_key:
186
+ rubygems_version: 3.4.18
187
+ signing_key:
187
188
  specification_version: 4
188
189
  summary: Uploads dSYM files to Bugsnag
189
190
  test_files: