fastlane 2.177.0 → 2.181.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +1 -1
- data/README.md +83 -70
- data/cert/lib/cert/options.rb +1 -0
- data/cert/lib/cert/runner.rb +5 -1
- data/deliver/lib/deliver/download_screenshots.rb +1 -2
- data/deliver/lib/deliver/options.rb +1 -0
- data/deliver/lib/deliver/runner.rb +10 -2
- data/deliver/lib/deliver/setup.rb +0 -1
- data/deliver/lib/deliver/upload_metadata.rb +2 -1
- data/fastlane/lib/fastlane/actions/app_store_build_number.rb +6 -1
- data/fastlane/lib/fastlane/actions/app_store_connect_api_key.rb +7 -4
- data/fastlane/lib/fastlane/actions/backup_file.rb +1 -1
- data/fastlane/lib/fastlane/actions/build_app.rb +4 -0
- data/fastlane/lib/fastlane/actions/check_app_store_metadata.rb +4 -0
- data/fastlane/lib/fastlane/actions/clipboard.rb +3 -6
- data/fastlane/lib/fastlane/actions/commit_github_file.rb +11 -1
- data/fastlane/lib/fastlane/actions/create_xcframework.rb +5 -0
- data/fastlane/lib/fastlane/actions/docs/upload_to_play_store.md +2 -1
- data/fastlane/lib/fastlane/actions/ensure_env_vars.rb +2 -6
- data/fastlane/lib/fastlane/actions/get_github_release.rb +11 -1
- data/fastlane/lib/fastlane/actions/get_provisioning_profile.rb +4 -0
- data/fastlane/lib/fastlane/actions/get_version_number.rb +17 -10
- data/fastlane/lib/fastlane/actions/git_branch.rb +4 -10
- data/fastlane/lib/fastlane/actions/git_tag_exists.rb +4 -0
- data/fastlane/lib/fastlane/actions/github_api.rb +2 -1
- data/fastlane/lib/fastlane/actions/increment_build_number.rb +8 -1
- data/fastlane/lib/fastlane/actions/install_provisioning_profile.rb +4 -0
- data/fastlane/lib/fastlane/actions/jira.rb +61 -14
- data/fastlane/lib/fastlane/actions/latest_testflight_build_number.rb +1 -0
- data/fastlane/lib/fastlane/actions/match_nuke.rb +59 -0
- data/fastlane/lib/fastlane/actions/notarize.rb +98 -51
- data/fastlane/lib/fastlane/actions/register_device.rb +1 -1
- data/fastlane/lib/fastlane/actions/register_devices.rb +1 -1
- data/fastlane/lib/fastlane/actions/restore_file.rb +1 -1
- data/fastlane/lib/fastlane/actions/set_changelog.rb +1 -1
- data/fastlane/lib/fastlane/actions/slack.rb +148 -127
- data/fastlane/lib/fastlane/actions/sourcedocs.rb +164 -0
- data/fastlane/lib/fastlane/actions/spaceship_logs.rb +1 -1
- data/fastlane/lib/fastlane/actions/update_project_provisioning.rb +1 -2
- data/fastlane/lib/fastlane/erb_template_helper.rb +7 -1
- data/fastlane/lib/fastlane/fast_file.rb +9 -5
- data/fastlane/lib/fastlane/fastlane_require.rb +7 -1
- data/fastlane/lib/fastlane/helper/git_helper.rb +19 -7
- data/fastlane/lib/fastlane/lane_manager.rb +3 -2
- data/fastlane/lib/fastlane/plugins/plugin_fetcher.rb +1 -2
- data/fastlane/lib/fastlane/plugins/plugin_info_collector.rb +1 -2
- data/fastlane/lib/fastlane/plugins/plugin_manager.rb +1 -2
- data/fastlane/lib/fastlane/setup/setup.rb +23 -10
- data/fastlane/lib/fastlane/swift_fastlane_function.rb +4 -0
- data/fastlane/lib/fastlane/swift_runner_upgrader.rb +2 -0
- data/fastlane/lib/fastlane/version.rb +1 -1
- data/fastlane/swift/Deliverfile.swift +1 -1
- data/fastlane/swift/DeliverfileProtocol.swift +3 -3
- data/fastlane/swift/Fastlane.swift +550 -328
- data/fastlane/swift/Gymfile.swift +1 -1
- data/fastlane/swift/GymfileProtocol.swift +1 -1
- data/fastlane/swift/LaneFileProtocol.swift +9 -3
- data/fastlane/swift/Matchfile.swift +1 -1
- data/fastlane/swift/MatchfileProtocol.swift +1 -1
- data/fastlane/swift/Precheckfile.swift +1 -1
- data/fastlane/swift/PrecheckfileProtocol.swift +3 -3
- data/fastlane/swift/RubyCommand.swift +1 -1
- data/fastlane/swift/Scanfile.swift +1 -1
- data/fastlane/swift/ScanfileProtocol.swift +5 -1
- data/fastlane/swift/Screengrabfile.swift +1 -1
- data/fastlane/swift/ScreengrabfileProtocol.swift +1 -1
- data/fastlane/swift/Snapshotfile.swift +1 -1
- data/fastlane/swift/SnapshotfileProtocol.swift +1 -1
- data/fastlane/swift/SocketClient.swift +2 -1
- data/fastlane/swift/SocketResponse.swift +4 -2
- data/fastlane/swift/formatting/Brewfile.lock.json +18 -16
- data/fastlane_core/lib/fastlane_core.rb +22 -21
- data/fastlane_core/lib/fastlane_core/build_watcher.rb +50 -9
- data/fastlane_core/lib/fastlane_core/clipboard.rb +20 -0
- data/fastlane_core/lib/fastlane_core/configuration/configuration.rb +5 -3
- data/fastlane_core/lib/fastlane_core/helper.rb +24 -1
- data/fastlane_core/lib/fastlane_core/itunes_transporter.rb +10 -6
- data/fastlane_core/lib/fastlane_core/project.rb +3 -14
- data/fastlane_core/lib/fastlane_core/queue_worker.rb +2 -2
- data/fastlane_core/lib/fastlane_core/ui/implementations/shell.rb +12 -1
- data/fastlane_core/lib/fastlane_core/ui/interface.rb +1 -1
- data/gym/lib/gym/generators/package_command_generator.rb +4 -0
- data/gym/lib/gym/generators/package_command_generator_xcode7.rb +13 -8
- data/gym/lib/gym/runner.rb +15 -4
- data/match/lib/match/change_password.rb +3 -3
- data/match/lib/match/encryption/interface.rb +1 -1
- data/match/lib/match/encryption/openssl.rb +2 -2
- data/match/lib/match/importer.rb +1 -1
- data/match/lib/match/migrate.rb +1 -1
- data/match/lib/match/module.rb +1 -0
- data/match/lib/match/nuke.rb +1 -1
- data/match/lib/match/runner.rb +1 -1
- data/match/lib/match/storage/google_cloud_storage.rb +1 -1
- data/match/lib/match/storage/s3_storage.rb +1 -1
- data/pilot/lib/pilot/build_manager.rb +9 -4
- data/pilot/lib/pilot/manager.rb +5 -1
- data/pilot/lib/pilot/options.rb +3 -2
- data/precheck/lib/precheck/options.rb +1 -0
- data/precheck/lib/precheck/runner.rb +5 -1
- data/scan/lib/scan/options.rb +10 -5
- data/scan/lib/scan/runner.rb +54 -1
- data/scan/lib/scan/test_command_generator.rb +10 -8
- data/screengrab/lib/screengrab/android_environment.rb +6 -4
- data/screengrab/lib/screengrab/runner.rb +1 -1
- data/sigh/lib/sigh/download_all.rb +1 -1
- data/sigh/lib/sigh/options.rb +1 -0
- data/sigh/lib/sigh/runner.rb +5 -1
- data/snapshot/lib/assets/SnapshotHelper.swift +1 -1
- data/snapshot/lib/snapshot/reports_generator.rb +4 -0
- data/spaceship/README.md +2 -12
- data/spaceship/lib/spaceship/commands_generator.rb +2 -1
- data/spaceship/lib/spaceship/connect_api/models/app_screenshot.rb +1 -1
- data/spaceship/lib/spaceship/connect_api/models/beta_group.rb +5 -0
- data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +13 -0
- data/spaceship/lib/spaceship/connect_api/token.rb +8 -2
- data/spaceship/lib/spaceship/spaceauth_runner.rb +19 -9
- data/spaceship/lib/spaceship/tunes/members.rb +1 -1
- data/supply/lib/supply/client.rb +3 -1
- data/supply/lib/supply/options.rb +2 -2
- data/supply/lib/supply/uploader.rb +1 -0
- metadata +28 -24
- data/gym/lib/gym/.runner.rb.swp +0 -0
@@ -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
|
-
|
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
|
@@ -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
|
+
// FastlaneRunnerAPIVersion [0.9.61]
|
@@ -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\" : \
|
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)!
|
@@ -209,6 +209,9 @@ public protocol ScanfileProtocol: class {
|
|
209
209
|
/// Lets xcodebuild use system's scm configuration
|
210
210
|
var useSystemScm: Bool { get }
|
211
211
|
|
212
|
+
/// The number of times a test can fail before scan should stop retrying
|
213
|
+
var numberOfRetries: Int { get }
|
214
|
+
|
212
215
|
/// Should this step stop the build if the tests fail? Set this to false if you're using trainer
|
213
216
|
var failBuild: Bool { get }
|
214
217
|
}
|
@@ -283,9 +286,10 @@ public extension ScanfileProtocol {
|
|
283
286
|
var skipPackageDependenciesResolution: Bool { return false }
|
284
287
|
var disablePackageAutomaticUpdates: Bool { return false }
|
285
288
|
var useSystemScm: Bool { return false }
|
289
|
+
var numberOfRetries: Int { return 0 }
|
286
290
|
var failBuild: Bool { return true }
|
287
291
|
}
|
288
292
|
|
289
293
|
// Please don't remove the lines below
|
290
294
|
// They are used to detect outdated files
|
291
|
-
// FastlaneRunnerAPIVersion [0.9.
|
295
|
+
// FastlaneRunnerAPIVersion [0.9.73]
|
@@ -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
|
-
|
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,30 @@
|
|
2
2
|
"entries": {
|
3
3
|
"brew": {
|
4
4
|
"swiftformat": {
|
5
|
-
"version": "0.47.
|
5
|
+
"version": "0.47.13",
|
6
6
|
"bottle": {
|
7
7
|
"rebuild": 0,
|
8
|
-
"
|
9
|
-
"prefix": "/usr/local",
|
10
|
-
"root_url": "https://homebrew.bintray.com/bottles",
|
8
|
+
"root_url": "https://ghcr.io/v2/homebrew/core",
|
11
9
|
"files": {
|
12
10
|
"arm64_big_sur": {
|
13
|
-
"
|
14
|
-
"
|
11
|
+
"cellar": ":any_skip_relocation",
|
12
|
+
"url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:fdcdb5e94b9c4d66a32d4515ba3d2db4057865f96aefab0e41fdeaf2879f4f89",
|
13
|
+
"sha256": "fdcdb5e94b9c4d66a32d4515ba3d2db4057865f96aefab0e41fdeaf2879f4f89"
|
15
14
|
},
|
16
15
|
"big_sur": {
|
17
|
-
"
|
18
|
-
"
|
16
|
+
"cellar": ":any_skip_relocation",
|
17
|
+
"url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:cbb7a9803926d8bfaacf5c1a7d4cd07d8fe2255b1885be3ae2ffd8414e4c5292",
|
18
|
+
"sha256": "cbb7a9803926d8bfaacf5c1a7d4cd07d8fe2255b1885be3ae2ffd8414e4c5292"
|
19
19
|
},
|
20
20
|
"catalina": {
|
21
|
-
"
|
22
|
-
"
|
21
|
+
"cellar": ":any_skip_relocation",
|
22
|
+
"url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:3a13e9b1f4a63bc03601897944f71dd4e6942788531dc060322d20fc6b36d2fd",
|
23
|
+
"sha256": "3a13e9b1f4a63bc03601897944f71dd4e6942788531dc060322d20fc6b36d2fd"
|
23
24
|
},
|
24
25
|
"mojave": {
|
25
|
-
"
|
26
|
-
"
|
26
|
+
"cellar": ":any_skip_relocation",
|
27
|
+
"url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:4e0691f12a5ef3b01eba9f41091b8f3457bc65151bfad057a45e8de9525074cd",
|
28
|
+
"sha256": "4e0691f12a5ef3b01eba9f41091b8f3457bc65151bfad057a45e8de9525074cd"
|
27
29
|
}
|
28
30
|
}
|
29
31
|
}
|
@@ -33,11 +35,11 @@
|
|
33
35
|
"system": {
|
34
36
|
"macos": {
|
35
37
|
"catalina": {
|
36
|
-
"HOMEBREW_VERSION": "3.
|
38
|
+
"HOMEBREW_VERSION": "3.1.2-40-g520b811",
|
37
39
|
"HOMEBREW_PREFIX": "/usr/local",
|
38
|
-
"Homebrew/homebrew-core": "
|
39
|
-
"CLT": "11.0.33.12",
|
40
|
-
"Xcode": "12.
|
40
|
+
"Homebrew/homebrew-core": "241a44018cba812f495bfef054b29eab4de92686",
|
41
|
+
"CLT": "11.0.0.33.12",
|
42
|
+
"Xcode": "12.2",
|
41
43
|
"macOS": "10.15.7"
|
42
44
|
},
|
43
45
|
"big_sur": {
|
@@ -3,39 +3,40 @@ require_relative 'fastlane_core/globals'
|
|
3
3
|
require_relative 'fastlane_core/core_ext/string'
|
4
4
|
require_relative 'fastlane_core/core_ext/shellwords'
|
5
5
|
|
6
|
+
require_relative 'fastlane_core/analytics/action_completion_context'
|
7
|
+
require_relative 'fastlane_core/analytics/action_launch_context'
|
8
|
+
require_relative 'fastlane_core/analytics/analytics_event_builder'
|
9
|
+
require_relative 'fastlane_core/analytics/analytics_ingester_client'
|
10
|
+
require_relative 'fastlane_core/analytics/analytics_session'
|
11
|
+
require_relative 'fastlane_core/build_watcher'
|
12
|
+
require_relative 'fastlane_core/cert_checker'
|
13
|
+
require_relative 'fastlane_core/clipboard'
|
14
|
+
require_relative 'fastlane_core/command_executor'
|
15
|
+
require_relative 'fastlane_core/configuration/configuration'
|
16
|
+
require_relative 'fastlane_core/device_manager'
|
6
17
|
require_relative 'fastlane_core/env'
|
18
|
+
require_relative 'fastlane_core/fastlane_folder'
|
19
|
+
require_relative 'fastlane_core/fastlane_pty'
|
7
20
|
require_relative 'fastlane_core/feature/feature'
|
8
21
|
require_relative 'fastlane_core/features'
|
9
22
|
require_relative 'fastlane_core/helper'
|
10
|
-
require_relative 'fastlane_core/configuration/configuration'
|
11
|
-
require_relative 'fastlane_core/update_checker/update_checker'
|
12
|
-
require_relative 'fastlane_core/languages'
|
13
|
-
require_relative 'fastlane_core/cert_checker'
|
14
23
|
require_relative 'fastlane_core/ipa_file_analyser'
|
24
|
+
require_relative 'fastlane_core/ipa_upload_package_builder'
|
15
25
|
require_relative 'fastlane_core/itunes_transporter'
|
16
|
-
require_relative 'fastlane_core/
|
26
|
+
require_relative 'fastlane_core/keychain_importer'
|
27
|
+
require_relative 'fastlane_core/languages'
|
17
28
|
require_relative 'fastlane_core/pkg_file_analyser'
|
18
29
|
require_relative 'fastlane_core/pkg_upload_package_builder'
|
19
|
-
require_relative 'fastlane_core/command_executor'
|
20
|
-
require_relative 'fastlane_core/ipa_upload_package_builder'
|
21
30
|
require_relative 'fastlane_core/print_table'
|
22
31
|
require_relative 'fastlane_core/project'
|
23
|
-
require_relative 'fastlane_core/
|
24
|
-
require_relative 'fastlane_core/
|
25
|
-
require_relative 'fastlane_core/fastlane_folder'
|
26
|
-
require_relative 'fastlane_core/keychain_importer'
|
32
|
+
require_relative 'fastlane_core/provisioning_profile'
|
33
|
+
require_relative 'fastlane_core/queue_worker'
|
27
34
|
require_relative 'fastlane_core/swag'
|
28
|
-
require_relative 'fastlane_core/build_watcher'
|
29
|
-
require_relative 'fastlane_core/ui/errors'
|
30
|
-
require_relative 'fastlane_core/test_parser'
|
31
|
-
require_relative 'fastlane_core/analytics/action_completion_context'
|
32
|
-
require_relative 'fastlane_core/analytics/action_launch_context'
|
33
|
-
require_relative 'fastlane_core/analytics/analytics_event_builder'
|
34
|
-
require_relative 'fastlane_core/analytics/analytics_ingester_client'
|
35
|
-
require_relative 'fastlane_core/analytics/analytics_session'
|
36
35
|
require_relative 'fastlane_core/tag_version'
|
37
|
-
require_relative 'fastlane_core/
|
38
|
-
require_relative 'fastlane_core/
|
36
|
+
require_relative 'fastlane_core/test_parser'
|
37
|
+
require_relative 'fastlane_core/ui/errors'
|
38
|
+
require_relative 'fastlane_core/ui/ui'
|
39
|
+
require_relative 'fastlane_core/update_checker/update_checker'
|
39
40
|
|
40
41
|
# Third Party code
|
41
42
|
require 'colored'
|
@@ -4,6 +4,8 @@ require_relative 'ui/ui'
|
|
4
4
|
|
5
5
|
module FastlaneCore
|
6
6
|
class BuildWatcher
|
7
|
+
VersionMatches = Struct.new(:version, :builds)
|
8
|
+
|
7
9
|
class << self
|
8
10
|
# @return The build we waited for. This method will always return a build
|
9
11
|
def wait_for_build_processing_to_be_complete(app_id: nil, platform: nil, train_version: nil, app_version: nil, build_version: nil, poll_interval: 10, strict_build_watch: false, return_when_build_appears: false, return_spaceship_testflight_build: true, select_latest: false)
|
@@ -23,7 +25,7 @@ module FastlaneCore
|
|
23
25
|
|
24
26
|
showed_info = false
|
25
27
|
loop do
|
26
|
-
matched_build = matching_build(watched_app_version: app_version, watched_build_version: build_version, app_id: app_id, platform: platform, select_latest: select_latest)
|
28
|
+
matched_build, app_version_queried = matching_build(watched_app_version: app_version, watched_build_version: build_version, app_id: app_id, platform: platform, select_latest: select_latest)
|
27
29
|
|
28
30
|
if matched_build.nil? && !showed_info
|
29
31
|
UI.important("Read more information on why this build isn't showing up yet - https://github.com/fastlane/fastlane/issues/14997")
|
@@ -37,6 +39,13 @@ module FastlaneCore
|
|
37
39
|
# having a build resource appear in AppStoreConnect (matched_build) may be enough (i.e. setting a changelog)
|
38
40
|
# so here we may choose to skip the full processing of the build if return_when_build_appears is true
|
39
41
|
if matched_build && (return_when_build_appears || matched_build.processed?)
|
42
|
+
|
43
|
+
if !app_version.nil? && app_version != app_version_queried
|
44
|
+
UI.important("App version is #{app_version} but build was found while querying #{app_version_queried}")
|
45
|
+
UI.important("This shouldn't be an issue as Apple sees #{app_version} and #{app_version_queried} as equal")
|
46
|
+
UI.important("See docs for more info - https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-102364")
|
47
|
+
end
|
48
|
+
|
40
49
|
if return_spaceship_testflight_build
|
41
50
|
return matched_build.to_testflight_build
|
42
51
|
else
|
@@ -60,15 +69,31 @@ module FastlaneCore
|
|
60
69
|
watched_app_version = remove_version_leading_zeros(version: watched_app_version)
|
61
70
|
watched_build_version = remove_version_leading_zeros(version: watched_build_version)
|
62
71
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
72
|
+
# App Store Connect will allow users to upload X.Y is the same as X.Y.0 and treat them as the same version
|
73
|
+
# However, only the first uploaded version format will be the one that is queryable
|
74
|
+
# This could lead to BuildWatcher never finding X.Y.0 if X.Y was upoaded first as X.Y will only yield results
|
75
|
+
#
|
76
|
+
# This will add an additional request to search for both X.Y and X.Y.0 but
|
77
|
+
# will give preference to the version format specified passed in
|
78
|
+
watched_app_version_alternate = alternate_version(watched_app_version)
|
79
|
+
versions = [watched_app_version, watched_app_version_alternate].compact
|
80
|
+
|
81
|
+
version_matches = versions.map do |version|
|
82
|
+
match = VersionMatches.new
|
83
|
+
match.version = version
|
84
|
+
match.builds = Spaceship::ConnectAPI::Build.all(
|
85
|
+
app_id: app_id,
|
86
|
+
version: version,
|
87
|
+
build_number: watched_build_version,
|
88
|
+
platform: platform
|
89
|
+
)
|
90
|
+
|
91
|
+
match
|
92
|
+
end.flatten
|
69
93
|
|
70
94
|
# Raise error if more than 1 build is returned
|
71
95
|
# This should never happen but need to inform the user if it does
|
96
|
+
matched_builds = version_matches.map(&:builds).flatten
|
72
97
|
if matched_builds.size > 1 && !select_latest
|
73
98
|
error_builds = matched_builds.map do |build|
|
74
99
|
"#{build.app_version}(#{build.version}) for #{build.platform} - #{build.processing_state}"
|
@@ -77,9 +102,25 @@ module FastlaneCore
|
|
77
102
|
UI.crash!(error_message)
|
78
103
|
end
|
79
104
|
|
80
|
-
|
105
|
+
version_match = version_matches.reject do |match|
|
106
|
+
match.builds.empty?
|
107
|
+
end.first
|
108
|
+
matched_build = version_match&.builds&.first
|
109
|
+
|
110
|
+
return matched_build, version_match&.version
|
111
|
+
end
|
112
|
+
|
113
|
+
def alternate_version(version)
|
114
|
+
return nil if version.nil?
|
115
|
+
|
116
|
+
version_info = Gem::Version.new(version)
|
117
|
+
if version_info.segments.size == 3 && version_info.segments[2] == 0
|
118
|
+
return version_info.segments[0..1].join(".")
|
119
|
+
elsif version_info.segments.size == 2
|
120
|
+
return "#{version}.0"
|
121
|
+
end
|
81
122
|
|
82
|
-
return
|
123
|
+
return nil
|
83
124
|
end
|
84
125
|
|
85
126
|
def report_status(build: nil)
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'fastlane_core'
|
2
|
+
require 'open3'
|
3
|
+
|
4
|
+
module FastlaneCore
|
5
|
+
class Clipboard
|
6
|
+
def self.copy(content: nil)
|
7
|
+
return UI.crash!("'pbcopy' or 'pbpaste' command not found.") unless is_supported?
|
8
|
+
Open3.popen3('pbcopy') { |input, _, _| input << content }
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.paste
|
12
|
+
return UI.crash!("'pbcopy' or 'pbpaste' command not found.") unless is_supported?
|
13
|
+
return `pbpaste`
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.is_supported?
|
17
|
+
return `which pbcopy`.length > 0 && `which pbpaste`.length > 0
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -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
|
-
|
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?
|