fastlane 2.162.0 → 2.167.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +78 -78
  3. data/cert/lib/cert/runner.rb +2 -2
  4. data/deliver/lib/deliver/app_screenshot.rb +6 -2
  5. data/deliver/lib/deliver/module.rb +2 -0
  6. data/deliver/lib/deliver/options.rb +3 -3
  7. data/deliver/lib/deliver/queue_worker.rb +14 -29
  8. data/deliver/lib/deliver/upload_metadata.rb +19 -5
  9. data/deliver/lib/deliver/upload_screenshots.rb +3 -5
  10. data/fastlane/lib/fastlane/actions/.download_dsyms.rb.swp +0 -0
  11. data/fastlane/lib/fastlane/actions/actions_helper.rb +1 -1
  12. data/fastlane/lib/fastlane/actions/add_git_tag.rb +9 -2
  13. data/fastlane/lib/fastlane/actions/app_store_build_number.rb +39 -3
  14. data/fastlane/lib/fastlane/actions/app_store_connect_api_key.rb +9 -0
  15. data/fastlane/lib/fastlane/actions/appledoc.rb +1 -1
  16. data/fastlane/lib/fastlane/actions/check_app_store_metadata.rb +1 -0
  17. data/fastlane/lib/fastlane/actions/docs/capture_ios_screenshots.md +5 -1
  18. data/fastlane/lib/fastlane/actions/docs/sync_code_signing.md +9 -0
  19. data/fastlane/lib/fastlane/actions/get_certificates.rb +1 -0
  20. data/fastlane/lib/fastlane/actions/get_provisioning_profile.rb +1 -0
  21. data/fastlane/lib/fastlane/actions/import_from_git.rb +9 -1
  22. data/fastlane/lib/fastlane/actions/is_ci.rb +1 -1
  23. data/fastlane/lib/fastlane/actions/latest_testflight_build_number.rb +15 -0
  24. data/fastlane/lib/fastlane/actions/register_device.rb +46 -5
  25. data/fastlane/lib/fastlane/actions/register_devices.rb +50 -16
  26. data/fastlane/lib/fastlane/actions/set_changelog.rb +31 -3
  27. data/fastlane/lib/fastlane/actions/spm.rb +6 -0
  28. data/fastlane/lib/fastlane/actions/sync_code_signing.rb +1 -0
  29. data/fastlane/lib/fastlane/actions/update_fastlane.rb +29 -8
  30. data/fastlane/lib/fastlane/actions/upload_to_app_store.rb +3 -2
  31. data/fastlane/lib/fastlane/cli_tools_distributor.rb +2 -2
  32. data/fastlane/lib/fastlane/fast_file.rb +74 -23
  33. data/fastlane/lib/fastlane/features.rb +1 -1
  34. data/fastlane/lib/fastlane/plugins/template/.rubocop.yml +2 -0
  35. data/fastlane/lib/fastlane/swift_fastlane_function.rb +1 -1
  36. data/fastlane/lib/fastlane/version.rb +1 -1
  37. data/fastlane/swift/Deliverfile.swift +1 -1
  38. data/fastlane/swift/DeliverfileProtocol.swift +4 -4
  39. data/fastlane/swift/Fastfile.swift +1 -1
  40. data/fastlane/swift/Fastlane.swift +73 -22
  41. data/fastlane/swift/Gymfile.swift +1 -1
  42. data/fastlane/swift/GymfileProtocol.swift +1 -1
  43. data/fastlane/swift/LaneFileProtocol.swift +15 -19
  44. data/fastlane/swift/MainProcess.swift +3 -1
  45. data/fastlane/swift/Matchfile.swift +1 -1
  46. data/fastlane/swift/MatchfileProtocol.swift +6 -2
  47. data/fastlane/swift/Precheckfile.swift +1 -1
  48. data/fastlane/swift/PrecheckfileProtocol.swift +1 -1
  49. data/fastlane/swift/Runner.swift +1 -1
  50. data/fastlane/swift/Scanfile.swift +1 -1
  51. data/fastlane/swift/ScanfileProtocol.swift +5 -1
  52. data/fastlane/swift/Screengrabfile.swift +1 -1
  53. data/fastlane/swift/ScreengrabfileProtocol.swift +1 -1
  54. data/fastlane/swift/Snapshotfile.swift +1 -1
  55. data/fastlane/swift/SnapshotfileProtocol.swift +1 -1
  56. data/fastlane/swift/SocketClient.swift +1 -1
  57. data/fastlane/swift/main.swift +1 -1
  58. data/fastlane_core/lib/fastlane_core/cert_checker.rb +12 -7
  59. data/fastlane_core/lib/fastlane_core/device_manager.rb +8 -4
  60. data/fastlane_core/lib/fastlane_core/helper.rb +10 -2
  61. data/fastlane_core/lib/fastlane_core/itunes_transporter.rb +3 -3
  62. data/fastlane_core/lib/fastlane_core/keychain_importer.rb +1 -1
  63. data/fastlane_core/lib/fastlane_core/provisioning_profile.rb +3 -1
  64. data/fastlane_core/lib/fastlane_core/ui/disable_colors.rb +8 -0
  65. data/gym/lib/gym/code_signing_mapping.rb +1 -1
  66. data/gym/lib/gym/generators/package_command_generator_xcode7.rb +2 -2
  67. data/match/lib/match/importer.rb +33 -21
  68. data/match/lib/match/nuke.rb +9 -5
  69. data/match/lib/match/options.rb +7 -1
  70. data/pilot/lib/pilot/build_manager.rb +9 -3
  71. data/scan/lib/scan/detect_values.rb +8 -9
  72. data/scan/lib/scan/module.rb +4 -0
  73. data/scan/lib/scan/options.rb +9 -0
  74. data/scan/lib/scan/runner.rb +2 -1
  75. data/sigh/lib/assets/resign.sh +1 -1
  76. data/sigh/lib/sigh/download_all.rb +16 -4
  77. data/sigh/lib/sigh/runner.rb +4 -4
  78. data/snapshot/lib/assets/SnapshotHelper.swift +4 -0
  79. data/snapshot/lib/snapshot/simulator_launchers/simulator_launcher_base.rb +2 -1
  80. data/snapshot/lib/snapshot/test_command_generator.rb +1 -1
  81. data/snapshot/lib/snapshot/test_command_generator_base.rb +3 -1
  82. data/snapshot/lib/snapshot/test_command_generator_xcode_8.rb +1 -1
  83. data/spaceship/lib/spaceship/client.rb +7 -3
  84. data/spaceship/lib/spaceship/connect_api.rb +26 -0
  85. data/spaceship/lib/spaceship/connect_api/api_client.rb +9 -0
  86. data/spaceship/lib/spaceship/connect_api/client.rb +7 -4
  87. data/spaceship/lib/spaceship/connect_api/models/app.rb +51 -0
  88. data/spaceship/lib/spaceship/connect_api/models/beta_group.rb +9 -0
  89. data/spaceship/lib/spaceship/connect_api/models/custom_app_organization.rb +43 -0
  90. data/spaceship/lib/spaceship/connect_api/models/custom_app_user.rb +41 -0
  91. data/spaceship/lib/spaceship/connect_api/models/device.rb +5 -0
  92. data/spaceship/lib/spaceship/connect_api/provisioning/provisioning.rb +17 -0
  93. data/spaceship/lib/spaceship/connect_api/spaceship.rb +7 -4
  94. data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +12 -0
  95. data/spaceship/lib/spaceship/connect_api/token.rb +6 -1
  96. data/spaceship/lib/spaceship/connect_api/tunes/tunes.rb +71 -0
  97. data/supply/lib/supply.rb +1 -1
  98. data/supply/lib/supply/uploader.rb +1 -1
  99. metadata +21 -18
