fastlane 2.158.0 → 2.163.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +74 -74
  3. data/cert/lib/cert/options.rb +28 -1
  4. data/cert/lib/cert/runner.rb +50 -33
  5. data/deliver/lib/deliver/app_screenshot_iterator.rb +4 -4
  6. data/deliver/lib/deliver/module.rb +2 -0
  7. data/deliver/lib/deliver/options.rb +20 -4
  8. data/deliver/lib/deliver/runner.rb +36 -8
  9. data/deliver/lib/deliver/upload_metadata.rb +49 -9
  10. data/deliver/lib/deliver/upload_price_tier.rb +7 -2
  11. data/deliver/lib/deliver/upload_screenshots.rb +25 -8
  12. data/{pilot/lib/pilot/.manager.rb.swp → fastlane/lib/fastlane/.erb_template_helper.rb.swp} +0 -0
  13. data/fastlane/lib/fastlane/actions/{.slack.rb.swp → .git_commit.rb.swp} +0 -0
  14. data/fastlane/lib/fastlane/actions/.register_device.rb.swp +0 -0
  15. data/fastlane/lib/fastlane/actions/.register_devices.rb.swp +0 -0
  16. data/fastlane/lib/fastlane/actions/actions_helper.rb +20 -1
  17. data/fastlane/lib/fastlane/actions/app_store_build_number.rb +39 -3
  18. data/fastlane/lib/fastlane/actions/app_store_connect_api_key.rb +15 -1
  19. data/fastlane/lib/fastlane/actions/check_app_store_metadata.rb +1 -0
  20. data/fastlane/lib/fastlane/actions/clean_build_artifacts.rb +1 -0
  21. data/fastlane/lib/fastlane/actions/docs/capture_android_screenshots.md +2 -2
  22. data/fastlane/lib/fastlane/actions/docs/capture_ios_screenshots.md +1 -1
  23. data/fastlane/lib/fastlane/actions/docs/create_app_online.md +1 -1
  24. data/fastlane/lib/fastlane/actions/docs/frame_screenshots.md +3 -2
  25. data/fastlane/lib/fastlane/actions/docs/run_tests.md +2 -2
  26. data/fastlane/lib/fastlane/actions/docs/sync_code_signing.md +3 -3
  27. data/fastlane/lib/fastlane/actions/docs/upload_to_play_store.md +2 -2
  28. data/fastlane/lib/fastlane/actions/docs/upload_to_testflight.md +2 -2
  29. data/fastlane/lib/fastlane/actions/download_dsyms.rb +32 -7
  30. data/fastlane/lib/fastlane/actions/ensure_git_status_clean.rb +13 -2
  31. data/fastlane/lib/fastlane/actions/get_certificates.rb +1 -0
  32. data/fastlane/lib/fastlane/actions/get_provisioning_profile.rb +1 -0
  33. data/fastlane/lib/fastlane/actions/latest_testflight_build_number.rb +15 -0
  34. data/fastlane/lib/fastlane/actions/register_device.rb +46 -5
  35. data/fastlane/lib/fastlane/actions/register_devices.rb +46 -15
  36. data/fastlane/lib/fastlane/actions/sync_code_signing.rb +1 -0
  37. data/fastlane/lib/fastlane/actions/upload_to_app_store.rb +3 -2
  38. data/fastlane/lib/fastlane/helper/git_helper.rb +2 -0
  39. data/fastlane/lib/fastlane/swift_fastlane_api_generator.rb +6 -4
  40. data/fastlane/lib/fastlane/swift_fastlane_function.rb +1 -1
  41. data/fastlane/lib/fastlane/version.rb +1 -1
  42. data/fastlane/swift/Actions.swift +2 -1
  43. data/fastlane/swift/Appfile.swift +2 -4
  44. data/fastlane/swift/ArgumentProcessor.swift +2 -6
  45. data/fastlane/swift/ControlCommand.swift +2 -5
  46. data/fastlane/swift/Deliverfile.swift +5 -2
  47. data/fastlane/swift/DeliverfileProtocol.swift +18 -7
  48. data/fastlane/swift/Fastfile.swift +5 -1
  49. data/fastlane/swift/Fastlane.swift +2368 -2251
  50. data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/project.pbxproj +5 -5
  51. data/fastlane/swift/Gymfile.swift +5 -2
  52. data/fastlane/swift/GymfileProtocol.swift +6 -3
  53. data/fastlane/swift/LaneFileProtocol.swift +49 -40
  54. data/fastlane/swift/MainProcess.swift +77 -0
  55. data/fastlane/swift/Matchfile.swift +5 -2
  56. data/fastlane/swift/MatchfileProtocol.swift +21 -6
  57. data/fastlane/swift/Plugins.swift +2 -1
  58. data/fastlane/swift/Precheckfile.swift +5 -2
  59. data/fastlane/swift/PrecheckfileProtocol.swift +14 -3
  60. data/fastlane/swift/RubyCommand.swift +2 -6
  61. data/fastlane/swift/RubyCommandable.swift +2 -6
  62. data/fastlane/swift/Runner.swift +5 -9
  63. data/fastlane/swift/RunnerArgument.swift +2 -6
  64. data/fastlane/swift/Scanfile.swift +5 -2
  65. data/fastlane/swift/ScanfileProtocol.swift +6 -3
  66. data/fastlane/swift/Screengrabfile.swift +5 -2
  67. data/fastlane/swift/ScreengrabfileProtocol.swift +6 -3
  68. data/fastlane/swift/Snapshotfile.swift +5 -2
  69. data/fastlane/swift/SnapshotfileProtocol.swift +6 -3
  70. data/fastlane/swift/SocketClient.swift +3 -7
  71. data/fastlane/swift/SocketClientDelegateProtocol.swift +2 -6
  72. data/fastlane/swift/SocketResponse.swift +2 -6
  73. data/fastlane/swift/formatting/Brewfile.lock.json +18 -10
  74. data/fastlane/swift/main.swift +4 -8
  75. data/fastlane/swift/upgrade_manifest.json +1 -1
  76. data/fastlane_core/lib/fastlane_core/analytics/analytics_session.rb +6 -7
  77. data/fastlane_core/lib/fastlane_core/keychain_importer.rb +2 -2
  78. data/frameit/lib/frameit/editor.rb +1 -0
  79. data/gym/lib/gym/generators/package_command_generator_xcode7.rb +2 -2
  80. data/match/lib/match/generator.rb +6 -1
  81. data/match/lib/match/importer.rb +44 -8
  82. data/match/lib/match/migrate.rb +13 -2
  83. data/match/lib/match/nuke.rb +65 -22
  84. data/match/lib/match/options.rb +27 -2
  85. data/match/lib/match/runner.rb +38 -10
  86. data/match/lib/match/spaceship_ensure.rb +27 -21
  87. data/match/lib/match/storage/google_cloud_storage.rb +20 -3
  88. data/match/lib/match/storage/s3_storage.rb +19 -3
  89. data/pilot/lib/pilot/options.rb +2 -2
  90. data/precheck/lib/precheck/options.rb +16 -0
  91. data/precheck/lib/precheck/runner.rb +20 -1
  92. data/sigh/lib/sigh/download_all.rb +16 -4
  93. data/sigh/lib/sigh/options.rb +21 -0
  94. data/sigh/lib/sigh/runner.rb +80 -38
  95. data/snapshot/lib/assets/SnapshotHelper.swift +21 -2
  96. data/spaceship/README.md +1 -1
  97. data/spaceship/lib/spaceship/{connect_api/.DS_Store → .DS_Store} +0 -0
  98. data/spaceship/lib/spaceship/client.rb +9 -4
  99. data/spaceship/lib/spaceship/connect_api.rb +25 -0
  100. data/spaceship/lib/spaceship/connect_api/api_client.rb +12 -3
  101. data/spaceship/lib/spaceship/connect_api/client.rb +38 -15
  102. data/{fastlane/lib/fastlane/actions/.update_project_provisioning.rb.swp → spaceship/lib/spaceship/connect_api/models/.app_store_version_submission.rb.swp} +0 -0
  103. data/spaceship/lib/spaceship/connect_api/models/app.rb +17 -9
  104. data/spaceship/lib/spaceship/connect_api/models/app_info.rb +1 -0
  105. data/spaceship/lib/spaceship/connect_api/models/app_screenshot.rb +3 -1
  106. data/spaceship/lib/spaceship/connect_api/models/app_screenshot_set.rb +2 -2
  107. data/spaceship/lib/spaceship/connect_api/models/app_store_version.rb +3 -5
  108. data/spaceship/lib/spaceship/connect_api/models/app_store_version_localization.rb +3 -5
  109. data/spaceship/lib/spaceship/connect_api/models/beta_tester.rb +2 -1
  110. data/spaceship/lib/spaceship/connect_api/models/certificate.rb +42 -0
  111. data/spaceship/lib/spaceship/connect_api/models/device.rb +5 -0
  112. data/spaceship/lib/spaceship/connect_api/models/profile.rb +7 -1
  113. data/spaceship/lib/spaceship/connect_api/models/user_invitation.rb +59 -0
  114. data/spaceship/lib/spaceship/connect_api/provisioning/provisioning.rb +45 -2
  115. data/spaceship/lib/spaceship/connect_api/spaceship.rb +3 -2
  116. data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +13 -0
  117. data/spaceship/lib/spaceship/connect_api/token.rb +6 -1
  118. data/spaceship/lib/spaceship/connect_api/tunes/tunes.rb +17 -9
  119. data/spaceship/lib/spaceship/connect_api/users/users.rb +40 -0
  120. data/spaceship/lib/spaceship/helper/net_http_generic_request.rb +11 -5
  121. metadata +27 -25
  122. data/fastlane/lib/fastlane/actions/.hockey.rb.swp +0 -0
  123. data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/project.xcworkspace/xcuserdata/josh.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
