fastlane 2.176.0 → 2.180.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (131) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/README.md +97 -84
  4. data/cert/lib/cert/options.rb +1 -0
  5. data/cert/lib/cert/runner.rb +5 -1
  6. data/deliver/lib/deliver/app_screenshot.rb +6 -2
  7. data/deliver/lib/deliver/download_screenshots.rb +1 -2
  8. data/deliver/lib/deliver/options.rb +1 -0
  9. data/deliver/lib/deliver/runner.rb +11 -3
  10. data/deliver/lib/deliver/setup.rb +0 -1
  11. data/deliver/lib/deliver/upload_metadata.rb +5 -4
  12. data/deliver/lib/deliver/upload_screenshots.rb +10 -10
  13. data/fastlane/lib/fastlane/.fastlane_require.rb.swp +0 -0
  14. data/fastlane/lib/fastlane/actions/.cocoapods.rb.swp +0 -0
  15. data/fastlane/lib/fastlane/actions/app_store_build_number.rb +6 -1
  16. data/fastlane/lib/fastlane/actions/app_store_connect_api_key.rb +8 -5
  17. data/fastlane/lib/fastlane/actions/appaloosa.rb +7 -2
  18. data/fastlane/lib/fastlane/actions/backup_file.rb +1 -1
  19. data/fastlane/lib/fastlane/actions/build_app.rb +4 -0
  20. data/fastlane/lib/fastlane/actions/check_app_store_metadata.rb +4 -0
  21. data/fastlane/lib/fastlane/actions/commit_github_file.rb +11 -1
  22. data/fastlane/lib/fastlane/actions/create_xcframework.rb +5 -0
  23. data/fastlane/lib/fastlane/actions/docs/upload_to_play_store.md +2 -1
  24. data/fastlane/lib/fastlane/actions/get_github_release.rb +11 -1
  25. data/fastlane/lib/fastlane/actions/get_provisioning_profile.rb +4 -0
  26. data/fastlane/lib/fastlane/actions/get_version_number.rb +17 -10
  27. data/fastlane/lib/fastlane/actions/git_branch.rb +4 -10
  28. data/fastlane/lib/fastlane/actions/git_tag_exists.rb +4 -0
  29. data/fastlane/lib/fastlane/actions/github_api.rb +2 -1
  30. data/fastlane/lib/fastlane/actions/increment_build_number.rb +8 -1
  31. data/fastlane/lib/fastlane/actions/install_provisioning_profile.rb +4 -0
  32. data/fastlane/lib/fastlane/actions/jira.rb +61 -14
  33. data/fastlane/lib/fastlane/actions/latest_testflight_build_number.rb +1 -0
  34. data/fastlane/lib/fastlane/actions/match_nuke.rb +59 -0
  35. data/fastlane/lib/fastlane/actions/notarize.rb +98 -51
  36. data/fastlane/lib/fastlane/actions/push_to_git_remote.rb +0 -1
  37. data/fastlane/lib/fastlane/actions/register_device.rb +1 -1
  38. data/fastlane/lib/fastlane/actions/register_devices.rb +1 -1
  39. data/fastlane/lib/fastlane/actions/restore_file.rb +1 -1
  40. data/fastlane/lib/fastlane/actions/set_changelog.rb +1 -1
  41. data/fastlane/lib/fastlane/actions/sourcedocs.rb +164 -0
  42. data/fastlane/lib/fastlane/actions/spaceship_logs.rb +1 -1
  43. data/fastlane/lib/fastlane/actions/update_project_provisioning.rb +1 -2
  44. data/fastlane/lib/fastlane/actions/upload_symbols_to_crashlytics.rb +4 -5
  45. data/fastlane/lib/fastlane/erb_template_helper.rb +7 -1
  46. data/fastlane/lib/fastlane/fast_file.rb +9 -5
  47. data/fastlane/lib/fastlane/fastlane_require.rb +7 -1
  48. data/fastlane/lib/fastlane/helper/git_helper.rb +11 -7
  49. data/fastlane/lib/fastlane/plugins/plugin_fetcher.rb +1 -2
  50. data/fastlane/lib/fastlane/plugins/plugin_info_collector.rb +1 -2
  51. data/fastlane/lib/fastlane/plugins/plugin_manager.rb +1 -2
  52. data/fastlane/lib/fastlane/setup/setup.rb +23 -10
  53. data/fastlane/lib/fastlane/swift_fastlane_function.rb +4 -0
  54. data/fastlane/lib/fastlane/swift_runner_upgrader.rb +2 -0
  55. data/fastlane/lib/fastlane/version.rb +1 -1
  56. data/fastlane/swift/Deliverfile.swift +1 -1
  57. data/fastlane/swift/DeliverfileProtocol.swift +3 -3
  58. data/fastlane/swift/Fastlane.swift +557 -326
  59. data/fastlane/swift/Gymfile.swift +1 -1
  60. data/fastlane/swift/GymfileProtocol.swift +1 -1
  61. data/fastlane/swift/LaneFileProtocol.swift +9 -3
  62. data/fastlane/swift/Matchfile.swift +1 -1
  63. data/fastlane/swift/MatchfileProtocol.swift +1 -1
  64. data/fastlane/swift/Precheckfile.swift +1 -1
  65. data/fastlane/swift/PrecheckfileProtocol.swift +3 -3
  66. data/fastlane/swift/RubyCommand.swift +1 -1
  67. data/fastlane/swift/Scanfile.swift +1 -1
  68. data/fastlane/swift/ScanfileProtocol.swift +9 -1
  69. data/fastlane/swift/Screengrabfile.swift +1 -1
  70. data/fastlane/swift/ScreengrabfileProtocol.swift +1 -1
  71. data/fastlane/swift/Snapshotfile.swift +1 -1
  72. data/fastlane/swift/SnapshotfileProtocol.swift +1 -1
  73. data/fastlane/swift/SocketClient.swift +2 -1
  74. data/fastlane/swift/SocketResponse.swift +4 -2
  75. data/fastlane/swift/formatting/Brewfile.lock.json +13 -13
  76. data/fastlane_core/lib/fastlane_core.rb +1 -0
  77. data/fastlane_core/lib/fastlane_core/configuration/configuration.rb +5 -3
  78. data/fastlane_core/lib/fastlane_core/helper.rb +24 -1
  79. data/fastlane_core/lib/fastlane_core/ipa_upload_package_builder.rb +3 -2
  80. data/fastlane_core/lib/fastlane_core/itunes_transporter.rb +14 -8
  81. data/fastlane_core/lib/fastlane_core/pkg_upload_package_builder.rb +3 -2
  82. data/fastlane_core/lib/fastlane_core/project.rb +3 -14
  83. data/{deliver/lib/deliver → fastlane_core/lib/fastlane_core}/queue_worker.rb +4 -4
  84. data/fastlane_core/lib/fastlane_core/ui/implementations/shell.rb +12 -1
  85. data/fastlane_core/lib/fastlane_core/ui/interface.rb +1 -1
  86. data/gym/lib/gym/generators/.package_command_generator_xcode7.rb.swp +0 -0
  87. data/gym/lib/gym/generators/package_command_generator.rb +4 -0
  88. data/gym/lib/gym/generators/package_command_generator_xcode7.rb +13 -8
  89. data/gym/lib/gym/runner.rb +11 -4
  90. data/match/lib/match/change_password.rb +3 -3
  91. data/match/lib/match/encryption/interface.rb +1 -1
  92. data/match/lib/match/encryption/openssl.rb +2 -2
  93. data/match/lib/match/importer.rb +1 -1
  94. data/match/lib/match/migrate.rb +1 -1
  95. data/match/lib/match/module.rb +1 -0
  96. data/match/lib/match/nuke.rb +1 -1
  97. data/match/lib/match/runner.rb +1 -1
  98. data/match/lib/match/storage/google_cloud_storage.rb +1 -1
  99. data/match/lib/match/storage/s3_storage.rb +1 -1
  100. data/pilot/lib/pilot/build_manager.rb +18 -6
  101. data/pilot/lib/pilot/manager.rb +5 -1
  102. data/pilot/lib/pilot/options.rb +3 -2
  103. data/precheck/lib/precheck/options.rb +1 -0
  104. data/precheck/lib/precheck/runner.rb +5 -1
  105. data/scan/lib/scan/detect_values.rb +4 -1
  106. data/scan/lib/scan/options.rb +15 -5
  107. data/scan/lib/scan/runner.rb +52 -1
  108. data/scan/lib/scan/test_command_generator.rb +8 -8
  109. data/screengrab/lib/screengrab/android_environment.rb +6 -4
  110. data/screengrab/lib/screengrab/runner.rb +1 -1
  111. data/sigh/lib/sigh/download_all.rb +1 -1
  112. data/sigh/lib/sigh/options.rb +1 -0
  113. data/sigh/lib/sigh/runner.rb +5 -1
  114. data/snapshot/lib/assets/SnapshotHelper.swift +1 -1
  115. data/snapshot/lib/snapshot/simulator_launchers/simulator_launcher_base.rb +2 -1
  116. data/spaceship/lib/spaceship/client.rb +18 -17
  117. data/spaceship/lib/spaceship/connect_api/api_client.rb +24 -6
  118. data/spaceship/lib/spaceship/connect_api/models/app.rb +1 -1
  119. data/spaceship/lib/spaceship/connect_api/models/app_preview_set.rb +5 -0
  120. data/spaceship/lib/spaceship/connect_api/models/app_screenshot.rb +1 -1
  121. data/spaceship/lib/spaceship/connect_api/models/app_screenshot_set.rb +5 -0
  122. data/spaceship/lib/spaceship/connect_api/models/app_store_version_localization.rb +6 -0
  123. data/spaceship/lib/spaceship/connect_api/models/beta_group.rb +5 -0
  124. data/spaceship/lib/spaceship/connect_api/models/build.rb +5 -0
  125. data/spaceship/lib/spaceship/connect_api/models/build_beta_detail.rb +4 -0
  126. data/spaceship/lib/spaceship/connect_api/models/user_invitation.rb +13 -0
  127. data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +13 -0
  128. data/spaceship/lib/spaceship/connect_api/token.rb +8 -2
  129. data/spaceship/lib/spaceship/connect_api/tunes/tunes.rb +15 -0
  130. metadata +28 -22
  131. data/pilot/lib/pilot/.build_manager.rb.swp +0 -0
