fastlane 2.173.0 → 2.178.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (134) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +82 -82
  3. data/cert/lib/cert/options.rb +2 -2
  4. data/cert/lib/cert/runner.rb +1 -1
  5. data/deliver/lib/deliver/app_screenshot.rb +6 -2
  6. data/deliver/lib/deliver/options.rb +2 -2
  7. data/deliver/lib/deliver/runner.rb +8 -4
  8. data/deliver/lib/deliver/upload_metadata.rb +3 -3
  9. data/deliver/lib/deliver/upload_screenshots.rb +12 -11
  10. data/fastlane/lib/fastlane/actions/adb.rb +1 -1
  11. data/fastlane/lib/fastlane/actions/app_store_build_number.rb +3 -3
  12. data/fastlane/lib/fastlane/actions/app_store_connect_api_key.rb +6 -2
  13. data/fastlane/lib/fastlane/actions/appaloosa.rb +7 -2
  14. data/fastlane/lib/fastlane/actions/appetize.rb +13 -1
  15. data/fastlane/lib/fastlane/actions/backup_file.rb +1 -1
  16. data/fastlane/lib/fastlane/actions/build_and_upload_to_appetize.rb +10 -2
  17. data/fastlane/lib/fastlane/actions/carthage.rb +22 -0
  18. data/fastlane/lib/fastlane/actions/cocoapods.rb +15 -1
  19. data/fastlane/lib/fastlane/actions/commit_github_file.rb +11 -1
  20. data/fastlane/lib/fastlane/actions/create_xcframework.rb +5 -0
  21. data/fastlane/lib/fastlane/actions/docs/capture_android_screenshots.md +1 -1
  22. data/fastlane/lib/fastlane/actions/docs/frame_screenshots.md +1 -1
  23. data/fastlane/lib/fastlane/actions/docs/sync_code_signing.md +8 -2
  24. data/fastlane/lib/fastlane/actions/download_dsyms.rb +5 -15
  25. data/fastlane/lib/fastlane/actions/get_github_release.rb +11 -1
  26. data/fastlane/lib/fastlane/actions/git_commit.rb +1 -1
  27. data/fastlane/lib/fastlane/actions/github_api.rb +2 -1
  28. data/fastlane/lib/fastlane/actions/increment_build_number.rb +8 -1
  29. data/fastlane/lib/fastlane/actions/jazzy.rb +10 -1
  30. data/fastlane/lib/fastlane/actions/latest_testflight_build_number.rb +2 -2
  31. data/fastlane/lib/fastlane/actions/push_to_git_remote.rb +1 -2
  32. data/fastlane/lib/fastlane/actions/register_device.rb +3 -3
  33. data/fastlane/lib/fastlane/actions/register_devices.rb +3 -3
  34. data/fastlane/lib/fastlane/actions/restore_file.rb +1 -1
  35. data/fastlane/lib/fastlane/actions/set_changelog.rb +3 -3
  36. data/fastlane/lib/fastlane/actions/swiftlint.rb +1 -1
  37. data/fastlane/lib/fastlane/actions/update_code_signing_settings.rb +1 -1
  38. data/fastlane/lib/fastlane/actions/upload_symbols_to_crashlytics.rb +4 -5
  39. data/fastlane/lib/fastlane/actions/upload_to_testflight.rb +5 -1
  40. data/fastlane/lib/fastlane/documentation/actions_list.rb +2 -2
  41. data/fastlane/lib/fastlane/erb_template_helper.rb +7 -1
  42. data/fastlane/lib/fastlane/fast_file.rb +9 -5
  43. data/fastlane/lib/fastlane/helper/adb_helper.rb +1 -1
  44. data/fastlane/lib/fastlane/helper/gem_helper.rb +2 -2
  45. data/fastlane/lib/fastlane/version.rb +1 -1
  46. data/fastlane/swift/Actions.swift +1 -1
  47. data/fastlane/swift/Appfile.swift +1 -1
  48. data/fastlane/swift/ArgumentProcessor.swift +1 -1
  49. data/fastlane/swift/ControlCommand.swift +1 -1
  50. data/fastlane/swift/Deliverfile.swift +1 -1
  51. data/fastlane/swift/DeliverfileProtocol.swift +1 -1
  52. data/fastlane/swift/Fastlane.swift +71 -27
  53. data/fastlane/swift/Gymfile.swift +1 -1
  54. data/fastlane/swift/GymfileProtocol.swift +1 -1
  55. data/fastlane/swift/LaneFileProtocol.swift +1 -1
  56. data/fastlane/swift/MainProcess.swift +1 -1
  57. data/fastlane/swift/Matchfile.swift +1 -1
  58. data/fastlane/swift/MatchfileProtocol.swift +1 -1
  59. data/fastlane/swift/Plugins.swift +1 -1
  60. data/fastlane/swift/Precheckfile.swift +1 -1
  61. data/fastlane/swift/PrecheckfileProtocol.swift +1 -1
  62. data/fastlane/swift/RubyCommand.swift +1 -1
  63. data/fastlane/swift/RubyCommandable.swift +1 -1
  64. data/fastlane/swift/Runner.swift +2 -2
  65. data/fastlane/swift/RunnerArgument.swift +1 -1
  66. data/fastlane/swift/Scanfile.swift +1 -1
  67. data/fastlane/swift/ScanfileProtocol.swift +9 -1
  68. data/fastlane/swift/Screengrabfile.swift +1 -1
  69. data/fastlane/swift/ScreengrabfileProtocol.swift +1 -1
  70. data/fastlane/swift/Snapshotfile.swift +1 -1
  71. data/fastlane/swift/SnapshotfileProtocol.swift +1 -1
  72. data/fastlane/swift/SocketClient.swift +1 -1
  73. data/fastlane/swift/SocketClientDelegateProtocol.swift +1 -1
  74. data/fastlane/swift/SocketResponse.swift +1 -1
  75. data/fastlane/swift/formatting/Brewfile.lock.json +20 -14
  76. data/fastlane/swift/main.swift +1 -1
  77. data/fastlane_core/lib/fastlane_core.rb +1 -0
  78. data/fastlane_core/lib/fastlane_core/command_executor.rb +3 -9
  79. data/fastlane_core/lib/fastlane_core/configuration/commander_generator.rb +1 -1
  80. data/fastlane_core/lib/fastlane_core/configuration/config_item.rb +23 -0
  81. data/fastlane_core/lib/fastlane_core/configuration/configuration.rb +9 -5
  82. data/fastlane_core/lib/fastlane_core/helper.rb +26 -5
  83. data/fastlane_core/lib/fastlane_core/ipa_upload_package_builder.rb +3 -2
  84. data/fastlane_core/lib/fastlane_core/itunes_transporter.rb +14 -8
  85. data/fastlane_core/lib/fastlane_core/keychain_importer.rb +1 -1
  86. data/fastlane_core/lib/fastlane_core/pkg_upload_package_builder.rb +3 -2
  87. data/fastlane_core/lib/fastlane_core/project.rb +23 -20
  88. data/{deliver/lib/deliver → fastlane_core/lib/fastlane_core}/queue_worker.rb +2 -2
  89. data/fastlane_core/lib/fastlane_core/ui/interface.rb +1 -1
  90. data/fastlane_core/lib/fastlane_core/update_checker/update_checker.rb +2 -2
  91. data/gym/lib/gym/.runner.rb.swp +0 -0
  92. data/gym/lib/gym/generators/.package_command_generator_xcode7.rb.swp +0 -0
  93. data/match/lib/match/importer.rb +1 -1
  94. data/match/lib/match/migrate.rb +1 -1
  95. data/match/lib/match/nuke.rb +6 -1
  96. data/match/lib/match/options.rb +2 -2
  97. data/match/lib/match/runner.rb +1 -1
  98. data/match/lib/match/storage/google_cloud_storage.rb +1 -1
  99. data/match/lib/match/storage/s3_storage.rb +1 -1
  100. data/pilot/lib/pilot/build_manager.rb +25 -8
  101. data/pilot/lib/pilot/manager.rb +1 -1
  102. data/pilot/lib/pilot/options.rb +5 -5
  103. data/precheck/lib/precheck/options.rb +2 -2
  104. data/precheck/lib/precheck/runner.rb +2 -2
  105. data/scan/lib/scan/detect_values.rb +4 -1
  106. data/scan/lib/scan/options.rb +10 -0
  107. data/scan/lib/scan/runner.rb +27 -0
  108. data/screengrab/lib/screengrab/android_environment.rb +2 -2
  109. data/screengrab/lib/screengrab/runner.rb +1 -2
  110. data/sigh/lib/sigh/download_all.rb +1 -1
  111. data/sigh/lib/sigh/options.rb +2 -2
  112. data/sigh/lib/sigh/runner.rb +1 -1
  113. data/snapshot/lib/snapshot/simulator_launchers/simulator_launcher_base.rb +2 -1
  114. data/spaceship/README.md +2 -2
  115. data/spaceship/lib/spaceship/client.rb +18 -17
  116. data/spaceship/lib/spaceship/connect_api/api_client.rb +40 -7
  117. data/spaceship/lib/spaceship/connect_api/models/app.rb +1 -1
  118. data/spaceship/lib/spaceship/connect_api/models/app_preview_set.rb +5 -0
  119. data/spaceship/lib/spaceship/connect_api/models/app_screenshot_set.rb +5 -0
  120. data/spaceship/lib/spaceship/connect_api/models/app_store_version_localization.rb +6 -0
  121. data/spaceship/lib/spaceship/connect_api/models/beta_group.rb +5 -0
  122. data/spaceship/lib/spaceship/connect_api/models/build.rb +5 -0
  123. data/spaceship/lib/spaceship/connect_api/models/build_beta_detail.rb +4 -0
  124. data/spaceship/lib/spaceship/connect_api/models/bundle_id.rb +24 -0
  125. data/spaceship/lib/spaceship/connect_api/models/bundle_id_capability.rb +26 -4
  126. data/spaceship/lib/spaceship/connect_api/models/user_invitation.rb +13 -0
  127. data/spaceship/lib/spaceship/connect_api/provisioning/provisioning.rb +53 -0
  128. data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +13 -0
  129. data/spaceship/lib/spaceship/connect_api/token.rb +2 -2
  130. data/spaceship/lib/spaceship/connect_api/tunes/tunes.rb +15 -0
  131. data/spaceship/lib/spaceship/playground.rb +2 -2
  132. data/spaceship/lib/spaceship/tunes/tunes_client.rb +2 -2
  133. data/spaceship/lib/spaceship/two_step_or_factor_client.rb +42 -29
  134. metadata +38 -22