@@ -9,6 +9,7 @@
9
9
  /* Begin PBXBuildFile section */
10
10
  0311E387230AC1B20060BB5C /* Plugins.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0311E386230AC1B20060BB5C /* Plugins.swift */; };
11
11
  0311E38B230AC9490060BB5C /* Actions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0311E38A230AC9490060BB5C /* Actions.swift */; };
12
+ 1257253924B7992C00E04FA3 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1257253824B7992B00E04FA3 /* main.swift */; };
12
13
  B302067B1F5E3E9000DE6EBD /* SnapshotfileProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = B30206741F5E3E9000DE6EBD /* SnapshotfileProtocol.swift */; };
13
14
  B302067C1F5E3E9000DE6EBD /* GymfileProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = B30206751F5E3E9000DE6EBD /* GymfileProtocol.swift */; };
14
15
  B302067D1F5E3E9000DE6EBD /* MatchfileProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = B30206761F5E3E9000DE6EBD /* MatchfileProtocol.swift */; };
@@ -18,7 +19,6 @@
18
19
  B30206811F5E3E9000DE6EBD /* DeliverfileProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = B302067A1F5E3E9000DE6EBD /* DeliverfileProtocol.swift */; };
19
20
  B3BA65A61F5A269100B34850 /* Fastlane.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3BA659D1F5A269100B34850 /* Fastlane.swift */; };