@@ -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.176.0
20
+ // Generated with fastlane 2.180.1
@@ -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.62]
199
+ // FastlaneRunnerAPIVersion [0.9.67]
@@ -17,20 +17,20 @@ public protocol LaneFileProtocol: class {
17
17
  func recordLaneDescriptions()
18
18
  func beforeAll(with lane: String)
19
19
  func afterAll(with lane: String)
20
- func onError(currentLane: String, errorInfo: String)
20
+ func onError(currentLane: String, errorInfo: String, errorClass: String?, errorMessage: String?)
21
21
  }
22
22
 
23
23
  public extension LaneFileProtocol {
24
24
  var fastlaneVersion: String { return "" } // Defaults to "" because that means any is fine
25
25
  func beforeAll(with _: String) {} // No-op by default
26
26
  func afterAll(with _: String) {} // No-op by default
27
- func onError(currentLane _: String, errorInfo _: String) {} // No-op by default
28
27
  func recordLaneDescriptions() {} // No-op by default
29
28
  }
30
29
 
31
30
  @objcMembers
32
31
  open class LaneFile: NSObject, LaneFileProtocol {
33
32
  private(set) static var fastfileInstance: LaneFile?
33
+ private static var onErrorCalled = Set<String>()
34
34
 
35
35
  private static func trimLaneFromName(laneName: String) -> String {
36
36
  return String(laneName.prefix(laneName.count - 4))
@@ -40,6 +40,10 @@ open class LaneFile: NSObject, LaneFileProtocol {
40
40
  return String(laneName.prefix(laneName.count - 12))
41
41
  }
42
42
 
43
+ public func onError(currentLane: String, errorInfo _: String, errorClass _: String?, errorMessage _: String?) {
44
+ LaneFile.onErrorCalled.insert(currentLane)
45
+ }
46
+
43
47
  private static var laneFunctionNames: [String] {
44
48
  var lanes: [String] = []
45
49
  var methodCount: UInt32 = 0
@@ -137,7 +141,9 @@ open class LaneFile: NSObject, LaneFileProtocol {
137
141
  _ = fastfileInstance.perform(NSSelectorFromString(laneMethod), with: parameters)
138
142
 
139
143
  // Call only on success.
140
- fastfileInstance.afterAll(with: lane)
144
+ if !LaneFile.onErrorCalled.contains(lane) {
145
+ fastfileInstance.afterAll(with: lane)
146
+ }
141
147
 
142
148
  log(message: "Done running lane: \(lane) 🚀")
143
149
  return true
@@ -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.176.0
20
+ // Generated with fastlane 2.180.1
@@ -184,4 +184,4 @@ public extension MatchfileProtocol {
184
184
 
185
185
  // Please don't remove the lines below
186
186
  // They are used to detect outdated files
187
- // FastlaneRunnerAPIVersion [0.9.56]
187
+ // FastlaneRunnerAPIVersion [0.9.61]
@@ -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.176.0
20
+ // Generated with fastlane 2.180.1
@@ -12,7 +12,7 @@ public protocol PrecheckfileProtocol: class {
12
12
  var appIdentifier: String { get }
13
13
 
14
14
  /// Your Apple ID Username
15
- var username: String { get }
15
+ var username: String? { get }
16
16
 
17
17
  /// The ID of your App Store Connect team if you're in multiple teams
18
18
  var teamId: String? { get }
@@ -40,7 +40,7 @@ public extension PrecheckfileProtocol {
40
40
  var apiKeyPath: String? { return nil }
41
41
  var apiKey: [String: Any]? { return nil }
42
42
  var appIdentifier: String { return "" }
43
- var username: String { return "" }
43
+ var username: String? { return nil }
44
44
  var teamId: String? { return nil }
45
45
  var teamName: String? { return nil }
46
46
  var platform: String { return "ios" }
@@ -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.55]
55
+ // FastlaneRunnerAPIVersion [0.9.60]
@@ -51,7 +51,7 @@ struct RubyCommand: RubyCommandable {
51
51
  if type == .stringClosure {
52
52
  return "{\"name\" : \"\(name)\", \"value\" : \"ignored_for_closure\"\(typeJson)}"
53
53
  } else if let array = someValue as? [String] {
54
- return "{\"name\" : \"\(name)\", \"value\" : \"\(array.joined(separator: ","))\"\(typeJson)}"
54
+ return "{\"name\" : \"\(name)\", \"value\" : \(array)\(typeJson)}"
55
55
  } else if let hash = someValue as? [String: Any] {
56
56
  let jsonData = try! JSONSerialization.data(withJSONObject: hash, options: [])
57
57
  let jsonString = String(data: jsonData, encoding: .utf8)!
@@ -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.176.0
20
+ // Generated with fastlane 2.180.1
@@ -20,6 +20,9 @@ public protocol ScanfileProtocol: class {
20
20
  /// Should skip auto detecting of devices if none were specified
21
21
  var skipDetectDevices: Bool { get }
22
22
 
23
+ /// Should fail if devices not found
24
+ var ensureDevicesFound: Bool { get }
25
+
23
26
  /// Enabling this option will automatically killall Simulator processes before the run
24
27
  var forceQuitSimulator: Bool { get }
25
28
 
@@ -206,6 +209,9 @@ public protocol ScanfileProtocol: class {
206
209
  /// Lets xcodebuild use system's scm configuration
207
210
  var useSystemScm: Bool { get }
208
211
 
212
+ /// The number of times a test can fail before scan should stop retrying
213
+ var numberOfRetries: Int { get }
214
+
209
215
  /// Should this step stop the build if the tests fail? Set this to false if you're using trainer
210
216
  var failBuild: Bool { get }
211
217
  }
@@ -217,6 +223,7 @@ public extension ScanfileProtocol {
217
223
  var device: String? { return nil }
218
224
  var devices: [String]? { return nil }
219
225
  var skipDetectDevices: Bool { return false }
226
+ var ensureDevicesFound: Bool { return false }
220
227
  var forceQuitSimulator: Bool { return false }
221
228
  var resetSimulator: Bool { return false }
222
229
  var disableSlideToType: Bool { return true }
@@ -279,9 +286,10 @@ public extension ScanfileProtocol {
279
286
  var skipPackageDependenciesResolution: Bool { return false }
280
287
  var disablePackageAutomaticUpdates: Bool { return false }
281
288
  var useSystemScm: Bool { return false }
289
+ var numberOfRetries: Int { return 0 }
282
290
  var failBuild: Bool { return true }
283
291
  }
284
292
 
285
293
  // Please don't remove the lines below
286
294
  // They are used to detect outdated files
287
- // FastlaneRunnerAPIVersion [0.9.67]
295
+ // FastlaneRunnerAPIVersion [0.9.72]
@@ -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.176.0
20
+ // Generated with fastlane 2.180.1
@@ -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.57]
99
+ // FastlaneRunnerAPIVersion [0.9.62]
@@ -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.176.0
20
+ // Generated with fastlane 2.180.1
@@ -196,4 +196,4 @@ public extension SnapshotfileProtocol {
196
196
 
197
197
  // Please don't remove the lines below
198
198
  // They are used to detect outdated files
199
- // FastlaneRunnerAPIVersion [0.9.51]
199
+ // FastlaneRunnerAPIVersion [0.9.56]
@@ -302,7 +302,8 @@ extension SocketClient: StreamDelegate {
302
302
  self.closeSession(sendAbort: false)
303
303
  }
304
304
 
305
- case let .failure(failureInformation):
305
+ case let .failure(failureInformation, failureClass, failureMessage):
306
+ LaneFile.fastfileInstance?.onError(currentLane: ArgumentProcessor(args: CommandLine.arguments).currentLane, errorInfo: failureInformation.joined(), errorClass: failureClass, errorMessage: failureMessage)
306
307
  socketDelegate?.commandExecuted(serverResponse: .serverError) {
307
308
  $0.writeSemaphore.signal()
308
309
  self.handleFailure(message: failureInformation)
@@ -13,7 +13,7 @@ import Foundation
13
13
  struct SocketResponse {
14
14
  enum ResponseType {
15
15
  case parseFailure(failureInformation: [String])
16
- case failure(failureInformation: [String])
16
+ case failure(failureInformation: [String], failureClass: String?, failureMessage: String?)
17
17
  case readyForNext(returnedObject: String?, closureArgumentValue: String?)
18
18
  case clientInitiatedCancel
19
19
 
@@ -40,7 +40,9 @@ struct SocketResponse {
40
40
  return
41
41
  }
42
42
 
43
- self = .failure(failureInformation: failureInformation)
43
+ let failureClass = statusDictionary["failure_class"] as? String
44
+ let failureMessage = statusDictionary["failure_message"] as? String
45
+ self = .failure(failureInformation: failureInformation, failureClass: failureClass, failureMessage: failureMessage)
44
46
  return
45
47
  }
46
48
  self = .parseFailure(failureInformation: ["Message status: \(status) not a supported status"])
@@ -2,28 +2,28 @@
2
2
  "entries": {
3
3
  "brew": {
4
4
  "swiftformat": {
5
- "version": "0.47.11",
5
+ "version": "0.47.13",
6
6
  "bottle": {
7
7
  "rebuild": 0,
8
8
  "cellar": ":any_skip_relocation",
9
9
  "prefix": "/usr/local",
10
- "root_url": "https://homebrew.bintray.com/bottles",
10
+ "root_url": "https://ghcr.io/v2/homebrew/core",
11
11
  "files": {
12
12
  "arm64_big_sur": {
13
- "url": "https://homebrew.bintray.com/bottles/swiftformat-0.47.11.arm64_big_sur.bottle.tar.gz",
14
- "sha256": "65a20f75d4a9e2837dfc60318e312893b99f2a957a7f3a9a137b326c87dc29ff"
13
+ "url": "https://ghcr.io/v2/homebrew/core/swiftformat-0.47.13.arm64_big_sur.bottle.tar.gz",
14
+ "sha256": "fdcdb5e94b9c4d66a32d4515ba3d2db4057865f96aefab0e41fdeaf2879f4f89"
15
15
  },
16
16
  "big_sur": {
17
- "url": "https://homebrew.bintray.com/bottles/swiftformat-0.47.11.big_sur.bottle.tar.gz",
18
- "sha256": "0b4c55f9316fbf40c9eab826536df17eb0249484772c372a962a189e0d1a7fd2"
17
+ "url": "https://ghcr.io/v2/homebrew/core/swiftformat-0.47.13.big_sur.bottle.tar.gz",
18
+ "sha256": "cbb7a9803926d8bfaacf5c1a7d4cd07d8fe2255b1885be3ae2ffd8414e4c5292"
19
19
  },
20
20
  "catalina": {
21
- "url": "https://homebrew.bintray.com/bottles/swiftformat-0.47.11.catalina.bottle.tar.gz",
22
- "sha256": "3b7bc3e4e6f150ecdd298be109d13ef9e84a56a45c580113c7a6b151fe1615da"
21
+ "url": "https://ghcr.io/v2/homebrew/core/swiftformat-0.47.13.catalina.bottle.tar.gz",
22
+ "sha256": "3a13e9b1f4a63bc03601897944f71dd4e6942788531dc060322d20fc6b36d2fd"
23
23
  },
24
24
  "mojave": {
25
- "url": "https://homebrew.bintray.com/bottles/swiftformat-0.47.11.mojave.bottle.tar.gz",
26
- "sha256": "24bdfac40c16c1e40bbe970eedb9450cd3099890188b8d6bdd0fe2447d54ce48"
25
+ "url": "https://ghcr.io/v2/homebrew/core/swiftformat-0.47.13.mojave.bottle.tar.gz",
26
+ "sha256": "4e0691f12a5ef3b01eba9f41091b8f3457bc65151bfad057a45e8de9525074cd"
27
27
  }
28
28
  }
29
29
  }
@@ -33,10 +33,10 @@
33
33
  "system": {
34
34
  "macos": {
35
35
  "catalina": {
36
- "HOMEBREW_VERSION": "3.0.2",
36
+ "HOMEBREW_VERSION": "3.0.11-97-gf2e3967",
37
37
  "HOMEBREW_PREFIX": "/usr/local",
38
- "Homebrew/homebrew-core": "372d8a99773af6b309354856d1295825ab43d7e0",
39
- "CLT": "11.0.33.12",
38
+ "Homebrew/homebrew-core": "2d17ff8f7874287712dd983c97ea13878c6797b8",
39
+ "CLT": "11.0.0.33.12",
40
40
  "Xcode": "12.2",
41
41
  "macOS": "10.15.7"
42
42
  },
@@ -35,6 +35,7 @@ require_relative 'fastlane_core/analytics/analytics_ingester_client'
35
35
  require_relative 'fastlane_core/analytics/analytics_session'
36
36
  require_relative 'fastlane_core/tag_version'
37
37
  require_relative 'fastlane_core/fastlane_pty'
38
+ require_relative 'fastlane_core/queue_worker'
38
39
 
39
40
  # Third Party code
40
41
  require 'colored'
@@ -208,8 +208,10 @@ module FastlaneCore
208
208
  #####################################################
209
209
 
210
210
  # Returns the value for a certain key. fastlane_core tries to fetch the value from different sources
211
- # if 'ask' is true and the value is not present, the user will be prompted to provide a value
212
- def fetch(key, ask: true)
211
+ # if 'ask' is true and the value is not present, the user will be prompted to provide a value if optional
212
+ # if 'force_ask' is true, the option is not required to be optional to ask
213
+ # rubocop:disable Metrics/PerceivedComplexity
214
+ def fetch(key, ask: true, force_ask: false)
213
215
  UI.crash!("Key '#{key}' must be a symbol. Example :app_id.") unless key.kind_of?(Symbol)
214
216
 
215
217
  option = verify_options_key!(key)
@@ -227,7 +229,7 @@ module FastlaneCore
227
229
 
228
230
  value = option.auto_convert_value(value)
229
231
  value = nil if value.nil? && !option.string? # by default boolean flags are false
230
- return value unless value.nil? && !option.optional && ask
232
+ return value unless value.nil? && (!option.optional || force_ask) && ask
231
233
 
232
234
  # fallback to asking
233
235
  if Helper.test? || !UI.interactive?
@@ -75,7 +75,7 @@ module FastlaneCore
75
75
 
76
76
  # Check for Jenkins, Travis CI, ... environment variables
77
77
  ['JENKINS_HOME', 'JENKINS_URL', 'TRAVIS', 'CI', 'APPCENTER_BUILD_ID', 'TEAMCITY_VERSION', 'GO_PIPELINE_NAME', 'bamboo_buildKey', 'GITLAB_CI', 'XCS', 'TF_BUILD', 'GITHUB_ACTION', 'GITHUB_ACTIONS', 'BITRISE_IO', 'BUDDY'].each do |current|
78
- return true if ENV.key?(current)
78
+ return true if FastlaneCore::Env.truthy?(current)
79
79
  end
80
80
  return false
81
81
  end
@@ -377,6 +377,8 @@ module FastlaneCore
377
377
 
378
378
  # returns the path of the executable with the correct extension on Windows
379
379
  def self.get_executable_path(cmd_path)
380
+ cmd_path = localize_file_path(cmd_path)
381
+
380
382
  if self.windows?
381
383
  # PATHEXT contains the list of file extensions that Windows considers executable, semicolon separated.
382
384
  # e.g. ".COM;.EXE;.BAT;.CMD"
@@ -393,6 +395,12 @@ module FastlaneCore
393
395
  return cmd_path
394
396
  end
395
397
 
398
+ # returns the path with the platform-specific path separator (`/` on UNIX, `\` on Windows)
399
+ def self.localize_file_path(path)
400
+ # change `/` to `\` on Windows
401
+ return self.windows? ? path.gsub('/', '\\') : path
402
+ end
403
+
396
404
  # checks if given file is a valid json file
397
405
  # base taken from: http://stackoverflow.com/a/26235831/1945875
398
406
  def self.json_file?(filename)
@@ -462,5 +470,20 @@ module FastlaneCore
462
470
  UI.error("Your entries do not match. Please try again")
463
471
  end
464
472
  end
473
+
474
+ # URI.open added by `require 'open-uri'` is not available in Ruby 2.4. This helper lets you open a URI
475
+ # by choosing appropriate interface to do so depending on Ruby version. This helper is subject to be removed
476
+ # when fastlane drops Ruby 2.4 support.
477
+ def self.open_uri(*rest, &block)
478
+ require 'open-uri'
479
+
480
+ if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.5')
481
+ dup = rest.dup
482
+ uri = dup.shift
483
+ URI.parse(uri).open(*dup, &block)
484
+ else
485
+ URI.open(*rest, &block)
486
+ end
487
+ end
465
488
  end
466
489
  end
@@ -1,4 +1,5 @@
1
1
  require "digest/md5"
2
+ require 'securerandom'
2
3
 
3
4
  require_relative 'globals'
4
5
  require_relative 'ui/ui'
@@ -12,7 +13,7 @@ module FastlaneCore
12
13
  attr_accessor :package_path
13
14
 
14
15
  def generate(app_id: nil, ipa_path: nil, package_path: nil, platform: nil)
15
- self.package_path = File.join(package_path, "#{app_id}.itmsp")
16
+ self.package_path = File.join(package_path, "#{app_id}-#{SecureRandom.uuid}.itmsp")
16
17
  FileUtils.rm_rf(self.package_path) if File.directory?(self.package_path)
17
18
  FileUtils.mkdir_p(self.package_path)
18
19
 
@@ -32,7 +33,7 @@ module FastlaneCore
32
33
  File.write(File.join(self.package_path, METADATA_FILE_NAME), xml)
33
34
  UI.success("Wrote XML data to '#{self.package_path}'") if FastlaneCore::Globals.verbose?
34
35
 
35
- return package_path
36
+ return self.package_path
36
37
  end
37
38
 
38
39
  def unique_ipa_path(ipa_path)
@@ -94,6 +94,10 @@ module FastlaneCore
94
94
  return exit_status.zero?
95
95
  end
96
96
 
97
+ def displayable_errors
98
+ @errors.map { |error| "[Transporter Error Output]: #{error}" }.join("\n").gsub!(/"/, "")
99
+ end
100
+
97
101
  private
98
102
 
99
103
  def parse_line(line, hide_output)
@@ -107,7 +111,6 @@ module FastlaneCore
107
111
 
108
112
  elsif line =~ ERROR_REGEX
109
113
  @errors << $1
110
- UI.error("[Transporter Error Output]: #{$1}")
111
114
 
112
115
  # Check if it's a login error
113
116
  if $1.include?("Your Apple ID or password was entered incorrectly") ||
@@ -117,9 +120,6 @@ module FastlaneCore
117
120
  CredentialsManager::AccountManager.new(user: @user).invalid_credentials
118
121
  UI.error("Please run this tool again to apply the new password")
119
122
  end
120
- elsif $1.include?("Redundant Binary Upload. There already exists a binary upload with build")
121
- UI.error($1)
122
- UI.error("You have to change the build number of your app to upload your ipa file")
123
123
  end
124
124
 
125
125
  output_done = true
@@ -471,11 +471,13 @@ module FastlaneCore
471
471
  # Uploads the modified package back to App Store Connect
472
472
  # @param app_id [Integer] The unique App ID
473
473
  # @param dir [String] the path in which the package file is located
474
+ # @param package_path [String] the path to the package file (used instead of app_id and dir)
474
475
  # @return (Bool) True if everything worked fine
475
476
  # @raise [Deliver::TransporterTransferError] when something went wrong
476
477
  # when transferring
477
- def upload(app_id, dir)
478
- actual_dir = File.join(dir, "#{app_id}.itmsp")
478
+ def upload(app_id = nil, dir = nil, package_path: nil)
479
+ raise "app_id and dir are required or package_path is required" if (app_id.nil? || dir.nil?) && package_path.nil?
480
+ actual_dir = package_path || File.join(dir, "#{app_id}.itmsp")
479
481
 
480
482
  UI.message("Going to upload updated app to App Store Connect")
481
483
  UI.success("This might take a few minutes. Please don't interrupt the script.")
@@ -490,7 +492,7 @@ module FastlaneCore
490
492
  result = @transporter_executor.execute(command, ItunesTransporter.hide_transporter_output?)
491
493
  rescue TransporterRequiresApplicationSpecificPasswordError => ex
492
494
  handle_two_step_failure(ex)
493
- return upload(app_id, dir)
495
+ return upload(app_id, dir, package_path: package_path)
494
496
  end
495
497
 
496
498
  if result
@@ -501,7 +503,11 @@ module FastlaneCore
501
503
  handle_error(@password)
502
504
  end
503
505
 
504
- result
506
+ return result
507
+ end
508
+
509
+ def displayable_errors
510
+ @transporter_executor.displayable_errors
505
511
  end
506
512
 
507
513
  def provider_ids