@@ -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.173.0
20
+ // Generated with fastlane 2.178.0
@@ -196,4 +196,4 @@ public extension GymfileProtocol {
196
196
 
197
197
  // Please don't remove the lines below
198
198
  // They are used to detect outdated files
199
- // FastlaneRunnerAPIVersion [0.9.59]
199
+ // FastlaneRunnerAPIVersion [0.9.64]
@@ -1,5 +1,5 @@
1
1
  // LaneFileProtocol.swift
2
- // Copyright (c) 2020 FastlaneTools
2
+ // Copyright (c) 2021 FastlaneTools
3
3
 
4
4
  //
5
5
  // ** NOTE **
@@ -1,5 +1,5 @@
1
1
  // MainProcess.swift
2
- // Copyright (c) 2020 FastlaneTools
2
+ // Copyright (c) 2021 FastlaneTools
3
3
 
4
4
  //
5
5
  // ** NOTE **
@@ -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.173.0
20
+ // Generated with fastlane 2.178.0
@@ -184,4 +184,4 @@ public extension MatchfileProtocol {
184
184
 
185
185
  // Please don't remove the lines below
186
186
  // They are used to detect outdated files
187
- // FastlaneRunnerAPIVersion [0.9.53]
187
+ // FastlaneRunnerAPIVersion [0.9.58]
@@ -1,5 +1,5 @@
1
1
  // Plugins.swift
2
- // Copyright (c) 2020 FastlaneTools
2
+ // Copyright (c) 2021 FastlaneTools
3
3
 
4
4
  // This autogenerated file will be overwritten or replaced when installing/updating plugins or running "fastlane generate_swift"
5
5
  //
@@ -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.173.0
20
+ // Generated with fastlane 2.178.0
@@ -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.52]
55
+ // FastlaneRunnerAPIVersion [0.9.57]
@@ -1,5 +1,5 @@
1
1
  // RubyCommand.swift
2
- // Copyright (c) 2020 FastlaneTools
2
+ // Copyright (c) 2021 FastlaneTools
3
3
 
4
4
  //
5
5
  // ** NOTE **
@@ -1,5 +1,5 @@
1
1
  // RubyCommandable.swift
2
- // Copyright (c) 2020 FastlaneTools
2
+ // Copyright (c) 2021 FastlaneTools
3
3
 
4
4
  //
5
5
  // ** NOTE **
@@ -1,5 +1,5 @@
1
1
  // Runner.swift
2
- // Copyright (c) 2020 FastlaneTools
2
+ // Copyright (c) 2021 FastlaneTools
3
3
 
4
4
  //
5
5
  // ** NOTE **
@@ -140,7 +140,7 @@ extension Runner {
140
140
  dispatchGroup.leave()
141
141
  }
142
142
 
143
- fileprivate func testDispatchTimeoutResult(_ timeoutResult: DispatchTimeoutResult, failureMessage: String, timeToWait _: DispatchTimeInterval) -> Bool {
143
+ private func testDispatchTimeoutResult(_ timeoutResult: DispatchTimeoutResult, failureMessage: String, timeToWait _: DispatchTimeInterval) -> Bool {
144
144
  switch timeoutResult {
145
145
  case .success:
146
146
  return true
@@ -1,5 +1,5 @@
1
1
  // RunnerArgument.swift
2
- // Copyright (c) 2020 FastlaneTools
2
+ // Copyright (c) 2021 FastlaneTools
3
3
 
4
4
  //
5
5
  // ** NOTE **
@@ -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.173.0
20
+ // Generated with fastlane 2.178.0
@@ -20,6 +20,9 @@ public protocol ScanfileProtocol: class {
20
20
  /// Should skip auto detecting of devices if none were specified
21
21
  var skipDetectDevices: Bool { get }
22
22
 
23
+ /// Should fail if devices not found
24
+ var ensureDevicesFound: Bool { get }
25
+
23
26
  /// Enabling this option will automatically killall Simulator processes before the run
24
27
  var forceQuitSimulator: Bool { get }
25
28
 
@@ -110,6 +113,9 @@ public protocol ScanfileProtocol: class {
110
113
  /// Should zip the derived data build products and place in output path?
111
114
  var shouldZipBuildProducts: Bool { get }
112
115
 
116
+ /// Should provide additional copy of .xctestrun file (settings.xctestrun) and place in output path?
117
+ var outputXctestrun: Bool { get }
118
+
113
119
  /// Should an Xcode result bundle be generated in the output directory
114
120
  var resultBundle: Bool { get }
115
121
 
@@ -214,6 +220,7 @@ public extension ScanfileProtocol {
214
220
  var device: String? { return nil }
215
221
  var devices: [String]? { return nil }
216
222
  var skipDetectDevices: Bool { return false }
223
+ var ensureDevicesFound: Bool { return false }
217
224
  var forceQuitSimulator: Bool { return false }
218
225
  var resetSimulator: Bool { return false }
219
226
  var disableSlideToType: Bool { return true }
@@ -244,6 +251,7 @@ public extension ScanfileProtocol {
244
251
  var xcprettyArgs: String? { return nil }
245
252
  var derivedDataPath: String? { return nil }
246
253
  var shouldZipBuildProducts: Bool { return false }
254
+ var outputXctestrun: Bool { return false }
247
255
  var resultBundle: Bool { return false }
248
256
  var useClangReportName: Bool { return false }
249
257
  var concurrentWorkers: Int? { return nil }
@@ -280,4 +288,4 @@ public extension ScanfileProtocol {
280
288
 
281
289
  // Please don't remove the lines below
282
290
  // They are used to detect outdated files
283
- // FastlaneRunnerAPIVersion [0.9.64]
291
+ // FastlaneRunnerAPIVersion [0.9.69]
@@ -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.173.0
20
+ // Generated with fastlane 2.178.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.54]
99
+ // FastlaneRunnerAPIVersion [0.9.59]
@@ -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.173.0
20
+ // Generated with fastlane 2.178.0
@@ -196,4 +196,4 @@ public extension SnapshotfileProtocol {
196
196
 
197
197
  // Please don't remove the lines below
198
198
  // They are used to detect outdated files
199
- // FastlaneRunnerAPIVersion [0.9.48]
199
+ // FastlaneRunnerAPIVersion [0.9.53]
@@ -1,5 +1,5 @@
1
1
  // SocketClient.swift
2
- // Copyright (c) 2020 FastlaneTools
2
+ // Copyright (c) 2021 FastlaneTools
3
3
 
4
4
  //
5
5
  // ** NOTE **
@@ -1,5 +1,5 @@
1
1
  // SocketClientDelegateProtocol.swift
2
- // Copyright (c) 2020 FastlaneTools
2
+ // Copyright (c) 2021 FastlaneTools
3
3
 
4
4
  //
5
5
  // ** NOTE **
@@ -1,5 +1,5 @@
1
1
  // SocketResponse.swift
2
- // Copyright (c) 2020 FastlaneTools
2
+ // Copyright (c) 2021 FastlaneTools
3
3
 
4
4
  //
5
5
  // ** NOTE **
@@ -2,22 +2,28 @@
2
2
  "entries": {
3
3
  "brew": {
4
4
  "swiftformat": {
5
- "version": "0.45.6",
5
+ "version": "0.47.12",
6
6
  "bottle": {
7
+ "rebuild": 0,
7
8
  "cellar": ":any_skip_relocation",
8
9
  "prefix": "/usr/local",
10
+ "root_url": "https://homebrew.bintray.com/bottles",
9
11
  "files": {
12
+ "arm64_big_sur": {
13
+ "url": "https://homebrew.bintray.com/bottles/swiftformat-0.47.12.arm64_big_sur.bottle.tar.gz",
14
+ "sha256": "334b736f7c78b1bc48882f55558e79571be591281462bc91dedea6dac10034be"
15
+ },
16
+ "big_sur": {
17
+ "url": "https://homebrew.bintray.com/bottles/swiftformat-0.47.12.big_sur.bottle.tar.gz",
18
+ "sha256": "b7ba5043f29c548dd05374125faa61dd07690bffe373890cb608609e4a7e2413"
19
+ },
10
20
  "catalina": {
11
- "url": "https://homebrew.bintray.com/bottles/swiftformat-0.45.6.catalina.bottle.tar.gz",
12
- "sha256": "7f23ff740679b30e313c91533c2f3e6fa4210bb68f8e383c29e7f922f87d8f66"
21
+ "url": "https://homebrew.bintray.com/bottles/swiftformat-0.47.12.catalina.bottle.tar.gz",
22
+ "sha256": "030b2e18168f5680c4ee387812b14057c4cb148b6f6800b983b1b298f4af15b1"
13
23
  },
14
24
  "mojave": {
15
- "url": "https://homebrew.bintray.com/bottles/swiftformat-0.45.6.mojave.bottle.tar.gz",
16
- "sha256": "b5349b775ff60c73c284d5de8ad2c0fdfb35428cff92bb7a8e5fcc6536750b89"
17
- },
18
- "high_sierra": {
19
- "url": "https://homebrew.bintray.com/bottles/swiftformat-0.45.6.high_sierra.bottle.tar.gz",
20
- "sha256": "34d900217ca12736a112c31e54a5f4f7e64c1fe224f6e4ea76ad1d25b149f647"
25
+ "url": "https://homebrew.bintray.com/bottles/swiftformat-0.47.12.mojave.bottle.tar.gz",
26
+ "sha256": "b3e35821d3094d08eb9f8423ce7d18cb5462bb5b1d02a3156ed1a10f6539709a"
21
27
  }
22
28
  }
23
29
  }
@@ -27,12 +33,12 @@
27
33
  "system": {
28
34
  "macos": {
29
35
  "catalina": {
30
- "HOMEBREW_VERSION": "2.4.9-133-g0fdf8f2",
36
+ "HOMEBREW_VERSION": "3.0.4-64-g31a4989",
31
37
  "HOMEBREW_PREFIX": "/usr/local",
32
- "Homebrew/homebrew-core": "7141f37f3af0e6702f6dab2263852ddefbbbf8ed",
33
- "CLT": "11.0.28.3",
34
- "Xcode": "11.6",
35
- "macOS": "10.15.4"
38
+ "Homebrew/homebrew-core": "443ddf805144323198a5b37b071516534243377b",
39
+ "CLT": "11.0.33.12",
40
+ "Xcode": "12.2",
41
+ "macOS": "10.15.7"
36
42
  },
37
43
  "big_sur": {
38
44
  "HOMEBREW_VERSION": "2.4.13-249-g6454504",
@@ -1,5 +1,5 @@
1
1
  // main.swift
2
- // Copyright (c) 2020 FastlaneTools
2
+ // Copyright (c) 2021 FastlaneTools
3
3
 
4
4
  //
5
5
  // ** NOTE **
@@ -35,6 +35,7 @@ require_relative 'fastlane_core/analytics/analytics_ingester_client'
35
35
  require_relative 'fastlane_core/analytics/analytics_session'
36
36
  require_relative 'fastlane_core/tag_version'
37
37
  require_relative 'fastlane_core/fastlane_pty'
38
+ require_relative 'fastlane_core/queue_worker'
38
39
 
39
40
  # Third Party code
40
41
  require 'colored'
@@ -13,16 +13,10 @@ module FastlaneCore
13
13
  #
14
14
  # Derived from https://stackoverflow.com/a/5471032/3005
15
15
  def which(cmd)
16
- # PATHEXT contains the list of file extensions that Windows considers executable, semicolon separated.
17
- # e.g. ".COM;.EXE;.BAT;.CMD"
18
- exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : []
19
- exts << '' # Always have an empty string (= no file extension)
20
-
21
16
  ENV['PATH'].split(File::PATH_SEPARATOR).each do |path|
22
- exts.each do |ext|
23
- cmd_path = File.join(path, "#{cmd}#{ext}")
24
- return cmd_path if Helper.executable?(cmd_path)
25
- end
17
+ cmd_path = File.join(path, cmd)
18
+ executable_path = Helper.get_executable_path(cmd_path)
19
+ return executable_path if Helper.executable?(executable_path)
26
20
  end
27
21
 
28
22
  return nil
@@ -67,7 +67,7 @@ module FastlaneCore
67
67
  long_switch = "--#{option.key} #{value_appendix}"
68
68
 
69
69
  description = option.description
70
- description += " (#{option.env_name})" unless option.env_name.to_s.empty?
70
+ description += " (#{option.env_names.join(', ')})" unless option.env_names.empty?
71
71
 
72
72
  # We compact this array here to remove the short_switch variable if it is nil.
73
73
  # Passing a nil value to global_option has been shown to create problems with
@@ -12,6 +12,9 @@ module FastlaneCore
12
12
  # [String] the name of the environment variable, which is only used if no other values were found
13
13
  attr_accessor :env_name
14
14
 
15
+ # [Array] the names of the environment variables, which is only used if no other values were found
16
+ attr_accessor :env_names
17
+
15
18
  # [String] A description shown to the user
16
19
  attr_accessor :description
17
20
 
@@ -71,6 +74,7 @@ module FastlaneCore
71
74
  # Creates a new option
72
75
  # @param key (Symbol) the key which is used as command parameters or key in the fastlane tools
73
76
  # @param env_name (String) the name of the environment variable, which is only used if no other values were found
77
+ # @param env_names (Array) the names of the environment variables, which is only used if no other values were found
74
78
  # @param description (String) A description shown to the user
75
79
  # @param short_option (String) A string of length 1 which is used for the command parameters (e.g. -f)
76
80
  # @param default_value the value which is used if there was no given values and no environment values
@@ -88,8 +92,10 @@ module FastlaneCore
88
92
  # @param sensitive (Boolean) Set if the variable is sensitive, such as a password or API token, to prevent echoing when prompted for the parameter
89
93
  # @param display_in_shell (Boolean) Set if the variable can be used from shell
90
94
  # rubocop:disable Metrics/ParameterLists
95
+ # rubocop:disable Metrics/PerceivedComplexity
91
96
  def initialize(key: nil,
92
97
  env_name: nil,
98
+ env_names: nil,
93
99
  description: nil,
94
100
  short_option: nil,
95
101
  default_value: nil,
@@ -109,6 +115,11 @@ module FastlaneCore
109
115
  UI.user_error!("key must be a symbol") unless key.kind_of?(Symbol)
110
116
  UI.user_error!("env_name must be a String") unless (env_name || '').kind_of?(String)
111
117
 
118
+ UI.user_error!("env_names must be an Array") unless (env_names || []).kind_of?(Array)
119
+ (env_names || []).each do |name|
120
+ UI.user_error!("env_names must only contain String") unless (name || '').kind_of?(String)
121
+ end
122
+
112
123
  if short_option
113
124
  UI.user_error!("short_option for key :#{key} must of type String") unless short_option.kind_of?(String)
114
125
  UI.user_error!("short_option for key :#{key} must be a string of length 1") unless short_option.delete('-').length == 1
@@ -138,6 +149,7 @@ module FastlaneCore
138
149
 
139
150
  @key = key
140
151
  @env_name = env_name
152
+ @env_names = [env_name].compact + (env_names || [])
141
153
  @description = description
142
154
  @short_option = short_option
143
155
  @default_value = default_value
@@ -160,6 +172,7 @@ module FastlaneCore
160
172
 
161
173
  update_code_gen_default_value_if_able!
162
174
  end
175
+ # rubocop:enable Metrics/PerceivedComplexity
163
176
  # rubocop:enable Metrics/ParameterLists
164
177
 
165
178
  # if code_gen_default_value is nil, use the default value if it isn't a `code_gen_sensitive` value
@@ -228,6 +241,16 @@ module FastlaneCore
228
241
  true
229
242
  end
230
243
 
244
+ def fetch_env_value
245
+ env_names.each do |name|
246
+ next if ENV[name].nil?
247
+ # verify! before using (see https://github.com/fastlane/fastlane/issues/14449)
248
+ return ENV[name].dup if verify!(auto_convert_value(ENV[name]))
249
+ end
250
+
251
+ return nil
252
+ end
253
+
231
254
  # rubocop:disable Metrics/PerceivedComplexity
232
255
  # Returns an updated value type (if necessary)
233
256
  def auto_convert_value(value)
@@ -209,7 +209,6 @@ module FastlaneCore
209
209
 
210
210
  # Returns the value for a certain key. fastlane_core tries to fetch the value from different sources
211
211
  # if 'ask' is true and the value is not present, the user will be prompted to provide a value
212
- # rubocop:disable Metrics/PerceivedComplexity
213
212
  def fetch(key, ask: true)
214
213
  UI.crash!("Key '#{key}' must be a symbol. Example :app_id.") unless key.kind_of?(Symbol)
215
214
 
@@ -218,9 +217,8 @@ module FastlaneCore
218
217
  # Same order as https://docs.fastlane.tools/advanced/#priorities-of-parameters-and-options
219
218
  value = if @values.key?(key) && !@values[key].nil?
220
219
  @values[key]
221
- elsif option.env_name && !ENV[option.env_name].nil?
222
- # verify! before using (see https://github.com/fastlane/fastlane/issues/14449)
223
- ENV[option.env_name].dup if option.verify!(option.auto_convert_value(ENV[option.env_name]))
220
+ elsif (env_value = option.fetch_env_value)
221
+ env_value
224
222
  elsif self.config_file_options.key?(key)
225
223
  self.config_file_options[key]
226
224
  else
@@ -243,11 +241,17 @@ module FastlaneCore
243
241
  while value.nil?
244
242
  UI.important("To not be asked about this value, you can specify it using '#{option.key}'") if ENV["FASTLANE_ONBOARDING_IN_PROCESS"].to_s.length == 0
245
243
  value = option.sensitive ? UI.password("#{option.description}: ") : UI.input("#{option.description}: ")
244
+
245
+ # ConfigItem allows to specify a type for the item but UI.password and
246
+ # UI.input return String values. Try to convert the String input to
247
+ # the option's type before passing it along.
248
+ value = option.auto_convert_value(value)
249
+
246
250
  # Also store this value to use it from now on
247
251
  begin
248
252
  set(key, value)
249
253
  rescue => ex
250
- puts(ex)
254
+ UI.error(ex)
251
255
  value = nil
252
256
  end
253
257
  end
@@ -368,8 +368,29 @@ module FastlaneCore
368
368
 
369
369
  # checks if a given path is an executable file
370
370
  def self.executable?(cmd_path)
371
- # no executable files on Windows, so existing is enough there
372
- cmd_path && !File.directory?(cmd_path) && (File.executable?(cmd_path) || (self.windows? && File.exist?(cmd_path)))
371
+ if !cmd_path || File.directory?(cmd_path)
372
+ return false
373
+ end
374
+
375
+ return File.exist?(get_executable_path(cmd_path))
376
+ end
377
+
378
+ # returns the path of the executable with the correct extension on Windows
379
+ def self.get_executable_path(cmd_path)
380
+ if self.windows?
381
+ # PATHEXT contains the list of file extensions that Windows considers executable, semicolon separated.
382
+ # e.g. ".COM;.EXE;.BAT;.CMD"
383
+ exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : []
384
+
385
+ # no executable files on Windows, so existing is enough there
386
+ # also check if command + ext is present
387
+ exts.each do |ext|
388
+ executable_path = "#{cmd_path}#{ext.downcase}"
389
+ return executable_path if File.exist?(executable_path)
390
+ end
391
+ end
392
+
393
+ return cmd_path
373
394
  end
374
395
 
375
396
  # checks if given file is a valid json file
@@ -425,20 +446,20 @@ module FastlaneCore
425
446
  UI.current.log
426
447
  end
427
448
 
428
- def self.ask_password(message: "Passphrase: ", confirm: nil)
449
+ def self.ask_password(message: "Passphrase: ", confirm: nil, confirmation_message: "Type passphrase again: ")
429
450
  raise "This code should only run in interactive mode" unless UI.interactive?
430
451
 
431
452
  loop do
432
453
  password = UI.password(message)
433
454
  if confirm
434
- password2 = UI.password("Type passphrase again: ")
455
+ password2 = UI.password(confirmation_message)
435
456
  if password == password2
436
457
  return password
437
458
  end
438
459
  else
439
460
  return password
440
461
  end
441
- UI.error("Passphrases differ. Try again")
462
+ UI.error("Your entries do not match. Please try again")
442
463
  end
443
464
  end
444
465
  end