20
21
  B3BA65A71F5A269100B34850 /* LaneFileProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3BA659E1F5A269100B34850 /* LaneFileProtocol.swift */; };
21
- B3BA65A81F5A269100B34850 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3BA659F1F5A269100B34850 /* main.swift */; };
22
22
  B3BA65A91F5A269100B34850 /* RubyCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3BA65A01F5A269100B34850 /* RubyCommand.swift */; };
23
23
  B3BA65AA1F5A269100B34850 /* Runner.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3BA65A11F5A269100B34850 /* Runner.swift */; };
24
24
  B3BA65AB1F5A269100B34850 /* SocketClient.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3BA65A21F5A269100B34850 /* SocketClient.swift */; };
@@ -42,6 +42,7 @@
42
42
  /* Begin PBXFileReference section */
43
43
  0311E386230AC1B20060BB5C /* Plugins.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Plugins.swift; path = ../Plugins.swift; sourceTree = "<group>"; };
44
44
  0311E38A230AC9490060BB5C /* Actions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Actions.swift; path = ../Actions.swift; sourceTree = "<group>"; };
45
+ 1257253824B7992B00E04FA3 /* main.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = main.swift; path = ../main.swift; sourceTree = "<group>"; };
45
46
  B30206741F5E3E9000DE6EBD /* SnapshotfileProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SnapshotfileProtocol.swift; path = ../SnapshotfileProtocol.swift; sourceTree = "<group>"; };
46
47
  B30206751F5E3E9000DE6EBD /* GymfileProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = GymfileProtocol.swift; path = ../GymfileProtocol.swift; sourceTree = "<group>"; };
47
48
  B30206761F5E3E9000DE6EBD /* MatchfileProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = MatchfileProtocol.swift; path = ../MatchfileProtocol.swift; sourceTree = "<group>"; };
@@ -55,7 +56,6 @@
55
56
  B3144C0A200553DC00470AFE /* README.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = README.txt; sourceTree = "<group>"; };
56
57
  B3BA659D1F5A269100B34850 /* Fastlane.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Fastlane.swift; path = ../Fastlane.swift; sourceTree = "<group>"; };
57
58
  B3BA659E1F5A269100B34850 /* LaneFileProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = LaneFileProtocol.swift; path = ../LaneFileProtocol.swift; sourceTree = "<group>"; };
58
- B3BA659F1F5A269100B34850 /* main.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = main.swift; path = ../main.swift; sourceTree = "<group>"; };
59
59
  B3BA65A01F5A269100B34850 /* RubyCommand.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = RubyCommand.swift; path = ../RubyCommand.swift; sourceTree = "<group>"; };
60
60
  B3BA65A11F5A269100B34850 /* Runner.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Runner.swift; path = ../Runner.swift; sourceTree = "<group>"; };
61
61
  B3BA65A21F5A269100B34850 /* SocketClient.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SocketClient.swift; path = ../SocketClient.swift; sourceTree = "<group>"; };
@@ -161,9 +161,9 @@
161
161
  D512BA011F7C7F40000D2137 /* Runner Code */ = {
162
162
  isa = PBXGroup;
163
163
  children = (
164
+ 1257253824B7992B00E04FA3 /* main.swift */,
164
165
  B3144C0A200553DC00470AFE /* README.txt */,
165
166
  D5BAFD111F7DAAFC0030B324 /* ArgumentProcessor.swift */,
166
- B3BA659F1F5A269100B34850 /* main.swift */,
167
167
  B3BA65AE1F5A2D5C00B34850 /* RunnerArgument.swift */,
168
168
  );
169
169
  name = "Runner Code";
@@ -236,7 +236,7 @@
236
236
  );
