fastlane 2.193.1 → 2.197.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +88 -88
  3. data/cert/lib/cert/options.rb +1 -1
  4. data/deliver/lib/assets/ScreenshotsHelp +29 -6
  5. data/deliver/lib/deliver/app_screenshot.rb +4 -4
  6. data/deliver/lib/deliver/options.rb +1 -1
  7. data/deliver/lib/deliver/upload_screenshots.rb +1 -1
  8. data/fastlane/lib/fastlane/actions/app_store_build_number.rb +13 -7
  9. data/fastlane/lib/fastlane/actions/docs/upload_to_app_store.md.erb +1 -1
  10. data/fastlane/lib/fastlane/actions/download_dsyms.rb +47 -30
  11. data/fastlane/lib/fastlane/actions/gradle.rb +15 -2
  12. data/fastlane/lib/fastlane/actions/last_git_commit.rb +1 -1
  13. data/fastlane/lib/fastlane/actions/latest_testflight_build_number.rb +3 -4
  14. data/fastlane/lib/fastlane/actions/notarize.rb +27 -18
  15. data/fastlane/lib/fastlane/actions/prompt.rb +1 -1
  16. data/fastlane/lib/fastlane/actions/register_device.rb +1 -1
  17. data/fastlane/lib/fastlane/actions/register_devices.rb +1 -1
  18. data/fastlane/lib/fastlane/actions/set_changelog.rb +1 -1
  19. data/fastlane/lib/fastlane/actions/slather.rb +6 -0
  20. data/fastlane/lib/fastlane/documentation/markdown_docs_generator.rb +11 -5
  21. data/fastlane/lib/fastlane/version.rb +1 -1
  22. data/fastlane/swift/Deliverfile.swift +1 -1
  23. data/fastlane/swift/DeliverfileProtocol.swift +2 -2
  24. data/fastlane/swift/Fastlane.swift +86 -99
  25. data/fastlane/swift/Gymfile.swift +1 -1
  26. data/fastlane/swift/GymfileProtocol.swift +1 -1
  27. data/fastlane/swift/LaneFileProtocol.swift +1 -1
  28. data/fastlane/swift/Matchfile.swift +1 -1
  29. data/fastlane/swift/MatchfileProtocol.swift +10 -2
  30. data/fastlane/swift/Precheckfile.swift +1 -1
  31. data/fastlane/swift/PrecheckfileProtocol.swift +2 -2
  32. data/fastlane/swift/Runner.swift +1 -1
  33. data/fastlane/swift/Scanfile.swift +1 -1
  34. data/fastlane/swift/ScanfileProtocol.swift +1 -1
  35. data/fastlane/swift/Screengrabfile.swift +1 -1
  36. data/fastlane/swift/ScreengrabfileProtocol.swift +3 -3
  37. data/fastlane/swift/Snapshotfile.swift +1 -1
  38. data/fastlane/swift/SnapshotfileProtocol.swift +2 -2
  39. data/fastlane/swift/formatting/Brewfile.lock.json +16 -16
  40. data/fastlane_core/lib/fastlane_core/build_watcher.rb +1 -1
  41. data/frameit/lib/frameit/editor.rb +16 -18
  42. data/frameit/lib/frameit/trim_box.rb +6 -0
  43. data/match/lib/match/generator.rb +2 -1
  44. data/match/lib/match/options.rb +11 -1
  45. data/match/lib/match/runner.rb +94 -10
  46. data/pem/lib/pem/manager.rb +2 -1
  47. data/pem/lib/pem/options.rb +1 -1
  48. data/pilot/lib/pilot/options.rb +1 -1
  49. data/precheck/lib/precheck/options.rb +1 -1
  50. data/screengrab/lib/screengrab/options.rb +2 -2
  51. data/sigh/lib/assets/resign.sh +9 -6
  52. data/sigh/lib/sigh/options.rb +6 -1
  53. data/sigh/lib/sigh/runner.rb +2 -2
  54. data/snapshot/lib/snapshot/options.rb +1 -1
  55. data/snapshot/lib/snapshot/reports_generator.rb +8 -0
  56. data/snapshot/lib/snapshot/simulator_launchers/simulator_launcher_base.rb +9 -1
  57. data/spaceship/lib/spaceship/connect_api/models/.build.rb.swp +0 -0
  58. data/spaceship/lib/spaceship/connect_api/models/app_store_version.rb +1 -1
  59. data/spaceship/lib/spaceship/connect_api/models/build.rb +4 -2
  60. data/spaceship/lib/spaceship/connect_api/models/build_bundle.rb +59 -0
  61. data/spaceship/lib/spaceship/connect_api/token.rb +1 -1
  62. data/spaceship/lib/spaceship/connect_api.rb +1 -0
  63. data/supply/lib/supply/client.rb +3 -3
  64. data/supply/lib/supply/uploader.rb +10 -7
  65. metadata +39 -35
  66. data/fastlane/lib/fastlane/actions/crashlytics.rb +0 -207
  67. data/fastlane/lib/fastlane/helper/crashlytics_helper.rb +0 -157
