fastlane 2.194.0 → 2.195.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +84 -84
  3. data/fastlane/lib/fastlane/actions/gradle.rb +15 -2
  4. data/fastlane/lib/fastlane/actions/last_git_commit.rb +1 -1
  5. data/fastlane/lib/fastlane/actions/prompt.rb +1 -1
  6. data/fastlane/lib/fastlane/version.rb +1 -1
  7. data/fastlane/swift/Deliverfile.swift +1 -1
  8. data/fastlane/swift/DeliverfileProtocol.swift +1 -1
  9. data/fastlane/swift/Fastlane.swift +38 -67
  10. data/fastlane/swift/Gymfile.swift +1 -1
  11. data/fastlane/swift/GymfileProtocol.swift +1 -1
  12. data/fastlane/swift/Matchfile.swift +1 -1
  13. data/fastlane/swift/MatchfileProtocol.swift +9 -1
  14. data/fastlane/swift/Precheckfile.swift +1 -1
  15. data/fastlane/swift/PrecheckfileProtocol.swift +1 -1
  16. data/fastlane/swift/Scanfile.swift +1 -1
  17. data/fastlane/swift/ScanfileProtocol.swift +1 -1
  18. data/fastlane/swift/Screengrabfile.swift +1 -1
  19. data/fastlane/swift/ScreengrabfileProtocol.swift +1 -1
  20. data/fastlane/swift/Snapshotfile.swift +1 -1
  21. data/fastlane/swift/SnapshotfileProtocol.swift +2 -2
  22. data/fastlane/swift/formatting/Brewfile.lock.json +3 -3
  23. data/match/lib/match/generator.rb +2 -1
  24. data/match/lib/match/options.rb +10 -0
  25. data/match/lib/match/runner.rb +94 -10
  26. data/sigh/lib/sigh/options.rb +5 -0
  27. data/sigh/lib/sigh/runner.rb +2 -2
  28. data/snapshot/lib/snapshot/options.rb +1 -1
  29. data/snapshot/lib/snapshot/simulator_launchers/simulator_launcher_base.rb +7 -0
  30. metadata +21 -24
  31. data/fastlane/lib/fastlane/actions/.notarize.rb.swp +0 -0
  32. data/fastlane/lib/fastlane/actions/crashlytics.rb +0 -207
  33. data/fastlane/lib/fastlane/helper/crashlytics_helper.rb +0 -157