237
237
  runOnlyForDeploymentPostprocessing = 0;
238
238
  shellPath = /bin/sh;
239
- shellScript = "cd \"${SRCROOT}\"\ncd ../..\ncp \"${TARGET_BUILD_DIR}/${EXECUTABLE_PATH}\" .";
239
+ shellScript = "cd \"${SRCROOT}\"\ncd ../..\ncp \"${TARGET_BUILD_DIR}/${EXECUTABLE_PATH}\" .\n";
240
240
  };
241
241
  /* End PBXShellScriptBuildPhase section */
242
242
 
@@ -267,9 +267,9 @@
267
267
  B3BA65AA1F5A269100B34850 /* Runner.swift in Sources */,
268
268
  B3BA65AF1F5A2D5C00B34850 /* RunnerArgument.swift in Sources */,
269
269
  D5B8A5B31FFDC49E00536B24 /* ControlCommand.swift in Sources */,
270
+ 1257253924B7992C00E04FA3 /* main.swift in Sources */,
270
271
  B302067E1F5E3E9000DE6EBD /* PrecheckfileProtocol.swift in Sources */,
271
272
  B3BA65AD1F5A269100B34850 /* SocketResponse.swift in Sources */,
272
- B3BA65A81F5A269100B34850 /* main.swift in Sources */,
273
273
  D55B28C71F6C588300DC42C5 /* Scanfile.swift in Sources */,
274
274
  0311E387230AC1B20060BB5C /* Plugins.swift in Sources */,
275
275
  D55B28C91F6C588300DC42C5 /* Snapshotfile.swift in Sources */,
@@ -1,3 +1,6 @@
1
+ // Gymfile.swift
2
+ // Copyright (c) 2020 FastlaneTools
3
+
1
4
  // This class is automatically included in FastlaneRunner during build
2
5
 
3
6
  // This autogenerated file will be overwritten or replaced during build time, or when you initialize `gym`
@@ -8,10 +11,10 @@
8
11
  // new group so that it won't be marked for upgrade
9
12
  //
10
13
 
