fastlane 2.191.0 → 2.192.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +92 -92
- data/fastlane/lib/assets/completions/completion.bash +4 -1
- data/fastlane/lib/assets/completions/completion.zsh +6 -5
- data/fastlane/lib/fastlane/actions/create_xcframework.rb +97 -17
- data/fastlane/lib/fastlane/actions/notarize.rb +77 -1
- data/fastlane/lib/fastlane/actions/push_git_tags.rb +1 -1
- data/fastlane/lib/fastlane/actions/zip.rb +3 -3
- data/fastlane/lib/fastlane/version.rb +1 -1
- data/fastlane/swift/Deliverfile.swift +1 -1
- data/fastlane/swift/DeliverfileProtocol.swift +1 -1
- data/fastlane/swift/Fastlane.swift +48 -10
- data/fastlane/swift/Gymfile.swift +1 -1
- data/fastlane/swift/GymfileProtocol.swift +1 -1
- 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 +1 -1
- data/fastlane/swift/Scanfile.swift +1 -1
- data/fastlane/swift/ScanfileProtocol.swift +1 -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/formatting/Brewfile.lock.json +6 -6
- data/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb +41 -0
- data/pilot/lib/pilot/build_manager.rb +0 -1
- data/produce/lib/produce/service.rb +1 -1
- data/spaceship/lib/spaceship/connect_api/api_client.rb +15 -1
- data/spaceship/lib/spaceship/connect_api/models/app.rb +2 -1
- data/spaceship/lib/spaceship/connect_api/testflight/.testflight.rb.swp +0 -0
- data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +7 -5
- data/spaceship/lib/spaceship/connect_api/token.rb +2 -0
- data/supply/lib/supply/client.rb +38 -5
- data/supply/lib/supply/options.rb +7 -0
- metadata +35 -20
@@ -10,6 +10,8 @@ module Fastlane
|
|
10
10
|
verbose = params[:verbose]
|
11
11
|
api_key_path = params[:api_key_path]
|
12
12
|
|
13
|
+
use_notarytool = params[:use_notarytool]
|
14
|
+
|
13
15
|
# Compress and read bundle identifier only for .app bundle.
|
14
16
|
compressed_package_path = nil
|
15
17
|
if File.extname(package_path) == '.app'
|
@@ -30,6 +32,74 @@ module Fastlane
|
|
30
32
|
|
31
33
|
UI.user_error!('Could not read bundle identifier, provide as a parameter') unless bundle_id
|
32
34
|
|
35
|
+
if use_notarytool
|
36
|
+
notarytool(params, package_path, bundle_id, try_early_stapling, print_log, verbose, api_key_path, compressed_package_path)
|
37
|
+
else
|
38
|
+
altool(params, package_path, bundle_id, try_early_stapling, print_log, verbose, api_key_path, compressed_package_path)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def self.notarytool(params, package_path, bundle_id, try_early_stapling, print_log, verbose, api_key_path, compressed_package_path)
|
43
|
+
temp_file = nil
|
44
|
+
|
45
|
+
# Create authorization part of command with either API Key or Apple ID
|
46
|
+
auth_parts = []
|
47
|
+
if api_key_path
|
48
|
+
api_key = Spaceship::ConnectAPI::Token.from_json_file(api_key_path)
|
49
|
+
|
50
|
+
# Writes key contents to temporary file for command
|
51
|
+
require 'tempfile'
|
52
|
+
temp_file = Tempfile.new
|
53
|
+
api_key.write_key_to_file(temp_file.path)
|
54
|
+
|
55
|
+
auth_parts << "--key #{temp_file.path}"
|
56
|
+
auth_parts << "--key-id #{api_key.key_id}"
|
57
|
+
auth_parts << "--issuer #{api_key.issuer_id}"
|
58
|
+
else
|
59
|
+
auth_parts << "--apple-id #{params[:username]}"
|
60
|
+
auth_parts << "--password #{ENV['FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD']}"
|
61
|
+
auth_parts << "--team-id #{params[:asc_provider]}"
|
62
|
+
end
|
63
|
+
|
64
|
+
# Submits package and waits for processing using `xcrun notarytool submit --wait`
|
65
|
+
submit_parts = [
|
66
|
+
"xcrun notarytool submit",
|
67
|
+
(compressed_package_path || package_path).shellescape,
|
68
|
+
"--output-format json",
|
69
|
+
"--wait"
|
70
|
+
] + auth_parts
|
71
|
+
|
72
|
+
submit_command = submit_parts.join(' ')
|
73
|
+
submit_response = Actions.sh(
|
74
|
+
submit_command,
|
75
|
+
log: verbose,
|
76
|
+
error_callback: lambda { |msg|
|
77
|
+
UI.error("Error polling for notarization info: #{msg}")
|
78
|
+
}
|
79
|
+
)
|
80
|
+
|
81
|
+
notarization_info = JSON.parse(submit_response)
|
82
|
+
|
83
|
+
# Staple
|
84
|
+
case notarization_info['status']
|
85
|
+
when 'Accepted'
|
86
|
+
submission_id = notarization_info["id"]
|
87
|
+
UI.success("Successfully uploaded package to notarization service with request identifier #{submission_id}")
|
88
|
+
|
89
|
+
UI.message('Stapling package')
|
90
|
+
self.staple(package_path, verbose)
|
91
|
+
|
92
|
+
UI.success("Successfully notarized and stapled package")
|
93
|
+
when 'Invalid'
|
94
|
+
UI.user_error!("Could not notarize package with message '#{notarization_info['statusSummary']}'")
|
95
|
+
else
|
96
|
+
UI.crash!("Could not notarize package with status '#{notarization_info['status']}'")
|
97
|
+
end
|
98
|
+
ensure
|
99
|
+
temp_file.delete if temp_file
|
100
|
+
end
|
101
|
+
|
102
|
+
def self.altool(params, package_path, bundle_id, try_early_stapling, print_log, verbose, api_key_path, compressed_package_path)
|
33
103
|
UI.message('Uploading package to notarization service, might take a while')
|
34
104
|
|
35
105
|
notarization_upload_command = "xcrun altool --notarize-app -t osx -f \"#{compressed_package_path || package_path}\" --primary-bundle-id #{bundle_id} --output-format xml"
|
@@ -125,7 +195,7 @@ module Fastlane
|
|
125
195
|
|
126
196
|
def self.staple(package_path, verbose)
|
127
197
|
Actions.sh(
|
128
|
-
"xcrun stapler staple
|
198
|
+
"xcrun stapler staple #{package_path.shellescape}",
|
129
199
|
log: verbose
|
130
200
|
)
|
131
201
|
end
|
@@ -180,6 +250,12 @@ module Fastlane
|
|
180
250
|
verify_block: proc do |value|
|
181
251
|
UI.user_error!("Could not find package at '#{value}'") unless File.exist?(value)
|
182
252
|
end),
|
253
|
+
FastlaneCore::ConfigItem.new(key: :use_notarytool,
|
254
|
+
env_name: 'FL_NOTARIZE_USE_NOTARYTOOL',
|
255
|
+
description: 'Whether to `xcrun notarytool` or `xcrun altool`',
|
256
|
+
default_value: Helper.mac? && Helper.xcode_at_least?("13.0"), # Notary tool added in Xcode 13
|
257
|
+
default_value_dynamic: true,
|
258
|
+
type: Boolean),
|
183
259
|
FastlaneCore::ConfigItem.new(key: :try_early_stapling,
|
184
260
|
env_name: 'FL_NOTARIZE_TRY_EARLY_STAPLING',
|
185
261
|
description: 'Whether to try early stapling while the notarization request is in progress',
|
@@ -34,7 +34,7 @@ module Fastlane
|
|
34
34
|
def run_zip_command
|
35
35
|
# The 'zip' command archives relative to the working directory, chdir to produce expected results relative to `path`
|
36
36
|
Dir.chdir(File.expand_path("..", path)) do
|
37
|
-
Actions.sh(zip_command)
|
37
|
+
Actions.sh(*zip_command)
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
@@ -52,8 +52,8 @@ module Fastlane
|
|
52
52
|
# The zip command is executed from the paths **parent** directory, as a result we use just the basename, which is the file or folder within
|
53
53
|
basename = File.basename(path)
|
54
54
|
|
55
|
-
command << output_path
|
56
|
-
command << basename
|
55
|
+
command << output_path
|
56
|
+
command << basename
|
57
57
|
|
58
58
|
unless include.empty?
|
59
59
|
command << "-i"
|
@@ -3504,37 +3504,63 @@ public func createPullRequest(apiToken: OptionalConfigValue<String?> = .fastlane
|
|
3504
3504
|
Package multiple build configs of a library/framework into a single xcframework
|
3505
3505
|
|
3506
3506
|
- parameters:
|
3507
|
-
- frameworks: Frameworks to add to the target xcframework
|
3508
|
-
-
|
3507
|
+
- frameworks: Frameworks (without dSYMs) to add to the target xcframework
|
3508
|
+
- frameworksWithDsyms: Frameworks (with dSYMs) to add to the target xcframework
|
3509
|
+
- libraries: Libraries (without headers or dSYMs) to add to the target xcframework
|
3510
|
+
- librariesWithHeadersOrDsyms: Libraries (with headers or dSYMs) to add to the target xcframework
|
3509
3511
|
- output: The path to write the xcframework to
|
3510
3512
|
- allowInternalDistribution: Specifies that the created xcframework contains information not suitable for public distribution
|
3511
3513
|
|
3512
3514
|
Utility for packaging multiple build configurations of a given library
|
3513
3515
|
or framework into a single xcframework.
|
3514
3516
|
|
3515
|
-
If you want to package several frameworks just provide
|
3516
|
-
the list of frameworks to be packaged using the :frameworks parameter.
|
3517
|
+
If you want to package several frameworks just provide one of:
|
3517
3518
|
|
3518
|
-
|
3519
|
-
|
3520
|
-
|
3521
|
-
|
3519
|
+
* An array containing the list of frameworks using the :frameworks parameter
|
3520
|
+
(if they have no associated dSYMs):
|
3521
|
+
['FrameworkA.framework', 'FrameworkB.framework']
|
3522
|
+
|
3523
|
+
* A hash containing the list of frameworks with their dSYMs using the
|
3524
|
+
:frameworks_with_dsyms parameter:
|
3525
|
+
{
|
3526
|
+
'FrameworkA.framework' => {},
|
3527
|
+
'FrameworkB.framework' => { dsyms: 'FrameworkB.framework.dSYM' }
|
3528
|
+
}
|
3529
|
+
|
3530
|
+
If you want to package several libraries just provide one of:
|
3531
|
+
|
3532
|
+
* An array containing the list of libraries using the :libraries parameter
|
3533
|
+
(if they have no associated headers or dSYMs):
|
3534
|
+
['LibraryA.so', 'LibraryB.so']
|
3535
|
+
|
3536
|
+
* A hash containing the list of libraries with their headers and dSYMs
|
3537
|
+
using the :libraries_with_headers_or_dsyms parameter:
|
3538
|
+
{
|
3539
|
+
'LibraryA.so' => { dsyms: 'libraryA.so.dSYM' },
|
3540
|
+
'LibraryB.so' => { headers: 'headers' }
|
3541
|
+
}
|
3522
3542
|
|
3523
3543
|
Finally specify the location of the xcframework to be generated using the :output
|
3524
3544
|
parameter.
|
3525
3545
|
|
3526
3546
|
*/
|
3527
3547
|
public func createXcframework(frameworks: OptionalConfigValue<[String]?> = .fastlaneDefault(nil),
|
3528
|
-
|
3548
|
+
frameworksWithDsyms: OptionalConfigValue<[String: Any]?> = .fastlaneDefault(nil),
|
3549
|
+
libraries: OptionalConfigValue<[String]?> = .fastlaneDefault(nil),
|
3550
|
+
librariesWithHeadersOrDsyms: OptionalConfigValue<[String: Any]?> = .fastlaneDefault(nil),
|
3529
3551
|
output: String,
|
3530
3552
|
allowInternalDistribution: OptionalConfigValue<Bool> = .fastlaneDefault(false))
|
3531
3553
|
{
|
3532
3554
|
let frameworksArg = frameworks.asRubyArgument(name: "frameworks", type: nil)
|
3555
|
+
let frameworksWithDsymsArg = frameworksWithDsyms.asRubyArgument(name: "frameworks_with_dsyms", type: nil)
|
3533
3556
|
let librariesArg = libraries.asRubyArgument(name: "libraries", type: nil)
|
3557
|
+
let librariesWithHeadersOrDsymsArg = librariesWithHeadersOrDsyms.asRubyArgument(name: "libraries_with_headers_or_dsyms", type: nil)
|
3534
3558
|
let outputArg = RubyCommand.Argument(name: "output", value: output, type: nil)
|
3535
3559
|
let allowInternalDistributionArg = allowInternalDistribution.asRubyArgument(name: "allow_internal_distribution", type: nil)
|
3536
3560
|
let array: [RubyCommand.Argument?] = [frameworksArg,
|
3561
|
+
frameworksWithDsymsArg,
|
3537
3562
|
librariesArg,
|
3563
|
+
librariesWithHeadersOrDsymsArg,
|
3538
3564
|
outputArg,
|
3539
3565
|
allowInternalDistributionArg]
|
3540
3566
|
let args: [RubyCommand.Argument] = array
|
@@ -7103,6 +7129,7 @@ public func nexusUpload(file: String,
|
|
7103
7129
|
|
7104
7130
|
- parameters:
|
7105
7131
|
- package: Path to package to notarize, e.g. .app bundle or disk image
|
7132
|
+
- useNotarytool: Whether to `xcrun notarytool` or `xcrun altool`
|
7106
7133
|
- tryEarlyStapling: Whether to try early stapling while the notarization request is in progress
|
7107
7134
|
- bundleId: Bundle identifier to uniquely identify the package
|
7108
7135
|
- username: Apple ID username
|
@@ -7112,6 +7139,7 @@ public func nexusUpload(file: String,
|
|
7112
7139
|
- apiKeyPath: Path to AppStore Connect API key
|
7113
7140
|
*/
|
7114
7141
|
public func notarize(package: String,
|
7142
|
+
useNotarytool: OptionalConfigValue<Bool> = .fastlaneDefault(true),
|
7115
7143
|
tryEarlyStapling: OptionalConfigValue<Bool> = .fastlaneDefault(false),
|
7116
7144
|
bundleId: OptionalConfigValue<String?> = .fastlaneDefault(nil),
|
7117
7145
|
username: OptionalConfigValue<String?> = .fastlaneDefault(nil),
|
@@ -7121,6 +7149,7 @@ public func notarize(package: String,
|
|
7121
7149
|
apiKeyPath: OptionalConfigValue<String?> = .fastlaneDefault(nil))
|
7122
7150
|
{
|
7123
7151
|
let packageArg = RubyCommand.Argument(name: "package", value: package, type: nil)
|
7152
|
+
let useNotarytoolArg = useNotarytool.asRubyArgument(name: "use_notarytool", type: nil)
|
7124
7153
|
let tryEarlyStaplingArg = tryEarlyStapling.asRubyArgument(name: "try_early_stapling", type: nil)
|
7125
7154
|
let bundleIdArg = bundleId.asRubyArgument(name: "bundle_id", type: nil)
|
7126
7155
|
let usernameArg = username.asRubyArgument(name: "username", type: nil)
|
@@ -7129,6 +7158,7 @@ public func notarize(package: String,
|
|
7129
7158
|
let verboseArg = verbose.asRubyArgument(name: "verbose", type: nil)
|
7130
7159
|
let apiKeyPathArg = apiKeyPath.asRubyArgument(name: "api_key_path", type: nil)
|
7131
7160
|
let array: [RubyCommand.Argument?] = [packageArg,
|
7161
|
+
useNotarytoolArg,
|
7132
7162
|
tryEarlyStaplingArg,
|
7133
7163
|
bundleIdArg,
|
7134
7164
|
usernameArg,
|
@@ -10672,6 +10702,7 @@ public func ssh(username: String,
|
|
10672
10702
|
- deactivateOnPromote: **DEPRECATED!** Google Play does this automatically now - When promoting to a new track, deactivate the binary in the origin track
|
10673
10703
|
- versionCodesToRetain: An array of version codes to retain when publishing a new APK
|
10674
10704
|
- changesNotSentForReview: Indicates that the changes in this edit will not be reviewed until they are explicitly sent for review from the Google Play Console UI
|
10705
|
+
- rescueChangesNotSentForReview: Catches changes_not_sent_for_review errors when an edit is committed and retries with the configuration that the error message recommended
|
10675
10706
|
- inAppUpdatePriority: In-app update priority for all the newly added apks in the release. Can take values between [0,5]
|
10676
10707
|
- obbMainReferencesVersion: References version of 'main' expansion file
|
10677
10708
|
- obbMainFileSize: Size of 'main' expansion file in bytes
|
@@ -10712,6 +10743,7 @@ public func supply(packageName: String,
|
|
10712
10743
|
deactivateOnPromote: OptionalConfigValue<Bool> = .fastlaneDefault(true),
|
10713
10744
|
versionCodesToRetain: OptionalConfigValue<[String]?> = .fastlaneDefault(nil),
|
10714
10745
|
changesNotSentForReview: OptionalConfigValue<Bool> = .fastlaneDefault(false),
|
10746
|
+
rescueChangesNotSentForReview: OptionalConfigValue<Bool> = .fastlaneDefault(true),
|
10715
10747
|
inAppUpdatePriority: OptionalConfigValue<Int?> = .fastlaneDefault(nil),
|
10716
10748
|
obbMainReferencesVersion: OptionalConfigValue<String?> = .fastlaneDefault(nil),
|
10717
10749
|
obbMainFileSize: OptionalConfigValue<String?> = .fastlaneDefault(nil),
|
@@ -10750,6 +10782,7 @@ public func supply(packageName: String,
|
|
10750
10782
|
let deactivateOnPromoteArg = deactivateOnPromote.asRubyArgument(name: "deactivate_on_promote", type: nil)
|
10751
10783
|
let versionCodesToRetainArg = versionCodesToRetain.asRubyArgument(name: "version_codes_to_retain", type: nil)
|
10752
10784
|
let changesNotSentForReviewArg = changesNotSentForReview.asRubyArgument(name: "changes_not_sent_for_review", type: nil)
|
10785
|
+
let rescueChangesNotSentForReviewArg = rescueChangesNotSentForReview.asRubyArgument(name: "rescue_changes_not_sent_for_review", type: nil)
|
10753
10786
|
let inAppUpdatePriorityArg = inAppUpdatePriority.asRubyArgument(name: "in_app_update_priority", type: nil)
|
10754
10787
|
let obbMainReferencesVersionArg = obbMainReferencesVersion.asRubyArgument(name: "obb_main_references_version", type: nil)
|
10755
10788
|
let obbMainFileSizeArg = obbMainFileSize.asRubyArgument(name: "obb_main_file_size", type: nil)
|
@@ -10787,6 +10820,7 @@ public func supply(packageName: String,
|
|
10787
10820
|
deactivateOnPromoteArg,
|
10788
10821
|
versionCodesToRetainArg,
|
10789
10822
|
changesNotSentForReviewArg,
|
10823
|
+
rescueChangesNotSentForReviewArg,
|
10790
10824
|
inAppUpdatePriorityArg,
|
10791
10825
|
obbMainReferencesVersionArg,
|
10792
10826
|
obbMainFileSizeArg,
|
@@ -12296,6 +12330,7 @@ public func uploadToAppStore(apiKeyPath: OptionalConfigValue<String?> = .fastlan
|
|
12296
12330
|
- deactivateOnPromote: **DEPRECATED!** Google Play does this automatically now - When promoting to a new track, deactivate the binary in the origin track
|
12297
12331
|
- versionCodesToRetain: An array of version codes to retain when publishing a new APK
|
12298
12332
|
- changesNotSentForReview: Indicates that the changes in this edit will not be reviewed until they are explicitly sent for review from the Google Play Console UI
|
12333
|
+
- rescueChangesNotSentForReview: Catches changes_not_sent_for_review errors when an edit is committed and retries with the configuration that the error message recommended
|
12299
12334
|
- inAppUpdatePriority: In-app update priority for all the newly added apks in the release. Can take values between [0,5]
|
12300
12335
|
- obbMainReferencesVersion: References version of 'main' expansion file
|
12301
12336
|
- obbMainFileSize: Size of 'main' expansion file in bytes
|
@@ -12336,6 +12371,7 @@ public func uploadToPlayStore(packageName: String,
|
|
12336
12371
|
deactivateOnPromote: OptionalConfigValue<Bool> = .fastlaneDefault(true),
|
12337
12372
|
versionCodesToRetain: OptionalConfigValue<[String]?> = .fastlaneDefault(nil),
|
12338
12373
|
changesNotSentForReview: OptionalConfigValue<Bool> = .fastlaneDefault(false),
|
12374
|
+
rescueChangesNotSentForReview: OptionalConfigValue<Bool> = .fastlaneDefault(true),
|
12339
12375
|
inAppUpdatePriority: OptionalConfigValue<Int?> = .fastlaneDefault(nil),
|
12340
12376
|
obbMainReferencesVersion: OptionalConfigValue<String?> = .fastlaneDefault(nil),
|
12341
12377
|
obbMainFileSize: OptionalConfigValue<String?> = .fastlaneDefault(nil),
|
@@ -12374,6 +12410,7 @@ public func uploadToPlayStore(packageName: String,
|
|
12374
12410
|
let deactivateOnPromoteArg = deactivateOnPromote.asRubyArgument(name: "deactivate_on_promote", type: nil)
|
12375
12411
|
let versionCodesToRetainArg = versionCodesToRetain.asRubyArgument(name: "version_codes_to_retain", type: nil)
|
12376
12412
|
let changesNotSentForReviewArg = changesNotSentForReview.asRubyArgument(name: "changes_not_sent_for_review", type: nil)
|
12413
|
+
let rescueChangesNotSentForReviewArg = rescueChangesNotSentForReview.asRubyArgument(name: "rescue_changes_not_sent_for_review", type: nil)
|
12377
12414
|
let inAppUpdatePriorityArg = inAppUpdatePriority.asRubyArgument(name: "in_app_update_priority", type: nil)
|
12378
12415
|
let obbMainReferencesVersionArg = obbMainReferencesVersion.asRubyArgument(name: "obb_main_references_version", type: nil)
|
12379
12416
|
let obbMainFileSizeArg = obbMainFileSize.asRubyArgument(name: "obb_main_file_size", type: nil)
|
@@ -12411,6 +12448,7 @@ public func uploadToPlayStore(packageName: String,
|
|
12411
12448
|
deactivateOnPromoteArg,
|
12412
12449
|
versionCodesToRetainArg,
|
12413
12450
|
changesNotSentForReviewArg,
|
12451
|
+
rescueChangesNotSentForReviewArg,
|
12414
12452
|
inAppUpdatePriorityArg,
|
12415
12453
|
obbMainReferencesVersionArg,
|
12416
12454
|
obbMainFileSizeArg,
|
@@ -13213,4 +13251,4 @@ public let snapshotfile = Snapshotfile()
|
|
13213
13251
|
|
13214
13252
|
// Please don't remove the lines below
|
13215
13253
|
// They are used to detect outdated files
|
13216
|
-
// FastlaneRunnerAPIVersion [0.9.
|
13254
|
+
// FastlaneRunnerAPIVersion [0.9.133]
|
@@ -43,12 +43,12 @@
|
|
43
43
|
"macOS": "10.15.7"
|
44
44
|
},
|
45
45
|
"big_sur": {
|
46
|
-
"HOMEBREW_VERSION": "2.
|
47
|
-
"HOMEBREW_PREFIX": "/
|
48
|
-
"Homebrew/homebrew-core": "
|
49
|
-
"CLT": "
|
50
|
-
"Xcode": "
|
51
|
-
"macOS": "11.
|
46
|
+
"HOMEBREW_VERSION": "3.2.9",
|
47
|
+
"HOMEBREW_PREFIX": "/opt/homebrew",
|
48
|
+
"Homebrew/homebrew-core": "d2c0a344f23a132f6fdf06a8b1d6d0eaaec54a21",
|
49
|
+
"CLT": "12.5.1.0.1.1623191612",
|
50
|
+
"Xcode": "13.0",
|
51
|
+
"macOS": "11.5.2"
|
52
52
|
},
|
53
53
|
"monterey": {
|
54
54
|
"HOMEBREW_VERSION": "3.2.6-34-g6bb3699",
|
@@ -34,6 +34,46 @@ module Commander
|
|
34
34
|
|
35
35
|
attr_accessor :collector
|
36
36
|
|
37
|
+
# Temporary work around for issues mentioned in https://github.com/fastlane/fastlane/pull/18760
|
38
|
+
# Code taken from https://github.com/commander-rb/commander/blob/40d06bfbc54906d0de7c72ac73f4e9188c9ca294/lib/commander/runner.rb#L372-L385
|
39
|
+
#
|
40
|
+
# Problem:
|
41
|
+
# `optparse` is guessing that command option `-e` is referring to global option `--env` (because it starts with an e).
|
42
|
+
# This is raising OptionParser::MissingArgument error because `--env` takes a string argument.
|
43
|
+
# A command of `-e --verbose` works because `--verbose` is seen as the argument.
|
44
|
+
# A command of `--verbose -e` doesn't work because no argument after `-e` so MissingArgument is raised again.
|
45
|
+
# This broke somewhere between Ruby 2.5 and Ruby 2.6
|
46
|
+
#
|
47
|
+
# Solution:
|
48
|
+
# Proper solution is to set `parser.require_exact = true` but this only available on `optparse` version 0.1.1
|
49
|
+
# which is not used by Commander.
|
50
|
+
# `require_exact` will prevent OptionParser from assuming `-e` is the same as `--env STRING`
|
51
|
+
# Even if it was on RubyGems, it would require Commander to allow this option to be set on OptionParser
|
52
|
+
#
|
53
|
+
# This work around was made on 2021-08-13
|
54
|
+
#
|
55
|
+
# When fixed:
|
56
|
+
# This method implementation overrides one provided by Commander::Runner already. Just delete this method
|
57
|
+
# so the existing one can be used
|
58
|
+
def parse_global_options
|
59
|
+
parser = options.inject(OptionParser.new) do |options, option|
|
60
|
+
options.on(*option[:args], &global_option_proc(option[:switches], &option[:proc]))
|
61
|
+
end
|
62
|
+
|
63
|
+
# This is the actual solution but is only in version 0.1.1 of optparse and its not in Commander
|
64
|
+
# This is the only change from Commanders implementation of parse_global_options
|
65
|
+
parser.require_exact = true
|
66
|
+
|
67
|
+
options = @args.dup
|
68
|
+
begin
|
69
|
+
parser.parse!(options)
|
70
|
+
rescue OptionParser::InvalidOption => e
|
71
|
+
# Remove the offending args and retry.
|
72
|
+
options = options.reject { |o| e.args.include?(o) }
|
73
|
+
retry
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
37
77
|
def run!
|
38
78
|
require_program(:version, :description)
|
39
79
|
trap('INT') { abort(program(:int_message)) } if program(:int_message)
|
@@ -47,6 +87,7 @@ module Commander
|
|
47
87
|
say(version)
|
48
88
|
return
|
49
89
|
end
|
90
|
+
|
50
91
|
parse_global_options
|
51
92
|
remove_global_options(options, @args)
|
52
93
|
|