@@ -196,4 +196,4 @@ public extension GymfileProtocol {
196
196
 
197
197
  // Please don't remove the lines below
198
198
  // They are used to detect outdated files
199
- // FastlaneRunnerAPIVersion [0.9.86]
199
+ // FastlaneRunnerAPIVersion [0.9.87]
@@ -17,4 +17,4 @@ public class Matchfile: MatchfileProtocol {
17
17
  // during the `init` process, and you won't see this message
18
18
  }
19
19
 
20
- // Generated with fastlane 2.194.0
20
+ // Generated with fastlane 2.195.0
@@ -101,6 +101,12 @@ public protocol MatchfileProtocol: class {
101
101
  /// Renew the provisioning profiles if the device count on the developer portal has changed. Ignored for profile types 'appstore' and 'developer_id'
102
102
  var forceForNewDevices: Bool { get }
103
103
 
104
+ /// Include all matching certificates in the provisioning profile. Works only for the 'development' provisioning profile type
105
+ var includeAllCertificates: Bool { get }
106
+
107
+ /// Renew the provisioning profiles if the device count on the developer portal has changed. Works only for the 'development' provisioning profile type. Requires 'include_all_certificates' option to be 'true'
108
+ var forceForNewCertificates: Bool { get }
109
+
104
110
  /// Disables confirmation prompts during nuke, answering them with yes
105
111
  var skipConfirmation: Bool { get }
106
112
 
@@ -169,6 +175,8 @@ public extension MatchfileProtocol {
169
175
  var keychainPassword: String? { return nil }
170
176
  var force: Bool { return false }
171
177
  var forceForNewDevices: Bool { return false }
178
+ var includeAllCertificates: Bool { return false }
179
+ var forceForNewCertificates: Bool { return false }
172
180
  var skipConfirmation: Bool { return false }
173
181
  var skipDocs: Bool { return false }
174
182
  var platform: String { return "ios" }
@@ -184,4 +192,4 @@ public extension MatchfileProtocol {
184
192
 
185
193
  // Please don't remove the lines below
186
194
  // They are used to detect outdated files
187
- // FastlaneRunnerAPIVersion [0.9.80]
195
+ // FastlaneRunnerAPIVersion [0.9.81]
@@ -17,4 +17,4 @@ public class Precheckfile: PrecheckfileProtocol {
17
17
  // during the `init` process, and you won't see this message
18
18
  }
19
19
 
20
- // Generated with fastlane 2.194.0
20
+ // Generated with fastlane 2.195.0
@@ -52,4 +52,4 @@ public extension PrecheckfileProtocol {
52
52
 
53
53
  // Please don't remove the lines below
54
54
  // They are used to detect outdated files
55
- // FastlaneRunnerAPIVersion [0.9.79]
55
+ // FastlaneRunnerAPIVersion [0.9.80]
@@ -17,4 +17,4 @@ public class Scanfile: ScanfileProtocol {
17
17
  // during the `init` process, and you won't see this message
18
18
  }
19
19
 
20
- // Generated with fastlane 2.194.0
20
+ // Generated with fastlane 2.195.0
@@ -296,4 +296,4 @@ public extension ScanfileProtocol {
296
296
 
297
297
  // Please don't remove the lines below
298
298
  // They are used to detect outdated files
299
- // FastlaneRunnerAPIVersion [0.9.91]
299
+ // FastlaneRunnerAPIVersion [0.9.92]
@@ -17,4 +17,4 @@ public class Screengrabfile: ScreengrabfileProtocol {
17
17
  // during the `init` process, and you won't see this message
18
18
  }
19
19
 
20
- // Generated with fastlane 2.194.0
20
+ // Generated with fastlane 2.195.0
@@ -96,4 +96,4 @@ public extension ScreengrabfileProtocol {
96
96
 
97
97
  // Please don't remove the lines below
98
98
  // They are used to detect outdated files
99
- // FastlaneRunnerAPIVersion [0.9.81]
99
+ // FastlaneRunnerAPIVersion [0.9.82]
@@ -17,4 +17,4 @@ public class Snapshotfile: SnapshotfileProtocol {
17
17
  // during the `init` process, and you won't see this message
18
18
  }
19
19
 
20
- // Generated with fastlane 2.194.0
20
+ // Generated with fastlane 2.195.0
@@ -50,7 +50,7 @@ public protocol SnapshotfileProtocol: class {
50
50
  /// Enabling this option will prevent displaying the simulator window
51
51
  var headless: Bool { get }
52
52
 
53
- /// Enabling this option will automatically override the status bar to show 9:41 AM, full battery, and full reception
53
+ /// Enabling this option will automatically override the status bar to show 9:41 AM, full battery, and full reception (Adjust 'SNAPSHOT_SIMULATOR_WAIT_FOR_BOOT_TIMEOUT' environment variable if override status bar is not working. Might be because simulator is not fully booted. Defaults to 10 seconds)
54
54
  var overrideStatusBar: Bool { get }
55
55
 
56
56
  /// Fully customize the status bar by setting each option here. See `xcrun simctl status_bar --help`
@@ -200,4 +200,4 @@ public extension SnapshotfileProtocol {
200
200
 
201
201
  // Please don't remove the lines below
202
202
  // They are used to detect outdated files
203
- // FastlaneRunnerAPIVersion [0.9.75]
203
+ // FastlaneRunnerAPIVersion [0.9.76]
@@ -51,11 +51,11 @@
51
51
  "macOS": "11.5.2"
52
52
  },
53
53
  "monterey": {
54
- "HOMEBREW_VERSION": "3.2.12-9-gb19fcef",
54
+ "HOMEBREW_VERSION": "3.2.13-55-ga6959e4",
55
55
  "HOMEBREW_PREFIX": "/usr/local",
56
- "Homebrew/homebrew-core": "e79d8126370187be3bd7be6bdbffacf803732113",
56
+ "Homebrew/homebrew-core": "3fb109275770551bba03c7055d75ceec2c38b1b2",
57
57
  "CLT": "13.0.0.0.1.1628499445",
58
- "Xcode": "12.5.1",
58
+ "Xcode": "13.0",
59
59
  "macOS": "12.0"
60
60
  }
61
61
  }
@@ -88,7 +88,8 @@ module Match
88
88
  team_id: params[:team_id],
89
89
  team_name: params[:team_name],
90
90
  template_name: params[:template_name],
91
- fail_on_name_taken: params[:fail_on_name_taken]
91
+ fail_on_name_taken: params[:fail_on_name_taken],
92
+ include_all_certificates: params[:include_all_certificates],
92
93
  }
93
94
 
94
95
  values[:platform] = params[:platform]
@@ -242,6 +242,16 @@ module Match
242
242
  description: "Renew the provisioning profiles if the device count on the developer portal has changed. Ignored for profile types 'appstore' and 'developer_id'",
243
243
  type: Boolean,
244
244
  default_value: false),
245
+ FastlaneCore::ConfigItem.new(key: :include_all_certificates,
246
+ env_name: "MATCH_INCLUDE_ALL_CERTIFICATES",
247
+ description: "Include all matching certificates in the provisioning profile. Works only for the 'development' provisioning profile type",
248
+ type: Boolean,
249
+ default_value: false),
250
+ FastlaneCore::ConfigItem.new(key: :force_for_new_certificates,
251
+ env_name: "MATCH_FORCE_FOR_NEW_CERTIFICATES",
252
+ description: "Renew the provisioning profiles if the device count on the developer portal has changed. Works only for the 'development' provisioning profile type. Requires 'include_all_certificates' option to be 'true'",
253
+ type: Boolean,
254
+ default_value: false),
245
255
  FastlaneCore::ConfigItem.new(key: :skip_confirmation,
246
256
  env_name: "MATCH_SKIP_CONFIRMATION",
247
257
  description: "Disables confirmation prompts during nuke, answering them with yes",
@@ -12,6 +12,7 @@ require_relative 'storage'
12
12
  require_relative 'encryption'
13
13
 
14
14
  module Match
15
+ # rubocop:disable Metrics/ClassLength
15
16
  class Runner
16
17
  attr_accessor :files_to_commit
17
18
  attr_accessor :spaceship
@@ -242,16 +243,14 @@ module Match
242
243
  profile = profiles.last
243
244
  force = params[:force]
244
245
 
245
- if params[:force_for_new_devices] && !params[:readonly]
246
- prov_types_without_devices = [:appstore, :developer_id]
247
- if !prov_types_without_devices.include?(prov_type) && !params[:force]
248
- force = device_count_different?(profile: profile, keychain_path: keychain_path, platform: params[:platform].to_sym)
249
- else
250
- # App Store provisioning profiles don't contain device identifiers and
251
- # thus shouldn't be renewed if the device count has changed.
252
- UI.important("Warning: `force_for_new_devices` is set but is ignored for App Store & Developer ID provisioning profiles.")
253
- UI.important("You can safely stop specifying `force_for_new_devices` when running Match for type 'appstore' or 'developer_id'.")
254
- end
246
+ if params[:force_for_new_devices]
247
+ force = should_force_include_all_devices(params: params, prov_type: prov_type, profile: profile, keychain_path: keychain_path) unless force
248
+ end
249
+
250
+ if params[:include_all_certificates]
251
+ # Clearing specified certificate id which will prevent a profile being created with only one certificate
252
+ certificate_id = nil
253
+ force = should_force_include_all_certificates(params: params, prov_type: prov_type, profile: profile, keychain_path: keychain_path) unless force
255
254
  end
256
255
 
257
256
  if profile.nil? || force
@@ -319,6 +318,24 @@ module Match
319
318
  end
320
319
  # rubocop:enable Metrics/PerceivedComplexity
321
320
 
321
+ def should_force_include_all_devices(params: nil, prov_type: nil, profile: nil, keychain_path: nil)
322
+ return false unless params[:force_for_new_devices] && !params[:readonly]
323
+
324
+ force = false
325
+
326
+ prov_types_without_devices = [:appstore, :developer_id]
327
+ if !prov_types_without_devices.include?(prov_type) && !params[:force]
328
+ force = device_count_different?(profile: profile, keychain_path: keychain_path, platform: params[:platform].to_sym)
329
+ else
330
+ # App Store provisioning profiles don't contain device identifiers and
331
+ # thus shouldn't be renewed if the device count has changed.
332
+ UI.important("Warning: `force_for_new_devices` is set but is ignored for App Store & Developer ID provisioning profiles.")
333
+ UI.important("You can safely stop specifying `force_for_new_devices` when running Match for type 'appstore' or 'developer_id'.")
334
+ end
335
+
336
+ return force
337
+ end
338
+
322
339
  def device_count_different?(profile: nil, keychain_path: nil, platform: nil)
323
340
  return false unless profile
324
341
 
@@ -365,5 +382,72 @@ module Match
365
382
  end
366
383
  return false
367
384
  end
385
+
386
+ def should_force_include_all_certificates(params: nil, prov_type: nil, profile: nil, keychain_path: nil)
387
+ unless params[:include_all_certificates]
388
+ if params[:force_for_new_certificates]
389
+ UI.important("You specified 'force_for_new_certificates: true', but new certificates will not be added, cause 'include_all_certificates' is 'false'")
390
+ end
391
+ return false
392
+ end
393
+
394
+ force = false
395
+
396
+ if params[:force_for_new_certificates] && !params[:readonly]
397
+ if prov_type == :development && !params[:force]
398
+ force = certificate_count_different?(profile: profile, keychain_path: keychain_path, platform: params[:platform].to_sym)
399
+ else
400
+ # All other (not development) provisioning profiles don't contain
401
+ # multiple certificates, thus shouldn't be renewed
402
+ # if the certificates count has changed.
403
+ UI.important("Warning: `force_for_new_certificates` is set but is ignored for non-'development' provisioning profiles.")
404
+ UI.important("You can safely stop specifying `force_for_new_certificates` when running Match for '#{prov_type}' provisioning profiles.")
405
+ end
406
+ end
407
+
408
+ return force
409
+ end
410
+
411
+ def certificate_count_different?(profile: nil, keychain_path: nil, platform: nil)
412
+ return false unless profile
413
+
414
+ parsed = FastlaneCore::ProvisioningProfile.parse(profile, keychain_path)
415
+ uuid = parsed["UUID"]
416
+
417
+ all_profiles = Spaceship::ConnectAPI::Profile.all(includes: "certificates")
418
+ portal_profile = all_profiles.detect { |i| i.uuid == uuid }
419
+
420
+ return false unless portal_profile
421
+
422
+ profile_certs_count = portal_profile.fetch_all_certificates.count
423
+
424
+ certificate_types =
425
+ case platform
426
+ when :ios, :tvos
427
+ [
428
+ Spaceship::ConnectAPI::Certificate::CertificateType::DEVELOPMENT,
429
+ Spaceship::ConnectAPI::Certificate::CertificateType::IOS_DEVELOPMENT
430
+ ]
431
+ when :macos, :catalyst
432
+ [
433
+ Spaceship::ConnectAPI::Certificate::CertificateType::DEVELOPMENT,
434
+ Spaceship::ConnectAPI::Certificate::CertificateType::MAC_APP_DEVELOPMENT
435
+ ]
436
+ else
437
+ []
438
+ end
439
+
440
+ certificates = Spaceship::ConnectAPI::Certificate.all
441
+ unless certificate_types.empty?
442
+ certificates = certificates.select do |certificate|
443
+ certificate_types.include?(certificate.certificateType) && certificate.valid?
444
+ end
445
+ end
446
+
447
+ portal_certs_count = certificates.size
448
+
449
+ return portal_certs_count != profile_certs_count
450
+ end
368
451
  end
452
+ # rubocop:enable Metrics/ClassLength
369
453
  end
@@ -144,6 +144,11 @@ module Sigh
144
144
  is_string: false,
145
145
  default_value: false,
146
146
  short_option: "-w"),
147
+ FastlaneCore::ConfigItem.new(key: :include_all_certificates,
148
+ env_name: "SIGH_INCLUDE_ALL_CERTIFICATES",
149
+ description: "Include all matching certificates in the provisioning profile. Works only for the 'development' provisioning profile type",
150
+ is_string: false,
151
+ default_value: false),
147
152
  FastlaneCore::ConfigItem.new(key: :skip_certificate_verification,
148
153
  short_option: '-z',
149
154
  env_name: "SIGH_SKIP_CERTIFICATE_VERIFICATION",
@@ -114,7 +114,7 @@ module Sigh
114
114
 
115
115
  # Take the provisioning profile name into account
116
116
  results = filter_profiles_by_name(results) if Sigh.config[:provisioning_name].to_s.length > 0
117
- return results if Sigh.config[:skip_certificate_verification]
117
+ return results if Sigh.config[:skip_certificate_verification] || Sigh.config[:include_all_certificates]
118
118
 
119
119
  UI.message("Verifying certificates...")
120
120
  return results.find_all do |current_profile|
@@ -311,7 +311,7 @@ module Sigh
311
311
 
312
312
  # verify certificates
313
313
  if Helper.mac?
314
- unless Sigh.config[:skip_certificate_verification]
314
+ unless Sigh.config[:skip_certificate_verification] || Sigh.config[:include_all_certificates]
315
315
  certificates = certificates.find_all do |c|
316
316
  file = Tempfile.new('cert')
317
317
  raw_data = Base64.decode64(c.certificate_content)
@@ -123,7 +123,7 @@ module Snapshot
123
123
  type: Boolean),
124
124
  FastlaneCore::ConfigItem.new(key: :override_status_bar,
125
125
  env_name: 'SNAPSHOT_OVERRIDE_STATUS_BAR',
126
- description: "Enabling this option will automatically override the status bar to show 9:41 AM, full battery, and full reception",
126
+ description: "Enabling this option will automatically override the status bar to show 9:41 AM, full battery, and full reception (Adjust 'SNAPSHOT_SIMULATOR_WAIT_FOR_BOOT_TIMEOUT' environment variable if override status bar is not working. Might be because simulator is not fully booted. Defaults to 10 seconds)",
127
127
  default_value: false,
128
128
  is_string: false),
129
129
  FastlaneCore::ConfigItem.new(key: :override_status_bar_arguments,
@@ -119,6 +119,13 @@ module Snapshot
119
119
  # Boot the simulator and wait for it to finish booting
120
120
  Helper.backticks("xcrun simctl bootstatus #{device_udid} -b &> /dev/null")
121
121
 
122
+ # "Booted" status is not enough for to adjust the status bar
123
+ # Simulator could stil be booting with Apple logo
124
+ # Need to wait "some amount of time" until home screen shows
125
+ boot_sleep = ENV["SNAPSHOT_SIMULATOR_WAIT_FOR_BOOT_TIMEOUT"].to_i || 10
126
+ UI.message("Waiting #{boot_sleep} seconds for device to fully boot before overriding status bar... Set 'SNAPSHOT_SIMULATOR_WAIT_FOR_BOOT_TIMEOUT' environemnt variable to adjust timeout")
127
+ sleep(boot_sleep) if boot_sleep > 0
128
+
122
129
  UI.message("Overriding Status Bar")
123
130
 
124
131
  if arguments.nil? || arguments.empty?
metadata CHANGED
@@ -1,38 +1,38 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.194.0
4
+ version: 2.195.0
5
5
  platform: ruby
6
6
  authors:
7
- - Josh Holtz
8
- - Danielle Tomlinson
9
- - Jorge Revuelta H
10
- - Aaron Brager
11
- - Kohki Miki
12
- - Joshua Liebowitz
13
- - Olivier Halligon
7
+ - Stefan Natchev
8
+ - Roger Oba
14
9
  - Fumiya Nakamura
15
- - Satoshi Namai
10
+ - Jérôme Lacoste
11
+ - Iulian Onofrei
12
+ - Jorge Revuelta H
16
13
  - Max Ott
14
+ - Daniel Jankowski
15
+ - Olivier Halligon
17
16
  - Helmut Januschka
18
- - Roger Oba
19
- - Felix Krause
20
- - Maksym Grebenets
21
- - Jérôme Lacoste
22
- - Jimmy Dee
23
- - Luka Mirosevic
24
17
  - Manish Rathi
25
- - Manu Wallner
26
- - Andrew McBurney
27
- - Stefan Natchev
28
- - Daniel Jankowski
29
18
  - Jan Piotrowski
19
+ - Danielle Tomlinson
20
+ - Luka Mirosevic
21
+ - Jimmy Dee
22
+ - Andrew McBurney
23
+ - Joshua Liebowitz
24
+ - Satoshi Namai
25
+ - Felix Krause
26
+ - Kohki Miki
27
+ - Aaron Brager
30
28
  - Matthew Ellis
31
- - Iulian Onofrei
29
+ - Josh Holtz
30
+ - Maksym Grebenets
31
+ - Manu Wallner
32
32
  autorequire:
33
33
  bindir: bin
34
34
  cert_chain: []
35
- date: 2021-09-15 00:00:00.000000000 Z
35
+ date: 2021-09-25 00:00:00.000000000 Z
36
36
  dependencies:
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: xcodeproj
@@ -1013,7 +1013,6 @@ files:
1013
1013
  - fastlane/lib/fastlane.rb
1014
1014
  - fastlane/lib/fastlane/action.rb
1015
1015
  - fastlane/lib/fastlane/action_collector.rb
1016
- - fastlane/lib/fastlane/actions/.notarize.rb.swp
1017
1016
  - fastlane/lib/fastlane/actions/README.md
1018
1017
  - fastlane/lib/fastlane/actions/actions_helper.rb
1019
1018
  - fastlane/lib/fastlane/actions/adb.rb
@@ -1057,7 +1056,6 @@ files:
1057
1056
  - fastlane/lib/fastlane/actions/commit_github_file.rb
1058
1057
  - fastlane/lib/fastlane/actions/commit_version_bump.rb
1059
1058
  - fastlane/lib/fastlane/actions/copy_artifacts.rb
1060
- - fastlane/lib/fastlane/actions/crashlytics.rb
1061
1059
  - fastlane/lib/fastlane/actions/create_app_on_managed_play_store.rb
1062
1060
  - fastlane/lib/fastlane/actions/create_app_online.rb
1063
1061
  - fastlane/lib/fastlane/actions/create_keychain.rb
@@ -1279,7 +1277,6 @@ files:
1279
1277
  - fastlane/lib/fastlane/features.rb
1280
1278
  - fastlane/lib/fastlane/helper/README.md
1281
1279
  - fastlane/lib/fastlane/helper/adb_helper.rb
1282
- - fastlane/lib/fastlane/helper/crashlytics_helper.rb
1283
1280
  - fastlane/lib/fastlane/helper/dotenv_helper.rb
1284
1281
  - fastlane/lib/fastlane/helper/gem_helper.rb
1285
1282
  - fastlane/lib/fastlane/helper/git_helper.rb
@@ -1,207 +0,0 @@
1
- module Fastlane
2
- module Actions
3
- class CrashlyticsAction < Action
4
- def self.run(params)
5
- params.values # to validate all inputs before looking for the ipa/apk
6
- tempfiles = []
7
-
8
- # We need to store notes in a file, because the crashlytics CLI (iOS) says so
9
- if params[:notes]
10
- UI.error("Overwriting :notes_path, because you specified :notes") if params[:notes_path]
11
-
12
- changelog = Helper::CrashlyticsHelper.write_to_tempfile(params[:notes], 'changelog')
13
- tempfiles << changelog
14
- params[:notes_path] = changelog.path
15
- elsif Actions.lane_context[SharedValues::FL_CHANGELOG] && !params[:notes_path]
16
- UI.message("Sending FL_CHANGELOG as release notes to Beta by Crashlytics")
17
-
18
- changelog = Helper::CrashlyticsHelper.write_to_tempfile(
19
- Actions.lane_context[SharedValues::FL_CHANGELOG], 'changelog'
20
- )
21
- tempfiles << changelog
22
- params[:notes_path] = changelog.path
23
- end
24
-
25
- if params[:ipa_path]
26
- command = Helper::CrashlyticsHelper.generate_ios_command(params)
27
- elsif params[:apk_path]
28
- android_manifest = Helper::CrashlyticsHelper.generate_android_manifest_tempfile
29
- tempfiles << android_manifest
30
- command = Helper::CrashlyticsHelper.generate_android_command(params, android_manifest.path)
31
- else
32
- UI.user_error!("You have to either pass an ipa or an apk file to the Crashlytics action")
33
- end
34
-
35
- UI.success('Uploading the build to Crashlytics Beta. Time for some ☕️.')
36
-
37
- sanitizer = proc do |message|
38
- message.gsub(params[:api_token], '[[API_TOKEN]]')
39
- .gsub(params[:build_secret], '[[BUILD_SECRET]]')
40
- end
41
-
42
- UI.verbose(sanitizer.call(command.join(' '))) if FastlaneCore::Globals.verbose?
43
-
44
- error_callback = proc do |error|
45
- clean_error = sanitizer.call(error)
46
- UI.user_error!(clean_error)
47
- end
48
-
49
- result = Actions.sh_control_output(
50
- command.join(" "),
51
- print_command: false,
52
- print_command_output: false,
53
- error_callback: error_callback
54
- )
55
-
56
- tempfiles.each(&:unlink)
57
- return command if Helper.test?
58
-
59
- UI.verbose(sanitizer.call(result)) if FastlaneCore::Globals.verbose?
60
-
61
- UI.success('Build successfully uploaded to Crashlytics Beta 🌷')
62
- UI.success('Visit https://fabric.io/_/beta to add release notes and notify testers.')
63
- end
64
-
65
- def self.description
66
- "Refer to [Firebase App Distribution](https://appdistro.page.link/fastlane-repo)"
67
- end
68
-
69
- def self.available_options
70
- platform = Actions.lane_context[Actions::SharedValues::PLATFORM_NAME]
71
-
72
- if platform == :ios || platform.nil?
73
- ipa_path_default = Dir["*.ipa"].sort_by { |x| File.mtime(x) }.last
74
- end
75
-
76
- if platform == :android
77
- apk_path_default = Dir["*.apk"].last || Dir[File.join("app", "build", "outputs", "apk", "app-release.apk")].last
78
- end
79
-
80
- [
81
- # iOS Specific
82
- FastlaneCore::ConfigItem.new(key: :ipa_path,
83
- env_name: "CRASHLYTICS_IPA_PATH",
84
- description: "Path to your IPA file. Optional if you use the _gym_ or _xcodebuild_ action",
85
- default_value: Actions.lane_context[SharedValues::IPA_OUTPUT_PATH] || ipa_path_default,
86
- default_value_dynamic: true,
87
- optional: true,
88
- verify_block: proc do |value|
89
- UI.user_error!("Couldn't find ipa file at path '#{value}'") unless File.exist?(value)
90
- end),
91
- # Android Specific
92
- FastlaneCore::ConfigItem.new(key: :apk_path,
93
- env_name: "CRASHLYTICS_APK_PATH",
94
- description: "Path to your APK file",
95
- default_value: Actions.lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH] || apk_path_default,
96
- default_value_dynamic: true,
97
- optional: true,
98
- verify_block: proc do |value|
99
- UI.user_error!("Couldn't find apk file at path '#{value}'") unless File.exist?(value)
100
- end),
101
- # General
102
- FastlaneCore::ConfigItem.new(key: :crashlytics_path,
103
- env_name: "CRASHLYTICS_FRAMEWORK_PATH",
104
- description: "Path to the submit binary in the Crashlytics bundle (iOS) or `crashlytics-devtools.jar` file (Android)",
105
- optional: true,
106
- verify_block: proc do |value|
107
- UI.user_error!("Couldn't find crashlytics at path '#{File.expand_path(value)}'`") unless File.exist?(File.expand_path(value))
108
- end),
109
- FastlaneCore::ConfigItem.new(key: :api_token,
110
- env_name: "CRASHLYTICS_API_TOKEN",
111
- description: "Crashlytics API Key",
112
- sensitive: true,
113
- verify_block: proc do |value|
114
- UI.user_error!("No API token for Crashlytics given, pass using `api_token: 'token'`") unless value && !value.empty?
115
- end),
116
- FastlaneCore::ConfigItem.new(key: :build_secret,
117
- env_name: "CRASHLYTICS_BUILD_SECRET",
118
- description: "Crashlytics Build Secret",
119
- sensitive: true,
120
- verify_block: proc do |value|
121
- UI.user_error!("No build secret for Crashlytics given, pass using `build_secret: 'secret'`") unless value && !value.empty?
122
- end),
123
- FastlaneCore::ConfigItem.new(key: :notes_path,
124
- env_name: "CRASHLYTICS_NOTES_PATH",
125
- description: "Path to the release notes",
126
- optional: true,
127
- verify_block: proc do |value|
128
- UI.user_error!("Path '#{value}' not found") unless File.exist?(value)
129
- end),
130
- FastlaneCore::ConfigItem.new(key: :notes,
131
- env_name: "CRASHLYTICS_NOTES",
132
- description: "The release notes as string - uses :notes_path under the hood",
133
- optional: true),
134
- FastlaneCore::ConfigItem.new(key: :groups,
135
- env_name: "CRASHLYTICS_GROUPS",
136
- description: "The groups used for distribution, separated by commas",
137
- type: Array,
138
- optional: true),
139
- FastlaneCore::ConfigItem.new(key: :emails,
140
- env_name: "CRASHLYTICS_EMAILS",
141
- description: "Pass email addresses of testers, separated by commas",
142
- type: Array,
143
- optional: true),
144
- FastlaneCore::ConfigItem.new(key: :notifications,
145
- env_name: "CRASHLYTICS_NOTIFICATIONS",
146
- description: "Crashlytics notification option (true/false)",
147
- default_value: true,
148
- type: Boolean),
149
- FastlaneCore::ConfigItem.new(key: :debug,
150
- env_name: "CRASHLYTICS_DEBUG",
151
- description: "Crashlytics debug option (true/false)",
152
- default_value: false,
153
- type: Boolean)
154
-
155
- ]
156
- end
157
-
158
- def self.is_supported?(platform)
159
- [:ios, :mac, :android].include?(platform)
160
- end
161
-
162
- def self.author
163
- ["KrauseFx", "pedrogimenez"]
164
- end
165
-
166
- def self.details
167
- [
168
- "Additionally, you can specify `notes`, `emails`, `groups` and `notifications`.",
169
- "Distributing to Groups: When using the `groups` parameter, it's important to use the group **alias** names for each group you'd like to distribute to. A group's alias can be found in the web UI. If you're viewing the Beta page, you can open the groups dialog by clicking the 'Manage Groups' button.",
170
- "This action uses the `submit` binary provided by the Crashlytics framework. If the binary is not found in its usual path, you'll need to specify the path manually by using the `crashlytics_path` option."
171
- ].join("\n")
172
- end
173
-
174
- def self.example_code
175
- [
176
- 'crashlytics',
177
- '# If you installed Crashlytics via CocoaPods
178
- crashlytics(
179
- crashlytics_path: "./Pods/Crashlytics/submit", # path to your Crashlytics submit binary.
180
- api_token: "...",
181
- build_secret: "...",
182
- ipa_path: "./app.ipa"
183
- )',
184
- '# If you installed Crashlytics via Carthage for iOS platform
185
- crashlytics(
186
- crashlytics_path: "./Carthage/Build/iOS/Crashlytics.framework/submit", # path to your Crashlytics submit binary.
187
- api_token: "...",
188
- build_secret: "...",
189
- ipa_path: "./app.ipa"
190
- )'
191
- ]
192
- end
193
-
194
- def self.category
195
- :deprecated
196
- end
197
-
198
- def self.deprecated_notes
199
- [
200
- "Crashlytics Beta has been deprecated and replaced with Firebase App Distribution.",
201
- "Beta will continue working until May 4, 2020.",
202
- "Check out the [Firebase App Distribution docs](https://github.com/fastlane/fastlane-plugin-firebase_app_distribution) to get started."
203
- ].join("\n")
204
- end
205
- end
206
- end
207
- end