@@ -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.162.0
20
+ // Generated with fastlane 2.167.0
@@ -184,4 +184,4 @@ public extension GymfileProtocol {
184
184
 
185
185
  // Please don't remove the lines below
186
186
  // They are used to detect outdated files
187
- // FastlaneRunnerAPIVersion [0.9.48]
187
+ // FastlaneRunnerAPIVersion [0.9.53]
@@ -12,18 +12,18 @@ import Foundation
12
12
 
13
13
  public protocol LaneFileProtocol: class {
14
14
  var fastlaneVersion: String { get }
15
- static func runLane(from fastfile: LaneFile?, named: String, parameters: [String: String]) -> Bool
15
+ static func runLane(from fastfile: LaneFile?, named lane: String, with parameters: [String: String]) -> Bool
16
16
 
17
17
  func recordLaneDescriptions()
18
- func beforeAll()
19
- func afterAll(currentLane: String)
18
+ func beforeAll(with lane: String)
19
+ func afterAll(with lane: String)
20
20
  func onError(currentLane: String, errorInfo: 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
- func beforeAll() {} // No-op by default
26
- func afterAll(currentLane _: String) {} // No-op by default
25
+ func beforeAll(with _: String) {} // No-op by default
26
+ func afterAll(with _: String) {} // No-op by default
27
27
  func onError(currentLane _: String, errorInfo _: String) {} // No-op by default
28
28
  func recordLaneDescriptions() {} // No-op by default
29
29
  }
@@ -32,11 +32,6 @@ public extension LaneFileProtocol {
32
32
  open class LaneFile: NSObject, LaneFileProtocol {
33
33
  private(set) static var fastfileInstance: LaneFile?
34
34
 
35
- // Called before any lane is executed.
36
- private func setUpAllTheThings() {
37
- LaneFile.fastfileInstance!.beforeAll()
38
- }
39
-
40
35
  private static func trimLaneFromName(laneName: String) -> String {
41
36
  return String(laneName.prefix(laneName.count - 4))
42
37
  }
@@ -95,12 +90,12 @@ open class LaneFile: NSObject, LaneFileProtocol {
95
90
  }
96
91
  }
97
92
 
98
- public static func runLane(from fastfile: LaneFile?, named: String, parameters: [String: String]) -> Bool {
99
- log(message: "Running lane: \(named)")
93
+ public static func runLane(from fastfile: LaneFile?, named lane: String, with parameters: [String: String]) -> Bool {
94
+ log(message: "Running lane: \(lane)")
100
95
  #if !SWIFT_PACKAGE
101
96
  // When not in SPM environment, we load the Fastfile from its `className()`.
102
97
  loadFastfile()
103
- guard let fastfileInstance: LaneFile = self.fastfileInstance else {
98
+ guard let fastfileInstance = self.fastfileInstance as? Fastfile else {
104
99
  let message = "Unable to instantiate class named: \(className())"
105
100
  log(message: message)
106
101
  fatalError(message)
@@ -109,14 +104,14 @@ open class LaneFile: NSObject, LaneFileProtocol {
109
104
  // When in SPM environment, we can't load the Fastfile from its `className()` because the executable is in
110
105
  // another scope, so `className()` won't be the expected Fastfile. Instead, we load the Fastfile as a Lanefile
111
106
  // in a static way, by parameter.
112
- guard let fastfileInstance: LaneFile = fastfile else {
107
+ guard let fastfileInstance = fastfile else {
113
108
  log(message: "Found nil instance of fastfile")
114
109
  preconditionFailure()
115
110
  }
116
111
  self.fastfileInstance = fastfileInstance
117
112
  #endif
118
113
  let currentLanes = lanes
119
- let lowerCasedLaneRequested = named.lowercased()
114
+ let lowerCasedLaneRequested = lane.lowercased()
120
115
 
121
116
  guard let laneMethod = currentLanes[lowerCasedLaneRequested] else {
122
117
  let laneNames = laneFunctionNames.map { laneFuctionName in
@@ -127,7 +122,7 @@ open class LaneFile: NSObject, LaneFileProtocol {
127
122
  }
128
123
  }.joined(separator: ", ")
129
124
 
130
- let message = "[!] Could not find lane '\(named)'. Available lanes: \(laneNames)"
125
+ let message = "[!] Could not find lane '\(lane)'. Available lanes: \(laneNames)"
131
126
  log(message: message)
132
127
 
133
128
  let shutdownCommand = ControlCommand(commandType: .cancel(cancelReason: .clientError), message: message)
@@ -136,14 +131,15 @@ open class LaneFile: NSObject, LaneFileProtocol {
136
131
  }
137
132
 
138
133
  // Call all methods that need to be called before we start calling lanes.
139
- fastfileInstance.setUpAllTheThings()
134
+ fastfileInstance.beforeAll(with: lane)
140
135
 
141
136
  // We need to catch all possible errors here and display a nice message.
142
137
  _ = fastfileInstance.perform(NSSelectorFromString(laneMethod), with: parameters)
143
138
 
144
139
  // Call only on success.
145
- fastfileInstance.afterAll(currentLane: named)
146
- log(message: "Done running lane: \(named) 🚀")
140
+ fastfileInstance.afterAll(with: lane)
141
+
142
+ log(message: "Done running lane: \(lane) 🚀")
147
143
  return true
148
144
  }
149
145
  }
@@ -28,7 +28,7 @@ class MainProcess {
28
28
  @objc func connectToFastlaneAndRunLane(_ fastfile: LaneFile?) {
29
29
  runner.startSocketThread(port: argumentProcessor.port)
30
30
 
31
- let completedRun = Fastfile.runLane(from: fastfile, named: argumentProcessor.currentLane, parameters: argumentProcessor.laneParameters())
31
+ let completedRun = Fastfile.runLane(from: fastfile, named: argumentProcessor.currentLane, with: argumentProcessor.laneParameters())
32
32
  if completedRun {
33
33
  runner.disconnectFromFastlaneProcess()
34
34
  }
@@ -56,6 +56,8 @@ class MainProcess {
56
56
  print(stdout)
57
57
  self.timeBetweenPrints = Int(self.lastPrintDate.timeIntervalSinceNow)
58
58
  }
59
+
60
+ // swiftformat:disable:next redundantSelf
59
61
  _ = Runner.waitWithPolling(self.timeBetweenPrints, toEventually: { $0 > 5 }, timeout: 10)
60
62
  thread.start()
61
63
  #endif
@@ -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.162.0
20
+ // Generated with fastlane 2.167.0
@@ -17,7 +17,7 @@ public protocol MatchfileProtocol: class {
17
17
  /// Skip syncing provisioning profiles
18
18
  var skipProvisioningProfiles: Bool { get }
19
19
 
20
- /// The bundle identifier(s) of your app (comma-separated)
20
+ /// The bundle identifier(s) of your app (comma-separated string or array of strings)
21
21
  var appIdentifier: [String] { get }
22
22
 
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)
@@ -122,6 +122,9 @@ public protocol MatchfileProtocol: class {
122
122
  /// Should the command fail if it was about to create a duplicate of an existing provisioning profile. It can happen due to issues on Apple Developer Portal, when profile to be recreated was not properly deleted first
123
123
  var failOnNameTaken: Bool { get }
124
124
 
125
+ /// Set to true if there is no access to Apple developer portal but there are certificates, keys and profiles provided. Only works with match import action
126
+ var skipCertificateMatching: Bool { get }
127
+
125
128
  /// Path in which to export certificates, key and profile
126
129
  var outputPath: String? { get }
127
130
 
@@ -173,6 +176,7 @@ public extension MatchfileProtocol {
173
176
  var templateName: String? { return nil }
174
177
  var profileName: String? { return nil }
175
178
  var failOnNameTaken: Bool { return false }
179
+ var skipCertificateMatching: Bool { return false }
176
180
  var outputPath: String? { return nil }
177
181
  var skipSetPartitionList: Bool { return false }
178
182
  var verbose: Bool { return false }
@@ -180,4 +184,4 @@ public extension MatchfileProtocol {
180
184
 
181
185
  // Please don't remove the lines below
182
186
  // They are used to detect outdated files
183
- // FastlaneRunnerAPIVersion [0.9.42]
187
+ // FastlaneRunnerAPIVersion [0.9.47]
@@ -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.162.0
20
+ // Generated with fastlane 2.167.0
@@ -48,4 +48,4 @@ public extension PrecheckfileProtocol {
48
48
 
49
49
  // Please don't remove the lines below
50
50
  // They are used to detect outdated files
51
- // FastlaneRunnerAPIVersion [0.9.41]
51
+ // FastlaneRunnerAPIVersion [0.9.46]
@@ -37,7 +37,7 @@ class Runner {
37
37
  socketClient.send(rubyCommand: command)
38
38
 
39
39
  let secondsToWait = DispatchTimeInterval.seconds(SocketClient.defaultCommandTimeoutSeconds)
40
- // swiftlint:disable next
40
+ // swiftformat:disable:next redundantSelf
41
41
  let timeoutResult = Self.waitWithPolling(self.executeNext[command.id], toEventually: { $0 == true }, timeout: SocketClient.defaultCommandTimeoutSeconds)
42
42
  executeNext.removeValue(forKey: command.id)
43
43
  let failureMessage = "command didn't execute in: \(SocketClient.defaultCommandTimeoutSeconds) seconds"
@@ -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.162.0
20
+ // Generated with fastlane 2.167.0
@@ -179,6 +179,9 @@ public protocol ScanfileProtocol: class {
179
179
  /// Use only if you're a pro, use the other options instead
180
180
  var destination: String? { get }
181
181
 
182
+ /// Platform to build when using a Catalyst enabled app. Valid values are: ios, macos
183
+ var catalystPlatform: String? { get }
184
+
182
185
  /// **DEPRECATED!** Use `--output_files` instead - Sets custom full report file name when generating a single report
183
186
  var customReportFileName: String? { get }
184
187
 
@@ -252,6 +255,7 @@ public extension ScanfileProtocol {
252
255
  var skipSlack: Bool { return false }
253
256
  var slackOnlyOnFailure: Bool { return false }
254
257
  var destination: String? { return nil }
258
+ var catalystPlatform: String? { return nil }
255
259
  var customReportFileName: String? { return nil }
256
260
  var xcodebuildCommand: String { return "env NSUnbufferedIO=YES xcodebuild" }
257
261
  var clonedSourcePackagesPath: String? { return nil }
@@ -260,4 +264,4 @@ public extension ScanfileProtocol {
260
264
 
261
265
  // Please don't remove the lines below
262
266
  // They are used to detect outdated files
263
- // FastlaneRunnerAPIVersion [0.9.53]
267
+ // FastlaneRunnerAPIVersion [0.9.58]
@@ -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.162.0
20
+ // Generated with fastlane 2.167.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.43]
99
+ // FastlaneRunnerAPIVersion [0.9.48]
@@ -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.162.0
20
+ // Generated with fastlane 2.167.0
@@ -184,4 +184,4 @@ public extension SnapshotfileProtocol {
184
184
 
185
185
  // Please don't remove the lines below
186
186
  // They are used to detect outdated files
187
- // FastlaneRunnerAPIVersion [0.9.37]
187
+ // FastlaneRunnerAPIVersion [0.9.42]
@@ -29,7 +29,7 @@ class SocketClient: NSObject {
29
29
  }
30
30
 
31
31
  static let connectTimeoutSeconds = 2
32
- static let defaultCommandTimeoutSeconds = 10_800 // 3 hours
32
+ static let defaultCommandTimeoutSeconds = 10800 // 3 hours
33
33
  static let doneToken = "done" // TODO: remove these
34
34
  static let cancelToken = "cancelFastlaneRun"
35
35
 
@@ -20,7 +20,7 @@ class MainProcess {
20
20
  @objc func connectToFastlaneAndRunLane() {
21
21
  runner.startSocketThread(port: argumentProcessor.port)
22
22
 
23
- let completedRun = Fastfile.runLane(from: nil, named: argumentProcessor.currentLane, parameters: argumentProcessor.laneParameters())
23
+ let completedRun = Fastfile.runLane(from: nil, named: argumentProcessor.currentLane, with: argumentProcessor.laneParameters())
24
24
  if completedRun {
25
25
  runner.disconnectFromFastlaneProcess()
26
26
  }
@@ -22,7 +22,7 @@ module FastlaneCore
22
22
  end
23
23
 
24
24
  def self.installed_identies(in_keychain: nil)
25
- install_wwdr_certificate unless wwdr_certificate_installed?
25
+ install_wwdr_certificates unless wwdr_certificates_installed?
26
26
 
27
27
  available = list_available_identities(in_keychain: in_keychain)
28
28
  # Match for this text against word boundaries to avoid edge cases around multiples of 10 identities!
@@ -81,16 +81,21 @@ module FastlaneCore
81
81
  `#{commands.join(' ')}`
82
82
  end
83
83
 
84
- def self.wwdr_certificate_installed?
84
+ def self.wwdr_certificates_installed?
85
85
  certificate_name = "Apple Worldwide Developer Relations Certification Authority"
86
86
  keychain = wwdr_keychain
87
- response = Helper.backticks("security find-certificate -c '#{certificate_name}' #{keychain.shellescape}", print: FastlaneCore::Globals.verbose?)
88
- return response.include?("attributes:")
87
+ response = Helper.backticks("security find-certificate -a -c '#{certificate_name}' #{keychain.shellescape}", print: FastlaneCore::Globals.verbose?)
88
+ certs = response.split("keychain: \"#{keychain}\"").drop(1)
89
+ certs.count == 2
89
90
  end
90
91
 
91
- def self.install_wwdr_certificate
92
- url = 'https://developer.apple.com/certificationauthority/AppleWWDRCA.cer'
93
- file = Tempfile.new('AppleWWDRCA')
92
+ def self.install_wwdr_certificates
93
+ install_wwdr_certificate('https://developer.apple.com/certificationauthority/AppleWWDRCA.cer')
94
+ install_wwdr_certificate('https://www.apple.com/certificateauthority/AppleWWDRCAG3.cer')
95
+ end
96
+
97
+ def self.install_wwdr_certificate(url)
98
+ file = Tempfile.new(File.basename(url))
94
99
  filename = file.path
95
100
  keychain = wwdr_keychain
96
101
  keychain = "-k #{keychain.shellescape}" unless keychain.empty?
@@ -301,7 +301,7 @@ module FastlaneCore
301
301
  Helper.backticks("open -a #{simulator_path} --args -CurrentDeviceUDID #{device.udid}", print: FastlaneCore::Globals.verbose?)
302
302
  end
303
303
 
304
- def copy_logs(device, log_identity, logs_destination_dir)
304
+ def copy_logs(device, log_identity, logs_destination_dir, log_collection_start_time)
305
305
  logs_destination_dir = File.expand_path(logs_destination_dir)
306
306
  os_version = FastlaneCore::CommandExecutor.execute(command: 'sw_vers -productVersion', print_all: false, print_command: false)
307
307
 
@@ -310,7 +310,7 @@ module FastlaneCore
310
310
 
311
311
  are_logarchives_supported = device_supports_logarchives && host_computer_supports_logarchives
312
312
  if are_logarchives_supported
313
- copy_logarchive(device, log_identity, logs_destination_dir)
313
+ copy_logarchive(device, log_identity, logs_destination_dir, log_collection_start_time)
314
314
  else
315
315
  copy_logfile(device, log_identity, logs_destination_dir)
316
316
  end
@@ -340,13 +340,17 @@ module FastlaneCore
340
340
  UI.success("Copying file '#{logfile_src}' to '#{logfile_dst}'...")
341
341
  end
342
342
 
343
- def copy_logarchive(device, log_identity, logs_destination_dir)
343
+ def copy_logarchive(device, log_identity, logs_destination_dir, log_collection_start_time)
344
344
  require 'shellwords'
345
345
 
346
346
  logarchive_dst = File.join(logs_destination_dir, "system_logs-#{log_identity}.logarchive")
347
347
  FileUtils.rm_rf(logarchive_dst)
348
348
  FileUtils.mkdir_p(File.expand_path("..", logarchive_dst))
349
- command = "xcrun simctl spawn #{device.udid} log collect --output #{logarchive_dst.shellescape} 2>/dev/null"
349
+
350
+ logs_collection_start = log_collection_start_time.strftime('%Y-%m-%d %H:%M:%S')
351
+ command = "xcrun simctl spawn #{device.udid} log collect "
352
+ command << "--start '#{logs_collection_start}' "
353
+ command << "--output #{logarchive_dst.shellescape} 2>/dev/null"
350
354
  FastlaneCore::CommandExecutor.execute(command: command, print_all: false, print_command: true)
351
355
  end
352
356
  end
@@ -66,7 +66,7 @@ module FastlaneCore
66
66
 
67
67
  # @return true if it is enabled to execute external commands
68
68
  def self.sh_enabled?
69
- !self.test?
69
+ !self.test? || ENV["FORCE_SH_DURING_TESTS"]
70
70
  end
71
71
 
72
72
  # @return [boolean] true if building in a known CI environment
@@ -203,9 +203,17 @@ module FastlaneCore
203
203
  return File.join(self.itms_path, 'iTMSTransporter')
204
204
  end
205
205
 
206
+ def self.user_defined_itms_path?
207
+ return FastlaneCore::Env.truthy?("FASTLANE_ITUNES_TRANSPORTER_PATH")
208
+ end
209
+
210
+ def self.user_defined_itms_path
211
+ return ENV["FASTLANE_ITUNES_TRANSPORTER_PATH"] if self.user_defined_itms_path?
212
+ end
213
+
206
214
  # @return the full path to the iTMSTransporter executable
207
215
  def self.itms_path
208
- return ENV["FASTLANE_ITUNES_TRANSPORTER_PATH"] if FastlaneCore::Env.truthy?("FASTLANE_ITUNES_TRANSPORTER_PATH")
216
+ return self.user_defined_itms_path if FastlaneCore::Env.truthy?("FASTLANE_ITUNES_TRANSPORTER_PATH")
209
217
 
210
218
  if self.mac?
211
219
  # First check for manually install iTMSTransporter
@@ -254,7 +254,7 @@ module FastlaneCore
254
254
  class JavaTransporterExecutor < TransporterExecutor
255
255
  def build_upload_command(username, password, source = "/tmp", provider_short_name = "", jwt = nil)
256
256
  use_jwt = !jwt.to_s.empty?
257
- if Helper.mac? && Helper.xcode_at_least?(11)
257
+ if !Helper.user_defined_itms_path? && Helper.mac? && Helper.xcode_at_least?(11)
258
258
  [
259
259
  ("ITMS_TRANSPORTER_PASSWORD=#{password.shellescape}" unless use_jwt),
260
260
  'xcrun iTMSTransporter',
@@ -294,7 +294,7 @@ module FastlaneCore
294
294
 
295
295
  def build_download_command(username, password, apple_id, destination = "/tmp", provider_short_name = "", jwt = nil)
296
296
  use_jwt = !jwt.to_s.empty?
297
- if Helper.mac? && Helper.xcode_at_least?(11)
297
+ if !Helper.user_defined_itms_path? && Helper.mac? && Helper.xcode_at_least?(11)
298
298
  [
299
299
  ("ITMS_TRANSPORTER_PASSWORD=#{password.shellescape}" unless use_jwt),
300
300
  'xcrun iTMSTransporter',
@@ -332,7 +332,7 @@ module FastlaneCore
332
332
 
333
333
  def build_provider_ids_command(username, password, jwt = nil)
334
334
  use_jwt = !jwt.to_s.empty?
335
- if Helper.mac? && Helper.xcode_at_least?(11)
335
+ if !Helper.user_defined_itms_path? && Helper.mac? && Helper.xcode_at_least?(11)
336
336
  [
337
337
  ("ITMS_TRANSPORTER_PASSWORD=#{password.shellescape}" unless use_jwt),
338
338
  'xcrun iTMSTransporter',
@@ -39,7 +39,7 @@ module FastlaneCore
39
39
  # See https://openradar.appspot.com/28524119
40
40
  if Helper.backticks('security -h | grep set-key-partition-list', print: false).length > 0
41
41
  command = "security set-key-partition-list"
42
- command << " -S apple-tool:,apple:"
42
+ command << " -S apple-tool:,apple:,codesign:"
43
43
  command << " -s" # This is a needed in Catalina to prevent "security: SecKeychainItemCopyAccess: A missing value was detected."
44
44
  command << " -k #{keychain_password.to_s.shellescape}"
45
45
  command << " #{keychain_path.shellescape}"
@@ -47,7 +47,9 @@ module FastlaneCore
47
47
  def bundle_id(path, keychain_path = nil)
48
48
  profile = parse(path, keychain_path)
49
49
  app_id_prefix = profile["ApplicationIdentifierPrefix"].first
50
- bundle_id = profile["Entitlements"]["application-identifier"].gsub("#{app_id_prefix}.", "")
50
+ entitlements = profile["Entitlements"]
51
+ app_identifier = entitlements["application-identifier"] || entitlements["com.apple.application-identifier"]
52
+ bundle_id = app_identifier.gsub("#{app_id_prefix}.", "")
51
53
  bundle_id
52
54
  rescue
53
55
  UI.error("Unable to extract the Bundle Id from the provided provisioning profile '#{path}'.")
@@ -15,3 +15,11 @@ class String
15
15
  end
16
16
  end
17
17
  end
18
+
19
+ # If a plugin uses the colorize gem, we also want to disable that
20
+ begin
21
+ require 'colorize'
22
+ String.disable_colorization = true
23
+ rescue LoadError
24
+ # Colorize gem is not used by any plugin
25
+ end
@@ -142,7 +142,7 @@ module Gym
142
142
  next unless specified_configuration == build_configuration.name
143
143
 
144
144
  # Catalyst apps will have some build settings that will have a configuration
145
- # that is specfic for macos so going to do our best to capture those
145
+ # that is specific for macos so going to do our best to capture those
146
146
  #
147
147
  # There are other platform filters besides "[sdk=macosx*]" that we could use but
148
148
  # this is the default that Xcode will use so this will also be our default
@@ -66,14 +66,14 @@ module Gym
66
66
  if path
67
67
  # Try to find IPA file in the output directory, used when app thinning was not set
68
68
  Gym.cache[:ipa_path] = File.join(temporary_output_path, "#{Gym.config[:output_name]}.ipa")
69
- FileUtils.mv(path, Gym.cache[:ipa_path]) unless File.expand_path(path).casecmp(File.expand_path(Gym.cache[:ipa_path]).downcase).zero?
69
+ FileUtils.mv(path, Gym.cache[:ipa_path]) unless File.expand_path(path).casecmp?(File.expand_path(Gym.cache[:ipa_path]).downcase)
70
70
  elsif Dir.exist?(apps_path)
71
71
  # Try to find "generic" IPA file inside "Apps" folder, used when app thinning was set
72
72
  files = Dir[File.join(apps_path, "*.ipa")]
73
73
  # Generic IPA file doesn't have suffix so its name is the shortest
74
74
  path = files.min_by(&:length)
75
75
  Gym.cache[:ipa_path] = File.join(temporary_output_path, "#{Gym.config[:output_name]}.ipa")
76
- FileUtils.cp(path, Gym.cache[:ipa_path]) unless File.expand_path(path).casecmp(File.expand_path(Gym.cache[:ipa_path]).downcase).zero?
76
+ FileUtils.cp(path, Gym.cache[:ipa_path]) unless File.expand_path(path).casecmp?(File.expand_path(Gym.cache[:ipa_path]).downcase)
77
77
  else
78
78
  ErrorHandler.handle_empty_archive unless path
79
79
  end