fastlane 2.150.3 → 2.151.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +86 -86
  3. data/deliver/lib/deliver/options.rb +7 -1
  4. data/deliver/lib/deliver/submit_for_review.rb +7 -7
  5. data/deliver/lib/deliver/upload_metadata.rb +2 -2
  6. data/fastlane/lib/fastlane/actions/docs/upload_to_testflight.md +3 -0
  7. data/fastlane/lib/fastlane/actions/notarize.rb +13 -3
  8. data/fastlane/lib/fastlane/actions/pod_push.rb +10 -1
  9. data/fastlane/lib/fastlane/actions/resign.rb +1 -1
  10. data/fastlane/lib/fastlane/actions/setup_ci.rb +5 -0
  11. data/fastlane/lib/fastlane/actions/setup_circle_ci.rb +1 -1
  12. data/fastlane/lib/fastlane/actions/setup_travis.rb +1 -1
  13. data/fastlane/lib/fastlane/actions/upload_symbols_to_crashlytics.rb +10 -2
  14. data/fastlane/lib/fastlane/documentation/docs_generator.rb +1 -1
  15. data/fastlane/lib/fastlane/helper/s3_client_helper.rb +28 -11
  16. data/fastlane/lib/fastlane/server/socket_server.rb +7 -1
  17. data/fastlane/lib/fastlane/swift_fastlane_function.rb +1 -1
  18. data/fastlane/lib/fastlane/version.rb +1 -1
  19. data/fastlane/swift/Actions.swift +1 -1
  20. data/fastlane/swift/ArgumentProcessor.swift +24 -24
  21. data/fastlane/swift/ControlCommand.swift +3 -3
  22. data/fastlane/swift/Deliverfile.swift +4 -8
  23. data/fastlane/swift/DeliverfileProtocol.swift +181 -182
  24. data/fastlane/swift/Fastlane.swift +2813 -2802
  25. data/fastlane/swift/Gymfile.swift +4 -8
  26. data/fastlane/swift/GymfileProtocol.swift +133 -134
  27. data/fastlane/swift/LaneFileProtocol.swift +17 -17
  28. data/fastlane/swift/Matchfile.swift +4 -8
  29. data/fastlane/swift/MatchfileProtocol.swift +115 -112
  30. data/fastlane/swift/Plugins.swift +1 -1
  31. data/fastlane/swift/Precheckfile.swift +4 -8
  32. data/fastlane/swift/PrecheckfileProtocol.swift +22 -23
  33. data/fastlane/swift/RubyCommand.swift +34 -37
  34. data/fastlane/swift/RubyCommandable.swift +3 -1
  35. data/fastlane/swift/Runner.swift +76 -69
  36. data/fastlane/swift/Scanfile.swift +4 -8
  37. data/fastlane/swift/ScanfileProtocol.swift +190 -191
  38. data/fastlane/swift/Screengrabfile.swift +4 -8
  39. data/fastlane/swift/ScreengrabfileProtocol.swift +67 -68
  40. data/fastlane/swift/Snapshotfile.swift +4 -8
  41. data/fastlane/swift/SnapshotfileProtocol.swift +127 -128
  42. data/fastlane/swift/SocketClient.swift +84 -90
  43. data/fastlane/swift/SocketResponse.swift +14 -14
  44. data/fastlane/swift/formatting/Brewfile +1 -0
  45. data/fastlane/swift/formatting/Brewfile.lock.json +39 -0
  46. data/fastlane/swift/formatting/Rakefile +18 -0
  47. data/fastlane/swift/main.swift +5 -6
  48. data/fastlane_core/lib/fastlane_core/itunes_transporter.rb +15 -7
  49. data/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb +1 -1
  50. data/match/lib/assets/READMETemplate.md +5 -2
  51. data/match/lib/match/options.rb +4 -0
  52. data/match/lib/match/runner.rb +1 -0
  53. data/match/lib/match/storage/git_storage.rb +1 -1
  54. data/match/lib/match/storage/s3_storage.rb +25 -7
  55. data/sigh/lib/assets/resign.sh +18 -0
  56. data/spaceship/lib/spaceship/client.rb +1 -2
  57. data/spaceship/lib/spaceship/connect_api/client.rb +0 -1
  58. data/spaceship/lib/spaceship/connect_api/models/app_store_version.rb +1 -1
  59. metadata +31 -38
  60. data/deliver/lib/deliver/.upload_metadata.rb.swp +0 -0
  61. data/spaceship/lib/spaceship/babosa_fix.rb +0 -30