11
- class Gymfile: GymfileProtocol {
14
+ public class Gymfile: GymfileProtocol {
12
15
  // If you want to enable `gym`, run `fastlane gym init`
13
16
  // After, this file will be replaced with a custom implementation that contains values you supplied
14
17
  // during the `init` process, and you won't see this message
15
18
  }
16
19
 
17
- // Generated with fastlane 2.158.0
20
+ // Generated with fastlane 2.163.0
@@ -1,4 +1,7 @@
1
- protocol GymfileProtocol: class {
1
+ // GymfileProtocol.swift
2
+ // Copyright (c) 2020 FastlaneTools
3
+
4
+ public protocol GymfileProtocol: class {
2
5
  /// Path to the workspace file
3
6
  var workspace: String? { get }
4
7
 
@@ -132,7 +135,7 @@ protocol GymfileProtocol: class {
132
135
  var clonedSourcePackagesPath: String? { get }
133
136
  }
134
137
 
135
- extension GymfileProtocol {
138
+ public extension GymfileProtocol {
136
139
  var workspace: String? { return nil }
137
140
  var project: String? { return nil }
138
141
  var scheme: String? { return nil }
@@ -181,4 +184,4 @@ extension GymfileProtocol {
181
184
 
182
185
  // Please don't remove the lines below
183
186
  // They are used to detect outdated files
184
- // FastlaneRunnerAPIVersion [0.9.43]
187
+ // FastlaneRunnerAPIVersion [0.9.49]
@@ -1,9 +1,5 @@
1
- //
2
- // LaneFileProtocol.swift
3
- // FastlaneSwiftRunner
4
- //
5
- // Created by Joshua Liebowitz on 8/4/17.
6
- //
1
+ // LaneFileProtocol.swift
2
+ // Copyright (c) 2020 FastlaneTools
7
3
 
8
4
  //
9
5
  // ** NOTE **
@@ -16,30 +12,25 @@ import Foundation
16
12
 
17
13
  public protocol LaneFileProtocol: class {
18
14
  var fastlaneVersion: String { get }
19
- static func runLane(named: String, parameters: [String: String]) -> Bool
15
+ static func runLane(from fastfile: LaneFile?, named lane: String, with parameters: [String: String]) -> Bool
20
16
 
21
17
  func recordLaneDescriptions()
22
- func beforeAll()
23
- func afterAll(currentLane: String)
18
+ func beforeAll(with lane: String)
19
+ func afterAll(with lane: String)
24
20
  func onError(currentLane: String, errorInfo: String)
25
21
  }
26
22
 
27
23
  public extension LaneFileProtocol {
28
- var fastlaneVersion: String { return "" } // default "" because that means any is fine
29
- func beforeAll() {} // no op by default
30
- func afterAll(currentLane _: String) {} // no op by default
31
- func onError(currentLane _: String, errorInfo _: String) {} // no op by default
32
- func recordLaneDescriptions() {} // no op by default
24
+ var fastlaneVersion: String { return "" } // Defaults to "" because that means any is fine
25
+ func beforeAll(with lane: String) {} // No-op by default
26
+ func afterAll(with lane: String) {} // No-op by default
27
+ func onError(currentLane _: String, errorInfo _: String) {} // No-op by default
28
+ func recordLaneDescriptions() {} // No-op by default
33
29
  }
34
30
 
35
31
  @objcMembers
36
- public class LaneFile: NSObject, LaneFileProtocol {
37
- private(set) static var fastfileInstance: Fastfile?
38
-
39
- // Called before any lane is executed.
40
- private func setupAllTheThings() {
41
- LaneFile.fastfileInstance!.beforeAll()
42
- }
32
+ open class LaneFile: NSObject, LaneFileProtocol {
33
+ private(set) static var fastfileInstance: LaneFile?
43
34
 
44
35
  private static func trimLaneFromName(laneName: String) -> String {
45
36
  return String(laneName.prefix(laneName.count - 4))
@@ -52,7 +43,14 @@ public class LaneFile: NSObject, LaneFileProtocol {
52
43
  private static var laneFunctionNames: [String] {
53
44
  var lanes: [String] = []
54
45
  var methodCount: UInt32 = 0
55
- let methodList = class_copyMethodList(self, &methodCount)
46
+ #if !SWIFT_PACKAGE
47
+ let methodList = class_copyMethodList(self, &methodCount)
48
+ #else
49
+ // In SPM we're calling this functions out of the scope of the normal binary that it's
50
+ // being built, so *self* in this scope would be the SPM executable instead of the Fastfile
51
+ // that we'd normally expect.
52
+ let methodList = class_copyMethodList(type(of: fastfileInstance!), &methodCount)
53
+ #endif
56
54
  for i in 0 ..< Int(methodCount) {
57
55
  let selName = sel_getName(method_getName(methodList![i]))
58
56
  let name = String(cString: selName)
@@ -92,18 +90,28 @@ public class LaneFile: NSObject, LaneFileProtocol {
92
90
  }
93
91
  }
94
92
 
95
- public static func runLane(named: String, parameters: [String: String]) -> Bool {
96
- log(message: "Running lane: \(named)")
97
- loadFastfile()
98
-
99
- guard let fastfileInstance: Fastfile = self.fastfileInstance else {
100
- let message = "Unable to instantiate class named: \(className())"
101
- log(message: message)
102
- fatalError(message)
103
- }
104
-
93
+ public static func runLane(from fastfile: LaneFile?, named lane: String, with parameters: [String: String]) -> Bool {
94
+ log(message: "Running lane: \(lane)")
95
+ #if !SWIFT_PACKAGE
96
+ // When not in SPM environment, we load the Fastfile from its `className()`.
97
+ loadFastfile()
98
+ guard let fastfileInstance = self.fastfileInstance as? Fastfile else {
99
+ let message = "Unable to instantiate class named: \(className())"
100
+ log(message: message)
101
+ fatalError(message)
102
+ }
103
+ #else
104
+ // When in SPM environment, we can't load the Fastfile from its `className()` because the executable is in
105
+ // another scope, so `className()` won't be the expected Fastfile. Instead, we load the Fastfile as a Lanefile
106
+ // in a static way, by parameter.
107
+ guard let fastfileInstance = fastfile else {
108
+ log(message: "Found nil instance of fastfile")
109
+ preconditionFailure()
110
+ }
111
+ self.fastfileInstance = fastfileInstance
112
+ #endif
105
113
  let currentLanes = lanes
106
- let lowerCasedLaneRequested = named.lowercased()
114
+ let lowerCasedLaneRequested = lane.lowercased()
107
115
 
108
116
  guard let laneMethod = currentLanes[lowerCasedLaneRequested] else {
109
117
  let laneNames = laneFunctionNames.map { laneFuctionName in
@@ -114,7 +122,7 @@ public class LaneFile: NSObject, LaneFileProtocol {
114
122
  }
115
123
  }.joined(separator: ", ")
116
124
 
117
- let message = "[!] Could not find lane '\(named)'. Available lanes: \(laneNames)"
125
+ let message = "[!] Could not find lane '\(lane)'. Available lanes: \(laneNames)"
118
126
  log(message: message)
119
127
 
120
128
  let shutdownCommand = ControlCommand(commandType: .cancel(cancelReason: .clientError), message: message)
@@ -122,15 +130,16 @@ public class LaneFile: NSObject, LaneFileProtocol {
122
130
  return false
123
131
  }
124
132
 
125
- // call all methods that need to be called before we start calling lanes
126
- fastfileInstance.setupAllTheThings()
133
+ // Call all methods that need to be called before we start calling lanes.
134
+ fastfileInstance.beforeAll(with: lane)
127
135
 
128
- // We need to catch all possible errors here and display a nice message
136
+ // We need to catch all possible errors here and display a nice message.
129
137
  _ = fastfileInstance.perform(NSSelectorFromString(laneMethod), with: parameters)
130
138
 
131
- // only call on success
132
- fastfileInstance.afterAll(currentLane: named)
133
- log(message: "Done running lane: \(named) 🚀")
139
+ // Call only on success.
140
+ fastfileInstance.afterAll(with: lane)
141
+
142
+ log(message: "Done running lane: \(lane) 🚀")
134
143
  return true
135
144
  }
136
145
  }
@@ -0,0 +1,77 @@
1
+ // MainProcess.swift
2
+ // Copyright (c) 2020 FastlaneTools
3
+
4
+ //
5
+ // ** NOTE **
6
+ // This file is provided by fastlane and WILL be overwritten in future updates
7
+ // If you want to add extra functionality to this project, create a new file in a
8
+ // new group so that it won't be marked for upgrade
9
+ //
10
+
11
+ import Foundation
12
+ #if canImport(SwiftShell)
13
+ import SwiftShell
14
+ #endif
15
+
16
+ let argumentProcessor = ArgumentProcessor(args: CommandLine.arguments)
17
+ let timeout = argumentProcessor.commandTimeout
18
+
19
+ class MainProcess {
20
+ var doneRunningLane = false
21
+ var thread: Thread!
22
+ #if SWIFT_PACKAGE
23
+ var lastPrintDate = Date.distantFuture
24
+ var timeBetweenPrints = Int.min
25
+ var rubySocketCommand: AsyncCommand!
26
+ #endif
27
+
28
+ @objc func connectToFastlaneAndRunLane(_ fastfile: LaneFile?) {
29
+ runner.startSocketThread(port: argumentProcessor.port)
30
+
31
+ let completedRun = Fastfile.runLane(from: fastfile, named: argumentProcessor.currentLane, with: argumentProcessor.laneParameters())
32
+ if completedRun {
33
+ runner.disconnectFromFastlaneProcess()
34
+ }
35
+
36
+ doneRunningLane = true
37
+ }
38
+
39
+ func startFastlaneThread(with fastFile: LaneFile?) {
40
+ #if !SWIFT_PACKAGE
41
+ thread = Thread(target: self, selector: #selector(connectToFastlaneAndRunLane), object: nil)
42
+ #else
43
+ thread = Thread(target: self, selector: #selector(connectToFastlaneAndRunLane), object: fastFile)
44
+ #endif
45
+ thread.name = "worker thread"
46
+ #if SWIFT_PACKAGE
47
+ let PATH = run("/bin/bash", "-c", "-l", "eval $(/usr/libexec/path_helper -s) ; echo $PATH").stdout
48
+ main.env["PATH"] = PATH
49
+ let path = main.run(bash: "which fastlane").stdout
50
+ let pids = main.run("lsof", "-t", "-i", ":2000").stdout.split(separator: "\n")
51
+ pids.forEach { main.run("kill", "-9", $0) }
52
+ rubySocketCommand = main.runAsync(path, "socket_server", "-c", "1200")
53
+ lastPrintDate = Date()
54
+ rubySocketCommand.stderror.onStringOutput { print($0) }
55
+ rubySocketCommand.stdout.onStringOutput { stdout in
56
+ print(stdout)
57
+ self.timeBetweenPrints = Int(self.lastPrintDate.timeIntervalSinceNow)
58
+ }
59
+ _ = Runner.waitWithPolling(self.timeBetweenPrints, toEventually: { $0 > 5 }, timeout: 10)
60
+ thread.start()
61
+ #endif
62
+ }
63
+ }
64
+
65
+ public class Main {
66
+ let process = MainProcess()
67
+
68
+ public init() {}
69
+
70
+ public func run(with fastFile: LaneFile?) {
71
+ process.startFastlaneThread(with: fastFile)
72
+
73
+ while !process.doneRunningLane, RunLoop.current.run(mode: RunLoopMode.defaultRunLoopMode, before: Date(timeIntervalSinceNow: 2)) {
74
+ // no op
75
+ }
76
+ }
77
+ }
@@ -1,3 +1,6 @@
1
+ // Matchfile.swift
2
+ // Copyright (c) 2020 FastlaneTools
3
+
1
4
  // This class is automatically included in FastlaneRunner during build
2
5
 
3
6
  // This autogenerated file will be overwritten or replaced during build time, or when you initialize `match`
@@ -8,10 +11,10 @@
8
11
  // new group so that it won't be marked for upgrade
9
12
  //
10
13
 
11
- class Matchfile: MatchfileProtocol {
14
+ public class Matchfile: MatchfileProtocol {
12
15
  // If you want to enable `match`, run `fastlane match init`
13
16
  // After, this file will be replaced with a custom implementation that contains values you supplied
14
17
  // during the `init` process, and you won't see this message
15
18
  }
16
19
 
17
- // Generated with fastlane 2.158.0
20
+ // Generated with fastlane 2.163.0
@@ -1,4 +1,7 @@
1
- protocol MatchfileProtocol: class {
1
+ // MatchfileProtocol.swift
2
+ // Copyright (c) 2020 FastlaneTools
3
+
4
+ public protocol MatchfileProtocol: class {
2
5
  /// Define the profile type, can be appstore, adhoc, development, enterprise, developer_id
3
6
  var type: String { get }
4
7
 
@@ -17,8 +20,14 @@ protocol MatchfileProtocol: class {
17
20
  /// The bundle identifier(s) of your app (comma-separated)
18
21
  var appIdentifier: [String] { get }
19
22
 
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
+ var apiKeyPath: String? { get }
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)
27
+ var apiKey: [String: Any]? { get }
28
+
20
29
  /// Your Apple ID Username
21
- var username: String { get }
30
+ var username: String? { get }
22
31
 
23
32
  /// The ID of your Developer Portal team if you're in multiple teams
24
33
  var teamId: String? { get }
@@ -50,7 +59,7 @@ protocol MatchfileProtocol: class {
50
59
  /// Use a basic authorization header to access the git repo (e.g.: access via HTTPS, GitHub Actions, etc), usually a string in Base64
51
60
  var gitBasicAuthorization: String? { get }
52
61
 
53
- /// Use a bearer authorization header to access the git repo (e.g.: access to an Azure Devops repository), usually a string in Base64
62
+ /// Use a bearer authorization header to access the git repo (e.g.: access to an Azure DevOps repository), usually a string in Base64
54
63
  var gitBearerAuthorization: String? { get }
55
64
 
56
65
  /// Use a private key to access the git repo (e.g.: access to GitHub repository via Deploy keys), usually a id_rsa named file or the contents hereof
@@ -116,18 +125,23 @@ protocol MatchfileProtocol: class {
116
125
  /// Path in which to export certificates, key and profile
117
126
  var outputPath: String? { get }
118
127
 
128
+ /// Skips setting the partition list (which can sometimes take a long time). Setting the partition list is usually needed to prevent Xcode from prompting to allow a cert to be used for signing
129
+ var skipSetPartitionList: Bool { get }
130
+
119
131
  /// Print out extra information and all commands
120
132
  var verbose: Bool { get }
121
133
  }
122
134
 
123
- extension MatchfileProtocol {
135
+ public extension MatchfileProtocol {
124
136
  var type: String { return "development" }
125
137
  var additionalCertTypes: [String]? { return nil }
126
138
  var readonly: Bool { return false }
127
139
  var generateAppleCerts: Bool { return true }
128
140
  var skipProvisioningProfiles: Bool { return false }
129
141
  var appIdentifier: [String] { return [] }
130
- var username: String { return "" }
142
+ var apiKeyPath: String? { return nil }
143
+ var apiKey: [String: Any]? { return nil }
144
+ var username: String? { return nil }
131
145
  var teamId: String? { return nil }
132
146
  var teamName: String? { return nil }
133
147
  var storageMode: String { return "git" }
@@ -160,9 +174,10 @@ extension MatchfileProtocol {
160
174
  var profileName: String? { return nil }
161
175
  var failOnNameTaken: Bool { return false }
162
176
  var outputPath: String? { return nil }
177
+ var skipSetPartitionList: Bool { return false }
163
178
  var verbose: Bool { return false }
164
179
  }
165
180
 
166
181
  // Please don't remove the lines below
167
182
  // They are used to detect outdated files
168
- // FastlaneRunnerAPIVersion [0.9.37]
183
+ // FastlaneRunnerAPIVersion [0.9.43]
@@ -1,4 +1,5 @@
1
- // This class is automatically included in FastlaneRunner during build
1
+ // Plugins.swift
2
+ // Copyright (c) 2020 FastlaneTools
2
3
 
3
4
  // This autogenerated file will be overwritten or replaced when installing/updating plugins or running "fastlane generate_swift"
4
5
  //
@@ -1,3 +1,6 @@
1
+ // Precheckfile.swift
2
+ // Copyright (c) 2020 FastlaneTools
3
+
1
4
  // This class is automatically included in FastlaneRunner during build
2
5
 
3
6
  // This autogenerated file will be overwritten or replaced during build time, or when you initialize `precheck`
@@ -8,10 +11,10 @@
8
11
  // new group so that it won't be marked for upgrade
9
12
  //
10
13
 
11
- class Precheckfile: PrecheckfileProtocol {
14
+ public class Precheckfile: PrecheckfileProtocol {
12
15
  // If you want to enable `precheck`, run `fastlane precheck init`
13
16
  // After, this file will be replaced with a custom implementation that contains values you supplied
14
17
  // during the `init` process, and you won't see this message
15
18
  }
16
19
 
17
- // Generated with fastlane 2.158.0
20
+ // Generated with fastlane 2.163.0
@@ -1,4 +1,13 @@
1
- protocol PrecheckfileProtocol: class {
1
+ // PrecheckfileProtocol.swift
2
+ // Copyright (c) 2020 FastlaneTools
3
+
4
+ public protocol PrecheckfileProtocol: class {
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
+ var apiKeyPath: String? { get }
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)
9
+ var apiKey: [String: Any]? { get }
10
+
2
11
  /// The bundle identifier of your app
3
12
  var appIdentifier: String { get }
4
13
 
@@ -24,7 +33,9 @@ protocol PrecheckfileProtocol: class {
24
33
  var freeStuffInIap: String? { get }
25
34
  }
26
35
 
27
- extension PrecheckfileProtocol {
36
+ public extension PrecheckfileProtocol {
37
+ var apiKeyPath: String? { return nil }
38
+ var apiKey: [String: Any]? { return nil }
28
39
  var appIdentifier: String { return "" }
29
40
  var username: String { return "" }
30
41
  var teamId: String? { return nil }
@@ -37,4 +48,4 @@ extension PrecheckfileProtocol {
37
48
 
38
49
  // Please don't remove the lines below
39
50
  // They are used to detect outdated files
40
- // FastlaneRunnerAPIVersion [0.9.36]
51
+ // FastlaneRunnerAPIVersion [0.9.42]