@@ -17,4 +17,4 @@ public class Gymfile: GymfileProtocol {
17
17
  // during the `init` process, and you won't see this message
18
18
  }
19
19
 
20
- // Generated with fastlane 2.193.1
20
+ // Generated with fastlane 2.197.0
@@ -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.85]
199
+ // FastlaneRunnerAPIVersion [0.9.89]
@@ -99,7 +99,7 @@ open class LaneFile: NSObject, LaneFileProtocol {
99
99
  #if !SWIFT_PACKAGE
100
100
  // When not in SPM environment, we load the Fastfile from its `className()`.
101
101
  loadFastfile()
102
- guard let fastfileInstance = self.fastfileInstance as? Fastfile else {
102
+ guard let fastfileInstance = fastfileInstance as? Fastfile else {
103
103
  let message = "Unable to instantiate class named: \(className())"
104
104
  log(message: message)
105
105
  fatalError(message)
@@ -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.193.1
20
+ // Generated with fastlane 2.197.0
@@ -23,7 +23,7 @@ public protocol MatchfileProtocol: class {
23
23
  /// Path to your App Store Connect API Key JSON file (https://docs.fastlane.tools/app-store-connect-api/#using-fastlane-api-key-json-file)
24
24
  var apiKeyPath: String? { get }
25
25
 
26
- /// Your App Store Connect API Key information (https://docs.fastlane.tools/app-store-connect-api/#use-return-value-and-pass-in-as-an-option)
26
+ /// Your App Store Connect API Key information (https://docs.fastlane.tools/app-store-connect-api/#using-fastlane-api-key-hash-option)
27
27
  var apiKey: [String: Any]? { get }
28
28
 
29
29
  /// Your Apple ID Username
@@ -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.79]
195
+ // FastlaneRunnerAPIVersion [0.9.83]
@@ -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.193.1
20
+ // Generated with fastlane 2.197.0
@@ -5,7 +5,7 @@ public protocol PrecheckfileProtocol: class {
5
5
  /// Path to your App Store Connect API Key JSON file (https://docs.fastlane.tools/app-store-connect-api/#using-fastlane-api-key-json-file)
6
6
  var apiKeyPath: String? { get }
7
7
 
8
- /// Your App Store Connect API Key information (https://docs.fastlane.tools/app-store-connect-api/#use-return-value-and-pass-in-as-an-option)
8
+ /// Your App Store Connect API Key information (https://docs.fastlane.tools/app-store-connect-api/#using-fastlane-api-key-hash-option)
9
9
  var apiKey: [String: Any]? { get }
10
10
 
11
11
  /// The bundle identifier of your app
@@ -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.78]
55
+ // FastlaneRunnerAPIVersion [0.9.82]
@@ -132,7 +132,7 @@ extension Runner {
132
132
  }
133
133
 
134
134
  @objc func startSocketComs() {
135
- guard let socketClient = self.socketClient else {
135
+ guard let socketClient = socketClient else {
136
136
  return
137
137
  }
138
138
 
@@ -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.193.1
20
+ // Generated with fastlane 2.197.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.90]
299
+ // FastlaneRunnerAPIVersion [0.9.94]
@@ -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.193.1
20
+ // Generated with fastlane 2.197.0
@@ -47,7 +47,7 @@ public protocol ScreengrabfileProtocol: class {
47
47
  /// The path to the APK for the app under test
48
48
  var appApkPath: String? { get }
49
49
 
50
- /// The path to the APK for the the tests bundle
50
+ /// The path to the APK for the tests bundle
51
51
  var testsApkPath: String? { get }
52
52
 
53
53
  /// Use the device or emulator with the given serial number or qualifier
@@ -56,7 +56,7 @@ public protocol ScreengrabfileProtocol: class {
56
56
  /// Type of device used for screenshots. Matches Google Play Types (phone, sevenInch, tenInch, tv, wear)
57
57
  var deviceType: String { get }
58
58
 
59
- /// Whether or not to exit Screengrab on test failure. Exiting on failure will not copy sceenshots to local machine nor open sceenshots summary
59
+ /// Whether or not to exit Screengrab on test failure. Exiting on failure will not copy screenshots to local machine nor open screenshots summary
60
60
  var exitOnTestFailure: Bool { get }
61
61
 
62
62
  /// Enabling this option will automatically uninstall the application before running it
@@ -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.80]
99
+ // FastlaneRunnerAPIVersion [0.9.84]
@@ -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.193.1
20
+ // Generated with fastlane 2.197.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.74]
203
+ // FastlaneRunnerAPIVersion [0.9.78]
@@ -2,30 +2,30 @@
2
2
  "entries": {
3
3
  "brew": {
4
4
  "swiftformat": {
5
- "version": "0.48.11",
5
+ "version": "0.48.17",
6
6
  "bottle": {
7
7
  "rebuild": 0,
8
8
  "root_url": "https://ghcr.io/v2/homebrew/core",
9
9
  "files": {
10
10
  "arm64_big_sur": {
11
11
  "cellar": ":any_skip_relocation",
12
- "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:e0a851cfa2ff5d04f0fc98a9e624d1411f1b5b1e55e3cbc0901f4913c02e716a",
13
- "sha256": "e0a851cfa2ff5d04f0fc98a9e624d1411f1b5b1e55e3cbc0901f4913c02e716a"
12
+ "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:e19dbc72ddf213203e940708f3de6d9ca9c88663b5176494d04b4c418e16954f",
13
+ "sha256": "e19dbc72ddf213203e940708f3de6d9ca9c88663b5176494d04b4c418e16954f"
14
14
  },
15
15
  "big_sur": {
16
16
  "cellar": ":any_skip_relocation",
17
- "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:a5327283fe32b2ef2c6f264e14c966a9a60cb291415d3d05ed659c92a93c4987",
18
- "sha256": "a5327283fe32b2ef2c6f264e14c966a9a60cb291415d3d05ed659c92a93c4987"
17
+ "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:90056a4e3b03ef31cecfb5b9e278a44bea2abecdd26a202d00bc390dfbbeb352",
18
+ "sha256": "90056a4e3b03ef31cecfb5b9e278a44bea2abecdd26a202d00bc390dfbbeb352"
19
19
  },
20
20
  "catalina": {
21
21
  "cellar": ":any_skip_relocation",
22
- "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:ba95e49ecc71bb19734698dee565e3b0ced6470729206cb434675cfa051f2755",
23
- "sha256": "ba95e49ecc71bb19734698dee565e3b0ced6470729206cb434675cfa051f2755"
22
+ "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:9647fdbfed2e7e2361974a5bfb99be4a112d914bd3e582afb4cdf7dc81e44cbf",
23
+ "sha256": "9647fdbfed2e7e2361974a5bfb99be4a112d914bd3e582afb4cdf7dc81e44cbf"
24
24
  },
25
25
  "mojave": {
26
26
  "cellar": ":any_skip_relocation",
27
- "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:c7e00eae9d46dddf040999f0f2832d08110f093c7a403aaaaaa18d8830213967",
28
- "sha256": "c7e00eae9d46dddf040999f0f2832d08110f093c7a403aaaaaa18d8830213967"
27
+ "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:83231c218cca811795688e175d88ac4584d1c424566926f9d6ed36e9dbdfed75",
28
+ "sha256": "83231c218cca811795688e175d88ac4584d1c424566926f9d6ed36e9dbdfed75"
29
29
  }
30
30
  }
31
31
  }
@@ -43,18 +43,18 @@
43
43
  "macOS": "10.15.7"
44
44
  },
45
45
  "big_sur": {
46
- "HOMEBREW_VERSION": "3.2.10-50-ge3f851d",
46
+ "HOMEBREW_VERSION": "3.2.17",
47
47
  "HOMEBREW_PREFIX": "/opt/homebrew",
48
- "Homebrew/homebrew-core": "73588fb5f5edccfe62f1b290a3298b402fbd71d5",
49
- "CLT": "12.5.1.0.1.1623191612",
48
+ "Homebrew/homebrew-core": "d975bb4c6f50e8cafd6df9fc7f2ebf04d22ffa41",
49
+ "CLT": "13.0.0.0.1.1630607135",
50
50
  "Xcode": "13.0",
51
- "macOS": "11.5.2"
51
+ "macOS": "11.6"
52
52
  },
53
53
  "monterey": {
54
- "HOMEBREW_VERSION": "3.2.6-34-g6bb3699",
54
+ "HOMEBREW_VERSION": "3.2.13-55-ga6959e4",
55
55
  "HOMEBREW_PREFIX": "/usr/local",
56
- "Homebrew/homebrew-core": "b7523de28df0f0f819ff2c49c84611eec19f5455",
57
- "CLT": "13.0.0.0.1.1626155413",
56
+ "Homebrew/homebrew-core": "3fb109275770551bba03c7055d75ceec2c38b1b2",
57
+ "CLT": "13.0.0.0.1.1628499445",
58
58
  "Xcode": "13.0",
59
59
  "macOS": "12.0"
60
60
  }
@@ -156,7 +156,7 @@ module FastlaneCore
156
156
  #
157
157
  # If set, this method will only return true if all three statuses are complete
158
158
  if wait_for_build_beta_detail_processing
159
- is_processed &&= build.build_beta_detail.processed?
159
+ is_processed &&= (build.build_beta_detail&.processed? || false)
160
160
  end
161
161
 
162
162
  return is_processed
@@ -467,26 +467,24 @@ module Frameit
467
467
  # Get matching trim box:
468
468
  trim_box = trim_boxes[key]
469
469
 
470
- # For side-by-side text images (e.g. stack_title is false) adjust the trim box based on top_vertical_trim_offset and bottom_vertical_trim_offset to maintain the text baseline:
471
- unless stack_title
472
- # Determine the trim area by maintaining the same vertical top offset based on the smallest value from all trim boxes (top_vertical_trim_offset).
473
- # When the vertical top offset is larger than the smallest vertical top offset, the trim box needs to be adjusted:
474
- if trim_box.offset_y > top_vertical_trim_offset
475
- # Increase the height of the trim box with the difference in vertical top offset:
476
- trim_box.height += trim_box.offset_y - top_vertical_trim_offset
477
- # Change the vertical top offset to match that of the others:
478
- trim_box.offset_y = top_vertical_trim_offset
479
-
480
- UI.verbose("Trim box for key \"#{key}\" is adjusted to align top: #{trim_box}\n")
481
- end
470
+ # Adjust the trim box based on top_vertical_trim_offset and bottom_vertical_trim_offset to maintain the text baseline:
471
+ # Determine the trim area by maintaining the same vertical top offset based on the smallest value from all trim boxes (top_vertical_trim_offset).
472
+ # When the vertical top offset is larger than the smallest vertical top offset, the trim box needs to be adjusted:
473
+ if trim_box.offset_y > top_vertical_trim_offset
474
+ # Increase the height of the trim box with the difference in vertical top offset:
475
+ trim_box.height += trim_box.offset_y - top_vertical_trim_offset
476
+ # Change the vertical top offset to match that of the others:
477
+ trim_box.offset_y = top_vertical_trim_offset
478
+
479
+ UI.verbose("Trim box for key \"#{key}\" is adjusted to align top: #{trim_box.json_string_format}")
480
+ end
482
481
 
483
- # Check if the height needs to be adjusted to reach the bottom offset:
484
- if (trim_box.offset_y + trim_box.height) < bottom_vertical_trim_offset
485
- # Set the height of the trim box to the difference between vertical bottom and top offset:
486
- trim_box.height = bottom_vertical_trim_offset - trim_box.offset_y
482
+ # Check if the height needs to be adjusted to reach the bottom offset:
483
+ if (trim_box.offset_y + trim_box.height) < bottom_vertical_trim_offset
484
+ # Set the height of the trim box to the difference between vertical bottom and top offset:
485
+ trim_box.height = bottom_vertical_trim_offset - trim_box.offset_y
487
486
 
488
- UI.verbose("Trim box for key \"#{key}\" is adjusted to align bottom: #{trim_box}\n")
489
- end
487
+ UI.verbose("Trim box for key \"#{key}\" is adjusted to align bottom: #{trim_box.json_string_format}")
490
488
  end
491
489
 
492
490
  # Crop image with (adjusted) trim box parameters in MiniMagick string format:
@@ -31,5 +31,11 @@ module Frameit
31
31
  # Convert trim box parameters to string with syntax: "<width>x<height>+<offset_x>+<offset_y>":
32
32
  return "#{@width}x#{@height}+#{@offset_x}+#{@offset_y}"
33
33
  end
34
+
35
+ # Get the trimbox parameters in a human readable JSON string format
36
+ def json_string_format
37
+ # Create a JSON string from the trim box parameters:
38
+ return "{\"width\" : #{@width}, \"height\" : #{@height} , \"offset_x\" : #{@offset_x}, \"offset_y\" : #{@offset_y}}"
39
+ end
34
40
  end
35
41
  end
@@ -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]
@@ -83,7 +83,7 @@ module Match
83
83
  end),
84
84
  FastlaneCore::ConfigItem.new(key: :api_key,
85
85
  env_names: ["SIGH_API_KEY", "APP_STORE_CONNECT_API_KEY"],
86
- description: "Your App Store Connect API Key information (https://docs.fastlane.tools/app-store-connect-api/#use-return-value-and-pass-in-as-an-option)",
86
+ description: "Your App Store Connect API Key information (https://docs.fastlane.tools/app-store-connect-api/#using-fastlane-api-key-hash-option)",
87
87
  type: Hash,
88
88
  optional: true,
89
89
  sensitive: true,
@@ -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
@@ -73,7 +73,8 @@ module PEM
73
73
 
74
74
  if PEM.config[:generate_p12]
75
75
  p12_cert_path = File.join(output_path, "#{filename_base}.p12")
76
- p12 = OpenSSL::PKCS12.create(PEM.config[:p12_password], certificate_type, pkey, x509_certificate)
76
+ p12_password = PEM.config[:p12_password] == "" ? nil : PEM.config[:p12_password]
77
+ p12 = OpenSSL::PKCS12.create(p12_password, certificate_type, pkey, x509_certificate)
77
78
  File.write(p12_cert_path, p12.to_der)
78
79
  UI.message("p12 certificate: ".green + Pathname.new(p12_cert_path).realpath.to_s)
79
80
  end
@@ -86,7 +86,7 @@ module PEM
86
86
  env_name: "PEM_P12_PASSWORD",
87
87
  sensitive: true,
88
88
  description: "The password that is used for your p12 file",
89
- default_value: ""),
89
+ optional: true),
90
90
  FastlaneCore::ConfigItem.new(key: :pem_name,
91
91
  short_option: "-o",
92
92
  env_name: "PEM_FILE_NAME",
@@ -20,7 +20,7 @@ module Pilot
20
20
  end),
21
21
  FastlaneCore::ConfigItem.new(key: :api_key,
22
22
  env_names: ["PILOT_API_KEY", "APP_STORE_CONNECT_API_KEY"],
23
- description: "Your App Store Connect API Key information (https://docs.fastlane.tools/app-store-connect-api/#use-return-value-and-pass-in-as-an-option)",
23
+ description: "Your App Store Connect API Key information (https://docs.fastlane.tools/app-store-connect-api/#using-fastlane-api-key-hash-option)",
24
24
  type: Hash,
25
25
  optional: true,
26
26
  sensitive: true,
@@ -35,7 +35,7 @@ module Precheck
35
35
  end),
36
36
  FastlaneCore::ConfigItem.new(key: :api_key,
37
37
  env_names: ["PRECHECK_API_KEY", "APP_STORE_CONNECT_API_KEY"],
38
- description: "Your App Store Connect API Key information (https://docs.fastlane.tools/app-store-connect-api/#use-return-value-and-pass-in-as-an-option)",
38
+ description: "Your App Store Connect API Key information (https://docs.fastlane.tools/app-store-connect-api/#using-fastlane-api-key-hash-option)",
39
39
  type: Hash,
40
40
  optional: true,
41
41
  sensitive: true,
@@ -105,7 +105,7 @@ module Screengrab
105
105
  FastlaneCore::ConfigItem.new(key: :tests_apk_path,
106
106
  env_name: 'SCREENGRAB_TESTS_APK_PATH',
107
107
  optional: true,
108
- description: "The path to the APK for the the tests bundle",
108
+ description: "The path to the APK for the tests bundle",
109
109
  short_option: "-b",
110
110
  code_gen_sensitive: true,
111
111
  default_value: Dir[File.join("app", "build", "outputs", "apk", "app-debug-androidTest-unaligned.apk")].last,
@@ -128,7 +128,7 @@ module Screengrab
128
128
  end),
129
129
  FastlaneCore::ConfigItem.new(key: :exit_on_test_failure,
130
130
  env_name: 'EXIT_ON_TEST_FAILURE',
131
- description: "Whether or not to exit Screengrab on test failure. Exiting on failure will not copy sceenshots to local machine nor open sceenshots summary",
131
+ description: "Whether or not to exit Screengrab on test failure. Exiting on failure will not copy screenshots to local machine nor open screenshots summary",
132
132
  default_value: true,
133
133
  type: Boolean),
134
134
  FastlaneCore::ConfigItem.new(key: :reinstall_app,
@@ -80,6 +80,9 @@
80
80
  #
81
81
  # new features June 2021
82
82
  # 1. fix the way app entitlements are extracted
83
+ #
84
+ # new features October 2021
85
+ # 1. change codesign signatue to use --generate-entitlement-der to include DER encoded entitlements
83
86
 
84
87
  # Logging functions
85
88
 
@@ -546,7 +549,7 @@ function resign {
546
549
  do
547
550
  if [[ "$assetpack" == *.assetpack ]]; then
548
551
  rm -rf $assetpack/_CodeSignature
549
- /usr/bin/codesign ${VERBOSE} ${KEYCHAIN_FLAG} -f -s "$CERTIFICATE" "$assetpack"
552
+ /usr/bin/codesign ${VERBOSE} --generate-entitlement-der ${KEYCHAIN_FLAG} -f -s "$CERTIFICATE" "$assetpack"
550
553
  checkStatus
551
554
  else
552
555
  log "Ignoring non-assetpack: $assetpack"
@@ -568,7 +571,7 @@ function resign {
568
571
  log "Resigning '$framework'"
569
572
  # Must not qote KEYCHAIN_FLAG because it needs to be unwrapped and passed to codesign with spaces
570
573
  # shellcheck disable=SC2086
571
- /usr/bin/codesign ${VERBOSE} ${KEYCHAIN_FLAG} -f -s "$CERTIFICATE" "$framework"
574
+ /usr/bin/codesign ${VERBOSE} --generate-entitlement-der ${KEYCHAIN_FLAG} -f -s "$CERTIFICATE" "$framework"
572
575
  checkStatus
573
576
  else
574
577
  log "Ignoring non-framework: $framework"
@@ -622,7 +625,7 @@ function resign {
622
625
  log "Creating an archived-expanded-entitlements.xcent file for Xcode 9 builds or earlier"
623
626
  cp -f "$ENTITLEMENTS" "$APP_PATH/archived-expanded-entitlements.xcent"
624
627
  fi
625
- /usr/bin/codesign ${VERBOSE} -f -s "$CERTIFICATE" --entitlements "$ENTITLEMENTS" "$APP_PATH"
628
+ /usr/bin/codesign ${VERBOSE} --generate-entitlement-der -f -s "$CERTIFICATE" --entitlements "$ENTITLEMENTS" "$APP_PATH"
626
629
  checkStatus
627
630
  elif [[ -n "${USE_APP_ENTITLEMENTS}" ]]; then
628
631
  # Extract entitlements from provisioning profile and from the app binary
@@ -644,7 +647,7 @@ function resign {
644
647
  # Get the old and new app identifier (prefix)
645
648
  APP_ID_KEY="application-identifier"
646
649
  # Extract just the identifier from the value
647
- # Use the fact that we are after some identifer, which is always at the start of the string
650
+ # Use the fact that we are after some identifier, which is always at the start of the string
648
651
  OLD_APP_ID=$(PlistBuddy -c "Print $APP_ID_KEY" "$APP_ENTITLEMENTS" | grep -E '^[A-Z0-9]*' -o | tr -d '\n')
649
652
  NEW_APP_ID=$(PlistBuddy -c "Print $APP_ID_KEY" "$PROFILE_ENTITLEMENTS" | grep -E '^[A-Z0-9]*' -o | tr -d '\n')
650
653
 
@@ -867,7 +870,7 @@ function resign {
867
870
  log "Creating an archived-expanded-entitlements.xcent file for Xcode 9 builds or earlier"
868
871
  cp -f "$PATCHED_ENTITLEMENTS" "$APP_PATH/archived-expanded-entitlements.xcent"
869
872
  fi
870
- /usr/bin/codesign ${VERBOSE} -f -s "$CERTIFICATE" --entitlements "$PATCHED_ENTITLEMENTS" "$APP_PATH"
873
+ /usr/bin/codesign ${VERBOSE} --generate-entitlement-der -f -s "$CERTIFICATE" --entitlements "$PATCHED_ENTITLEMENTS" "$APP_PATH"
871
874
  checkStatus
872
875
  else
873
876
  log "Extracting entitlements from provisioning profile"
@@ -881,7 +884,7 @@ function resign {
881
884
  fi
882
885
  # Must not qote KEYCHAIN_FLAG because it needs to be unwrapped and passed to codesign with spaces
883
886
  # shellcheck disable=SC2086
884
- /usr/bin/codesign ${VERBOSE} ${KEYCHAIN_FLAG} -f -s "$CERTIFICATE" --entitlements "$TEMP_DIR/newEntitlements" "$APP_PATH"
887
+ /usr/bin/codesign ${VERBOSE} --generate-entitlement-der ${KEYCHAIN_FLAG} -f -s "$CERTIFICATE" --entitlements "$TEMP_DIR/newEntitlements" "$APP_PATH"
885
888
  checkStatus
886
889
  fi
887
890
 
@@ -66,7 +66,7 @@ module Sigh
66
66
  end),
67
67
  FastlaneCore::ConfigItem.new(key: :api_key,
68
68
  env_names: ["SIGH_API_KEY", "APP_STORE_CONNECT_API_KEY"],
69
- description: "Your App Store Connect API Key information (https://docs.fastlane.tools/app-store-connect-api/#use-return-value-and-pass-in-as-an-option)",
69
+ description: "Your App Store Connect API Key information (https://docs.fastlane.tools/app-store-connect-api/#using-fastlane-api-key-hash-option)",
70
70
  type: Hash,
71
71
  optional: true,
72
72
  sensitive: true,
@@ -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",