@@ -12,8 +12,8 @@
12
12
  // new group so that it won't be marked for upgrade
13
13
  //
14
14
 
15
- import Foundation
16
15
  import Dispatch
16
+ import Foundation
17
17
 
18
18
  public enum SocketClientResponse: Error {
19
19
  case alreadyClosedSockets
@@ -27,17 +27,16 @@ public enum SocketClientResponse: Error {
27
27
  }
28
28
 
29
29
  class SocketClient: NSObject {
30
-
31
30
  enum SocketStatus {
32
31
  case ready
33
32
  case closed
34
33
  }
35
-
34
+
36
35
  static let connectTimeoutSeconds = 2
37
36
  static let defaultCommandTimeoutSeconds = 10_800 // 3 hours
38
37
  static let doneToken = "done" // TODO: remove these
39
38
  static let cancelToken = "cancelFastlaneRun"
40
-
39
+
41
40
  fileprivate var inputStream: InputStream!
42
41
  fileprivate var outputStream: OutputStream!
43
42
  fileprivate var cleaningUpAfterDone = false
@@ -45,104 +44,104 @@ class SocketClient: NSObject {
45
44
  fileprivate let readSemaphore = DispatchSemaphore(value: 1)
46
45
  fileprivate let writeSemaphore = DispatchSemaphore(value: 1)
47
46
  fileprivate let commandTimeoutSeconds: Int
48
-
47
+
49
48
  private let writeQueue: DispatchQueue
50
49
  private let readQueue: DispatchQueue
51
50
  private let streamQueue: DispatchQueue
52
51
  private let host: String
53
52
  private let port: UInt32
54
53
 
55
- let maxReadLength = 65_536 // max for ipc on 10.12 is kern.ipc.maxsockbuf: 8388608 ($sysctl kern.ipc.maxsockbuf)
56
-
57
- weak private(set) var socketDelegate: SocketClientDelegateProtocol?
58
-
54
+ let maxReadLength = 65536 // max for ipc on 10.12 is kern.ipc.maxsockbuf: 8388608 ($sysctl kern.ipc.maxsockbuf)
55
+
56
+ private(set) weak var socketDelegate: SocketClientDelegateProtocol?
57
+
59
58
  public private(set) var socketStatus: SocketStatus
60
-
59
+
61
60
  // localhost only, this prevents other computers from connecting
62
61
  init(host: String = "localhost", port: UInt32 = 2000, commandTimeoutSeconds: Int = defaultCommandTimeoutSeconds, socketDelegate: SocketClientDelegateProtocol) {
63
62
  self.host = host
64
63
  self.port = port
65
64
  self.commandTimeoutSeconds = commandTimeoutSeconds
66
- self.readQueue = DispatchQueue(label: "readQueue", qos: .background, attributes: .concurrent)
67
- self.writeQueue = DispatchQueue(label: "writeQueue", qos: .background, attributes: .concurrent)
68
- self.streamQueue = DispatchQueue.global(qos: .background)
69
- self.socketStatus = .closed
65
+ readQueue = DispatchQueue(label: "readQueue", qos: .background, attributes: .concurrent)
66
+ writeQueue = DispatchQueue(label: "writeQueue", qos: .background, attributes: .concurrent)
67
+ streamQueue = DispatchQueue.global(qos: .background)
68
+ socketStatus = .closed
70
69
  self.socketDelegate = socketDelegate
71
70
  super.init()
72
71
  }
73
-
72
+
74
73
  func connectAndOpenStreams() {
75
74
  var readStream: Unmanaged<CFReadStream>?
76
75
  var writeStream: Unmanaged<CFWriteStream>?
77
-
78
- self.streamQueue.sync {
76
+
77
+ streamQueue.sync {
79
78
  CFStreamCreatePairWithSocketToHost(kCFAllocatorDefault, self.host as CFString, self.port, &readStream, &writeStream)
80
-
79
+
81
80
  self.inputStream = readStream!.takeRetainedValue()
82
81
  self.outputStream = writeStream!.takeRetainedValue()
83
-
82
+
84
83
  self.inputStream.delegate = self
85
84
  self.outputStream.delegate = self
86
-
85
+
87
86
  self.inputStream.schedule(in: .main, forMode: .defaultRunLoopMode)
88
87
  self.outputStream.schedule(in: .main, forMode: .defaultRunLoopMode)
89
88
  }
90
-
91
- self.dispatchGroup.enter()
92
- self.readQueue.sync {
89
+
90
+ dispatchGroup.enter()
91
+ readQueue.sync {
93
92
  self.inputStream.open()
94
93
  }
95
-
96
- self.dispatchGroup.enter()
97
- self.writeQueue.sync {
94
+
95
+ dispatchGroup.enter()
96
+ writeQueue.sync {
98
97
  self.outputStream.open()
99
98
  }
100
-
99
+
101
100
  let secondsToWait = DispatchTimeInterval.seconds(SocketClient.connectTimeoutSeconds)
102
101
  let connectTimeout = DispatchTime.now() + secondsToWait
103
-
104
- let timeoutResult = self.dispatchGroup.wait(timeout: connectTimeout)
102
+
103
+ let timeoutResult = dispatchGroup.wait(timeout: connectTimeout)
105
104
  let failureMessage = "Couldn't connect to ruby process within: \(SocketClient.connectTimeoutSeconds) seconds"
106
-
105
+
107
106
  let success = testDispatchTimeoutResult(timeoutResult, failureMessage: failureMessage, timeToWait: secondsToWait)
108
-
107
+
109
108
  guard success else {
110
- self.socketDelegate?.commandExecuted(serverResponse: .connectionFailure) { _ in }
109
+ socketDelegate?.commandExecuted(serverResponse: .connectionFailure) { _ in }
111
110
  return
112
111
  }
113
-
114
- self.socketStatus = .ready
115
- self.socketDelegate?.connectionsOpened()
112
+
113
+ socketStatus = .ready
114
+ socketDelegate?.connectionsOpened()
116
115
  }
117
-
116
+
118
117
  public func send(rubyCommand: RubyCommandable) {
119
118
  verbose(message: "sending: \(rubyCommand.json)")
120
119
  send(string: rubyCommand.json)
121
120
  writeSemaphore.signal()
122
121
  }
123
-
122
+
124
123
  public func sendComplete() {
125
124
  closeSession(sendAbort: true)
126
125
  }
127
-
126
+
128
127
  private func testDispatchTimeoutResult(_ timeoutResult: DispatchTimeoutResult, failureMessage: String, timeToWait: DispatchTimeInterval) -> Bool {
129
128
  switch timeoutResult {
130
129
  case .success:
131
130
  return true
132
131
  case .timedOut:
133
132
  log(message: "Timeout: \(failureMessage)")
134
-
135
- if case .seconds(let seconds) = timeToWait {
133
+
134
+ if case let .seconds(seconds) = timeToWait {
136
135
  socketDelegate?.commandExecuted(serverResponse: .commandTimeout(seconds: seconds)) { _ in }
137
136
  }
138
137
  return false
139
138
  }
140
139
  }
141
-
140
+
142
141
  private func stopInputSession() {
143
142
  inputStream.close()
144
143
  }
145
-
144
+
146
145
  private func stopOutputSession() {
147
146
  outputStream.close()
148
147
  }
@@ -161,14 +160,13 @@ class SocketClient: NSObject {
161
160
  let timeToWait = DispatchTimeInterval.seconds(timeoutSeconds)
162
161
  let commandTimeout = DispatchTime.now() + timeToWait
163
162
  let timeoutResult = writeSemaphore.wait(timeout: commandTimeout)
164
-
163
+
165
164
  _ = self.testDispatchTimeoutResult(timeoutResult, failureMessage: "Ruby process didn't return after: \(SocketClient.connectTimeoutSeconds) seconds", timeToWait: timeToWait)
166
-
167
165
  }
168
166
  }
169
167
 
170
168
  private func send(string: String) {
171
- guard !self.cleaningUpAfterDone else {
169
+ guard !cleaningUpAfterDone else {
172
170
  // This will happen after we abort if there are commands waiting to be executed
173
171
  // Need to check state of SocketClient in command runner to make sure we can accept `send`
174
172
  socketDelegate?.commandExecuted(serverResponse: .alreadyClosedSockets) { _ in }
@@ -176,14 +174,14 @@ class SocketClient: NSObject {
176
174
  }
177
175
 
178
176
  if string == SocketClient.doneToken {
179
- self.cleaningUpAfterDone = true
177
+ cleaningUpAfterDone = true
180
178
  }
181
179
 
182
180
  privateSend(string: string)
183
181
  }
184
182
 
185
183
  func closeSession(sendAbort: Bool = true) {
186
- self.socketStatus = .closed
184
+ socketStatus = .closed
187
185
 
188
186
  stopInputSession()
189
187
 
@@ -192,13 +190,13 @@ class SocketClient: NSObject {
192
190
  }
193
191
 
194
192
  stopOutputSession()
195
- self.socketDelegate?.connectionsClosed()
193
+ socketDelegate?.connectionsClosed()
196
194
  }
197
-
195
+
198
196
  public func enter() {
199
197
  dispatchGroup.enter()
200
198
  }
201
-
199
+
202
200
  public func leave() {
203
201
  readSemaphore.signal()
204
202
  writeSemaphore.signal()
@@ -207,52 +205,51 @@ class SocketClient: NSObject {
207
205
 
208
206
  extension SocketClient: StreamDelegate {
209
207
  func stream(_ aStream: Stream, handle eventCode: Stream.Event) {
210
- guard !self.cleaningUpAfterDone else {
208
+ guard !cleaningUpAfterDone else {
211
209
  // Still getting response from server eventhough we are done.
212
210
  // No big deal, we're closing the streams anyway.
213
211
  // That being said, we need to balance out the dispatchGroups
214
- self.dispatchGroup.leave()
212
+ dispatchGroup.leave()
215
213
  return
216
214
  }
217
-
218
- if aStream === self.inputStream {
215
+
216
+ if aStream === inputStream {
219
217
  switch eventCode {
220
218
  case Stream.Event.openCompleted:
221
- self.dispatchGroup.leave()
222
-
219
+ dispatchGroup.leave()
220
+
223
221
  case Stream.Event.errorOccurred:
224
222
  verbose(message: "input stream error occurred")
225
223
  closeSession(sendAbort: true)
226
-
224
+
227
225
  case Stream.Event.hasBytesAvailable:
228
226
  read()
229
-
227
+
230
228
  case Stream.Event.endEncountered:
231
229
  // nothing special here
232
230
  break
233
-
231
+
234
232
  case Stream.Event.hasSpaceAvailable:
235
233
  // we don't care about this
236
234
  break
237
-
235
+
238
236
  default:
239
237
  verbose(message: "input stream caused unrecognized event: \(eventCode)")
240
238
  }
241
-
242
- } else if aStream === self.outputStream {
239
+
240
+ } else if aStream === outputStream {
243
241
  switch eventCode {
244
242
  case Stream.Event.openCompleted:
245
- self.dispatchGroup.leave()
246
-
243
+ dispatchGroup.leave()
244
+
247
245
  case Stream.Event.errorOccurred:
248
246
  // probably safe to close all the things because Ruby already disconnected
249
247
  verbose(message: "output stream recevied error")
250
- break
251
-
248
+
252
249
  case Stream.Event.endEncountered:
253
250
  // nothing special here
254
251
  break
255
-
252
+
256
253
  case Stream.Event.hasSpaceAvailable:
257
254
  // we don't care about this
258
255
  break
@@ -262,7 +259,7 @@ extension SocketClient: StreamDelegate {
262
259
  }
263
260
  }
264
261
  }
265
-
262
+
266
263
  func read() {
267
264
  readQueue.sync {
268
265
  self.readSemaphore.wait()
@@ -279,53 +276,50 @@ extension SocketClient: StreamDelegate {
279
276
  verbose(message: "Stream read() error")
280
277
  }
281
278
  }
282
- self.processResponse(string: output, socket: self)
279
+ self.processResponse(string: output)
283
280
  readSemaphore.signal()
284
281
  }
285
282
  }
286
-
283
+
287
284
  func handleFailure(message: [String]) {
288
- log(message: "Encountered a problem: \(message.joined(separator:"\n"))")
285
+ log(message: "Encountered a problem: \(message.joined(separator: "\n"))")
289
286
  let shutdownCommand = ControlCommand(commandType: .cancel(cancelReason: .serverError))
290
- self.send(rubyCommand: shutdownCommand)
287
+ send(rubyCommand: shutdownCommand)
291
288
  }
292
-
293
- func processResponse(string: String, socket: SocketClient) {
294
- guard string.count > 0 else {
295
- self.socketDelegate?.commandExecuted(serverResponse: .malformedResponse) {
289
+
290
+ func processResponse(string: String) {
291
+ guard !string.isEmpty else {
292
+ socketDelegate?.commandExecuted(serverResponse: .malformedResponse) {
296
293
  self.handleFailure(message: ["empty response from ruby process"])
297
294
  $0.writeSemaphore.signal()
298
295
  }
299
296
  return
300
297
  }
301
-
298
+
302
299
  let responseString = string.trimmingCharacters(in: .whitespacesAndNewlines)
303
300
  let socketResponse = SocketResponse(payload: responseString)
304
301
  verbose(message: "response is: \(responseString)")
305
302
  switch socketResponse.responseType {
306
303
  case .clientInitiatedCancel:
307
- self.socketDelegate?.commandExecuted(serverResponse: .clientInitiatedCancelAcknowledged) {
308
- self.closeSession(sendAbort: false)
304
+ socketDelegate?.commandExecuted(serverResponse: .clientInitiatedCancelAcknowledged) {
309
305
  $0.writeSemaphore.signal()
306
+ self.closeSession(sendAbort: false)
310
307
  }
311
-
312
308
 
313
- case .failure(let failureInformation):
314
- self.socketDelegate?.commandExecuted(serverResponse: .serverError) {
315
- self.handleFailure(message: failureInformation)
309
+ case let .failure(failureInformation):
310
+ socketDelegate?.commandExecuted(serverResponse: .serverError) {
316
311
  $0.writeSemaphore.signal()
312
+ self.handleFailure(message: failureInformation)
317
313
  }
318
-
319
314
 
320
- case .parseFailure(let failureInformation):
321
- self.socketDelegate?.commandExecuted(serverResponse: .malformedResponse) {
322
- self.handleFailure(message: failureInformation)
315
+ case let .parseFailure(failureInformation):
316
+ socketDelegate?.commandExecuted(serverResponse: .malformedResponse) {
323
317
  $0.writeSemaphore.signal()
318
+ self.handleFailure(message: failureInformation)
324
319
  }
325
-
326
320
 
327
- case .readyForNext(let returnedObject, let closureArgumentValue):
328
- self.socketDelegate?.commandExecuted(serverResponse: .success(returnedObject: returnedObject, closureArgumentValue: closureArgumentValue)) {
321
+ case let .readyForNext(returnedObject, closureArgumentValue):
322
+ socketDelegate?.commandExecuted(serverResponse: .success(returnedObject: returnedObject, closureArgumentValue: closureArgumentValue)) {
329
323
  $0.writeSemaphore.signal()
330
324
  }
331
325
  }
@@ -20,13 +20,13 @@ struct SocketResponse {
20
20
  case failure(failureInformation: [String])
21
21
  case readyForNext(returnedObject: String?, closureArgumentValue: String?)
22
22
  case clientInitiatedCancel
23
-
24
- init(statusDictionary: [String : Any]) {
23
+
24
+ init(statusDictionary: [String: Any]) {
25
25
  guard let status = statusDictionary["status"] as? String else {
26
26
  self = .parseFailure(failureInformation: ["Message failed to parse from Ruby server"])
27
27
  return
28
28
  }
29
-
29
+
30
30
  if status == "ready_for_next" {
31
31
  verbose(message: "ready for next")
32
32
  let returnedObject = statusDictionary["return_object"] as? String
@@ -43,36 +43,36 @@ struct SocketResponse {
43
43
  self = .parseFailure(failureInformation: ["Ruby server indicated failure but Swift couldn't receive it"])
44
44
  return
45
45
  }
46
-
46
+
47
47
  self = .failure(failureInformation: failureInformation)
48
48
  return
49
49
  }
50
50
  self = .parseFailure(failureInformation: ["Message status: \(status) not a supported status"])
51
51
  }
52
52
  }
53
-
53
+
54
54
  let responseType: ResponseType
55
-
55
+
56
56
  init(payload: String) {
57
57
  guard let data = SocketResponse.convertToDictionary(text: payload) else {
58
- self.responseType = .parseFailure(failureInformation: ["Unable to parse message from Ruby server"])
58
+ responseType = .parseFailure(failureInformation: ["Unable to parse message from Ruby server"])
59
59
  return
60
60
  }
61
-
62
- guard case let statusDictionary? = data["payload"] as? [String : Any] else {
63
- self.responseType = .parseFailure(failureInformation: ["Payload missing from Ruby server response"])
61
+
62
+ guard case let statusDictionary? = data["payload"] as? [String: Any] else {
63
+ responseType = .parseFailure(failureInformation: ["Payload missing from Ruby server response"])
64
64
  return
65
65
  }
66
-
67
- self.responseType = ResponseType(statusDictionary: statusDictionary)
66
+
67
+ responseType = ResponseType(statusDictionary: statusDictionary)
68
68
  }
69
69
  }
70
70
 
71
71
  extension SocketResponse {
72
- static func convertToDictionary(text: String) -> [String : Any]? {
72
+ static func convertToDictionary(text: String) -> [String: Any]? {
73
73
  if let data = text.data(using: .utf8) {
74
74
  do {
75
- return try JSONSerialization.jsonObject(with: data, options: []) as? [String : Any]
75
+ return try JSONSerialization.jsonObject(with: data, options: []) as? [String: Any]
76
76
  } catch {
77
77
  log(message: error.localizedDescription)
78
78
  }
@@ -0,0 +1 @@
1
+ brew("swiftformat")
@@ -0,0 +1,39 @@
1
+ {
2
+ "entries": {
3
+ "brew": {
4
+ "swiftformat": {
5
+ "version": "0.44.8",
6
+ "bottle": {
7
+ "cellar": ":any_skip_relocation",
8
+ "prefix": "/usr/local",
9
+ "files": {
10
+ "catalina": {
11
+ "url": "https://homebrew.bintray.com/bottles/swiftformat-0.44.8.catalina.bottle.tar.gz",
12
+ "sha256": "9cbd2c21d4579c8c4ffc9df7b44593f7622d13f8517a3fed047c5e5f3f2560c6"
13
+ },
14
+ "mojave": {
15
+ "url": "https://homebrew.bintray.com/bottles/swiftformat-0.44.8.mojave.bottle.tar.gz",
16
+ "sha256": "a8f8b6fa977804c2d13f0cbc9ed223ddaa88e3c0684e91519e005784c8418b36"
17
+ },
18
+ "high_sierra": {
19
+ "url": "https://homebrew.bintray.com/bottles/swiftformat-0.44.8.high_sierra.bottle.tar.gz",
20
+ "sha256": "fd43d192d194a8bb02308714b691e6a7101f839889f749dff4a1facf8172b951"
21
+ }
22
+ }
23
+ }
24
+ }
25
+ }
26
+ },
27
+ "system": {
28
+ "macos": {
29
+ "catalina": {
30
+ "HOMEBREW_VERSION": "2.2.14-62-g9befd55",
31
+ "HOMEBREW_PREFIX": "/usr/local",
32
+ "Homebrew/homebrew-core": "0b738b77a5a13a66a52d76d34c4f608b719e0485",
33
+ "CLT": "11.0.28.3",
34
+ "Xcode": "11.4.1",
35
+ "macOS": "10.15.4"
36
+ }
37
+ }
38
+ }
39
+ }