fastlane 2.207.0 → 2.209.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +94 -94
  3. data/deliver/lib/deliver/options.rb +1 -2
  4. data/fastlane/lib/assets/AppfileTemplate +1 -1
  5. data/fastlane/lib/assets/AppfileTemplate.swift +1 -1
  6. data/fastlane/lib/fastlane/actions/changelog_from_git_commits.rb +1 -1
  7. data/fastlane/lib/fastlane/actions/docs/frame_screenshots.md +1 -1
  8. data/fastlane/lib/fastlane/actions/import_certificate.rb +1 -1
  9. data/fastlane/lib/fastlane/actions/pod_push.rb +19 -1
  10. data/fastlane/lib/fastlane/setup/setup_ios.rb +1 -1
  11. data/fastlane/lib/fastlane/version.rb +1 -1
  12. data/fastlane/swift/Appfile.swift +1 -1
  13. data/fastlane/swift/Deliverfile.swift +1 -1
  14. data/fastlane/swift/DeliverfileProtocol.swift +2 -2
  15. data/fastlane/swift/Fastlane.swift +18 -10
  16. data/fastlane/swift/Gymfile.swift +1 -1
  17. data/fastlane/swift/GymfileProtocol.swift +1 -1
  18. data/fastlane/swift/Matchfile.swift +1 -1
  19. data/fastlane/swift/MatchfileProtocol.swift +1 -1
  20. data/fastlane/swift/Precheckfile.swift +1 -1
  21. data/fastlane/swift/PrecheckfileProtocol.swift +1 -1
  22. data/fastlane/swift/Scanfile.swift +1 -1
  23. data/fastlane/swift/ScanfileProtocol.swift +1 -1
  24. data/fastlane/swift/Screengrabfile.swift +1 -1
  25. data/fastlane/swift/ScreengrabfileProtocol.swift +1 -1
  26. data/fastlane/swift/Snapshotfile.swift +1 -1
  27. data/fastlane/swift/SnapshotfileProtocol.swift +2 -2
  28. data/fastlane/swift/formatting/Brewfile.lock.json +16 -16
  29. data/fastlane_core/lib/fastlane_core/cert_checker.rb +68 -13
  30. data/fastlane_core/lib/fastlane_core/keychain_importer.rb +1 -0
  31. data/frameit/lib/frameit/frame_downloader.rb +1 -1
  32. data/match/lib/match/runner.rb +6 -0
  33. data/match/lib/match/setup.rb +1 -1
  34. data/match/lib/match/storage/gitlab/client.rb +17 -1
  35. data/match/lib/match/storage/gitlab/secure_file.rb +1 -2
  36. data/match/lib/match/storage/gitlab_secure_files.rb +5 -2
  37. data/match/lib/match/table_printer.rb +2 -1
  38. data/match/lib/match/utils.rb +15 -2
  39. data/pilot/lib/pilot/build_manager.rb +2 -2
  40. data/snapshot/lib/snapshot/options.rb +1 -1
  41. data/snapshot/lib/snapshot/simulator_launchers/simulator_launcher_base.rb +4 -1
  42. data/spaceship/lib/spaceship/connect_api/response.rb +10 -6
  43. data/spaceship/lib/spaceship/tunes/tunes_client.rb +63 -2
  44. data/spaceship/lib/spaceship/two_step_or_factor_client.rb +1 -1
  45. data/trainer/lib/trainer/junit_generator.rb +1 -1
  46. metadata +22 -34
  47. data/fastlane/lib/.DS_Store +0 -0
  48. data/fastlane/lib/fastlane/.DS_Store +0 -0
  49. data/fastlane/lib/fastlane/actions/.DS_Store +0 -0
  50. data/fastlane/lib/fastlane/actions/.supply.rb.swp +0 -0
  51. data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/project.xcworkspace/xcuserdata/joshholtz.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  52. data/match/lib/match/.module.rb.swp +0 -0
  53. data/match/lib/match/.nuke.rb.swp +0 -0
  54. data/spaceship/lib/spaceship/connect_api/.response.rb.swp +0 -0
  55. data/spaceship/lib/spaceship/connect_api/models/.app.rb.swp +0 -0
  56. data/spaceship/lib/spaceship/connect_api/models/.review_submission.rb.swp +0 -0
  57. data/spaceship/lib/spaceship/connect_api/testflight/.testflight.rb.swp +0 -0
  58. data/trainer/lib/.DS_Store +0 -0
@@ -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.207.0
20
+ // Generated with fastlane 2.209.1
@@ -53,7 +53,7 @@ public protocol SnapshotfileProtocol: AnyObject {
53
53
  /// Enabling this option will automatically override the status bar to show 9:41 AM, full battery, and full reception (Adjust 'SNAPSHOT_SIMULATOR_WAIT_FOR_BOOT_TIMEOUT' environment variable if override status bar is not working. Might be because simulator is not fully booted. Defaults to 10 seconds)
54
54
  var overrideStatusBar: Bool { get }
55
55
 
56
- /// Fully customize the status bar by setting each option here. See `xcrun simctl status_bar --help`
56
+ /// Fully customize the status bar by setting each option here. Requires `override_status_bar` to be set to `true`. See `xcrun simctl status_bar --help`
57
57
  var overrideStatusBarArguments: String? { get }
58
58
 
59
59
  /// Enabling this option will configure the Simulator's system language
@@ -204,4 +204,4 @@ public extension SnapshotfileProtocol {
204
204
 
205
205
  // Please don't remove the lines below
206
206
  // They are used to detect outdated files
207
- // FastlaneRunnerAPIVersion [0.9.98]
207
+ // FastlaneRunnerAPIVersion [0.9.101]
@@ -2,40 +2,40 @@
2
2
  "entries": {
3
3
  "brew": {
4
4
  "swiftformat": {
5
- "version": "0.49.11",
5
+ "version": "0.49.17",
6
6
  "bottle": {
7
7
  "rebuild": 0,
8
8
  "root_url": "https://ghcr.io/v2/homebrew/core",
9
9
  "files": {
10
10
  "arm64_monterey": {
11
11
  "cellar": ":any_skip_relocation",
12
- "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:1c355872557efa651e7baa0a73414b4d944c8045caf5595b49be5aa487c790b5",
13
- "sha256": "1c355872557efa651e7baa0a73414b4d944c8045caf5595b49be5aa487c790b5"
12
+ "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:4b7f2dbc6e2d69c55e556339fd37bcb9b5085ffb26e18ece57f6614f68f71d9a",
13
+ "sha256": "4b7f2dbc6e2d69c55e556339fd37bcb9b5085ffb26e18ece57f6614f68f71d9a"
14
14
  },
15
15
  "arm64_big_sur": {
16
16
  "cellar": ":any_skip_relocation",
17
- "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:a6c6bcd203119f7a0f687ae57502bf93bbd9d4b05e838b8a8e3dbc76679b54c0",
18
- "sha256": "a6c6bcd203119f7a0f687ae57502bf93bbd9d4b05e838b8a8e3dbc76679b54c0"
17
+ "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:6762a1f50c474ace807cbe505c40ec83e07d95f3a709b862b55a4aee358bcbc2",
18
+ "sha256": "6762a1f50c474ace807cbe505c40ec83e07d95f3a709b862b55a4aee358bcbc2"
19
19
  },
20
20
  "monterey": {
21
21
  "cellar": ":any_skip_relocation",
22
- "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:d8d59a615cf956c6ccbdade566bcb18e1f4aeeaae8399f52e55a4bca7b014ed9",
23
- "sha256": "d8d59a615cf956c6ccbdade566bcb18e1f4aeeaae8399f52e55a4bca7b014ed9"
22
+ "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:46ab8382cc299980caf2aa48ca4e08cf3b3052432959e2bd02ca190f168f563b",
23
+ "sha256": "46ab8382cc299980caf2aa48ca4e08cf3b3052432959e2bd02ca190f168f563b"
24
24
  },
25
25
  "big_sur": {
26
26
  "cellar": ":any_skip_relocation",
27
- "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:0dddb88b994904ae813b35a9a3d08f33bbd8b7f1bc15addce9e3d366b48257f5",
28
- "sha256": "0dddb88b994904ae813b35a9a3d08f33bbd8b7f1bc15addce9e3d366b48257f5"
27
+ "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:0145b1f25c402c6d3f4b022a1ec3fc1469b3d61428bc9f47405e2124cffda100",
28
+ "sha256": "0145b1f25c402c6d3f4b022a1ec3fc1469b3d61428bc9f47405e2124cffda100"
29
29
  },
30
30
  "catalina": {
31
31
  "cellar": ":any_skip_relocation",
32
- "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:a0e7393b2667a4fb21723f0f50de3b97c256237aa572927b103dd7467fe44624",
33
- "sha256": "a0e7393b2667a4fb21723f0f50de3b97c256237aa572927b103dd7467fe44624"
32
+ "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:bc210385a7a34bd8babd475927d698e38feb6d9b6bc267f159acd67e90542380",
33
+ "sha256": "bc210385a7a34bd8babd475927d698e38feb6d9b6bc267f159acd67e90542380"
34
34
  },
35
35
  "x86_64_linux": {
36
36
  "cellar": "/home/linuxbrew/.linuxbrew/Cellar",
37
- "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:1d855fe86b853bf153171aa4b9b22c638ba63d42e052795a5e7713afe71f39d6",
38
- "sha256": "1d855fe86b853bf153171aa4b9b22c638ba63d42e052795a5e7713afe71f39d6"
37
+ "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:326c9a8cedeeb429315d94638a5c03a764194b346a2781fe858d5cb83d93662d",
38
+ "sha256": "326c9a8cedeeb429315d94638a5c03a764194b346a2781fe858d5cb83d93662d"
39
39
  }
40
40
  }
41
41
  }
@@ -61,12 +61,12 @@
61
61
  "macOS": "11.0.1"
62
62
  },
63
63
  "monterey": {
64
- "HOMEBREW_VERSION": "3.5.3-17-g74e933c",
64
+ "HOMEBREW_VERSION": "3.5.9",
65
65
  "HOMEBREW_PREFIX": "/opt/homebrew",
66
- "Homebrew/homebrew-core": "94237d1700b55d421ce5580080a9d6dff2deba2a",
66
+ "Homebrew/homebrew-core": "191ec7ef868ea58e6d7305d756516e5d69c2568c",
67
67
  "CLT": "13.4.0.0.1.1651278267",
68
68
  "Xcode": "13.4.1",
69
- "macOS": "12.4"
69
+ "macOS": "12.5"
70
70
  }
71
71
  }
72
72
  }
@@ -3,6 +3,40 @@ require 'openssl'
3
3
 
4
4
  require_relative 'helper'
5
5
 
6
+ # WWDR Intermediate Certificates in https://www.apple.com/certificateauthority/
7
+ WWDRCA_CERTIFICATES = [
8
+ {
9
+ alias: 'G1',
10
+ sha256: 'ce057691d730f89ca25e916f7335f4c8a15713dcd273a658c024023f8eb809c2',
11
+ url: 'https://developer.apple.com/certificationauthority/AppleWWDRCA.cer'
12
+ },
13
+ {
14
+ alias: 'G2',
15
+ sha256: '9ed4b3b88c6a339cf1387895bda9ca6ea31a6b5ce9edf7511845923b0c8ac94c',
16
+ url: 'https://www.apple.com/certificateauthority/AppleWWDRCAG2.cer'
17
+ },
18
+ {
19
+ alias: 'G3',
20
+ sha256: 'dcf21878c77f4198e4b4614f03d696d89c66c66008d4244e1b99161aac91601f',
21
+ url: 'https://www.apple.com/certificateauthority/AppleWWDRCAG3.cer'
22
+ },
23
+ {
24
+ alias: 'G4',
25
+ sha256: 'ea4757885538dd8cb59ff4556f676087d83c85e70902c122e42c0808b5bce14c',
26
+ url: 'https://www.apple.com/certificateauthority/AppleWWDRCAG4.cer'
27
+ },
28
+ {
29
+ alias: 'G5',
30
+ sha256: '53fd008278e5a595fe1e908ae9c5e5675f26243264a5a6438c023e3ce2870760',
31
+ url: 'https://www.apple.com/certificateauthority/AppleWWDRCAG5.cer'
32
+ },
33
+ {
34
+ alias: 'G6',
35
+ sha256: 'bdd4ed6e74691f0c2bfd01be0296197af1379e0418e2d300efa9c3bef642ca30',
36
+ url: 'https://www.apple.com/certificateauthority/AppleWWDRCAG6.cer'
37
+ }
38
+ ]
39
+
6
40
  module FastlaneCore
7
41
  # This class checks if a specific certificate is installed on the current mac
8
42
  class CertChecker
@@ -22,7 +56,7 @@ module FastlaneCore
22
56
  end
23
57
 
24
58
  def self.installed_identies(in_keychain: nil)
25
- install_wwdr_certificates unless wwdr_certificates_installed?
59
+ install_missing_wwdr_certificates
26
60
 
27
61
  available = list_available_identities(in_keychain: in_keychain)
28
62
  # Match for this text against word boundaries to avoid edge cases around multiples of 10 identities!
@@ -81,20 +115,41 @@ module FastlaneCore
81
115
  `#{commands.join(' ')}`
82
116
  end
83
117
 
84
- def self.wwdr_certificates_installed?
85
- certificate_name = "Apple Worldwide Developer Relations Certification Authority"
86
- keychain = wwdr_keychain
87
- response = Helper.backticks("security find-certificate -a -c '#{certificate_name}' #{keychain.shellescape}", print: FastlaneCore::Globals.verbose?)
88
- certs = response.split("keychain: \"#{keychain}\"").drop(1)
89
- certs.count == 2
118
+ def self.installed_wwdr_certificates
119
+ certificate_name = "Apple Worldwide Developer Relations"
120
+
121
+ # Find all installed WWDRCA certificates
122
+ installed_certs = []
123
+ Helper.backticks("security find-certificate -a -c '#{certificate_name}' -p #{wwdr_keychain.shellescape}")
124
+ .lines
125
+ .each do |line|
126
+ if line.start_with?('-----BEGIN CERTIFICATE-----')
127
+ installed_certs << line
128
+ else
129
+ installed_certs.last << line
130
+ end
131
+ end
132
+
133
+ # Get the alias (see `WWDRCA_CERTIFICATES`) of the installed WWDRCA certificates
134
+ installed_certs
135
+ .map do |pem|
136
+ sha256 = Digest::SHA256.hexdigest(OpenSSL::X509::Certificate.new(pem).to_der)
137
+ WWDRCA_CERTIFICATES.find { |c| c[:sha256].casecmp?(sha256) }&.fetch(:alias)
138
+ end
139
+ .compact
90
140
  end
91
141
 
92
- def self.install_wwdr_certificates
93
- install_wwdr_certificate('https://developer.apple.com/certificationauthority/AppleWWDRCA.cer')
94
- install_wwdr_certificate('https://www.apple.com/certificateauthority/AppleWWDRCAG3.cer')
142
+ def self.install_missing_wwdr_certificates
143
+ # Install all Worldwide Developer Relations Intermediate Certificates listed here: https://www.apple.com/certificateauthority/
144
+ missing = WWDRCA_CERTIFICATES.map { |c| c[:alias] } - installed_wwdr_certificates
145
+ missing.each do |cert_alias|
146
+ install_wwdr_certificate(cert_alias)
147
+ end
148
+ missing.count
95
149
  end
96
150
 
97
- def self.install_wwdr_certificate(url)
151
+ def self.install_wwdr_certificate(cert_alias)
152
+ url = WWDRCA_CERTIFICATES.find { |c| c[:alias] == cert_alias }.fetch(:url)
98
153
  file = Tempfile.new(File.basename(url))
99
154
  filename = file.path
100
155
  keychain = wwdr_keychain
@@ -124,8 +179,8 @@ module FastlaneCore
124
179
 
125
180
  def self.wwdr_keychain
126
181
  priority = [
127
- "security list-keychains -d user",
128
- "security default-keychain -d user"
182
+ "security default-keychain -d user",
183
+ "security list-keychains -d user"
129
184
  ]
130
185
  priority.each do |command|
131
186
  keychains = Helper.backticks(command, print: FastlaneCore::Globals.verbose?).split("\n")
@@ -14,6 +14,7 @@ module FastlaneCore
14
14
  command << " -T /usr/bin/codesign" # to not be asked for permission when running a tool like `gym` (before Sierra)
15
15
  command << " -T /usr/bin/security"
16
16
  command << " -T /usr/bin/productbuild" # to not be asked for permission when using an installer cert for macOS
17
+ command << " -T /usr/bin/productsign" # to not be asked for permission when using an installer cert for macOS
17
18
  command << " 1> /dev/null" unless output
18
19
 
19
20
  sensitive_command = command.gsub(password_part, " -P ********")
@@ -53,7 +53,7 @@ module Frameit
53
53
 
54
54
  def print_disclaimer
55
55
  UI.header("Device frames disclaimer")
56
- UI.important("All used device frames are available via Facebook Design: http://facebook.design/devices")
56
+ UI.important("All used device frames are available via Facebook Design: https://design.facebook.com/toolsandresources/devices/")
57
57
  UI.message("----------------------------------------")
58
58
  UI.message("While Facebook has redrawn and shares these assets for the benefit")
59
59
  UI.message("of the design community, Facebook does not own any of the underlying")
@@ -309,6 +309,12 @@ module Match
309
309
  platform: params[:platform]),
310
310
  parsed["TeamIdentifier"].first)
311
311
 
312
+ cert_info = Utils.get_cert_info(parsed["DeveloperCertificates"].first.string).to_h
313
+ Utils.fill_environment(Utils.environment_variable_name_certificate_name(app_identifier: app_identifier,
314
+ type: prov_type,
315
+ platform: params[:platform]),
316
+ cert_info["Common Name"])
317
+
312
318
  Utils.fill_environment(Utils.environment_variable_name_profile_name(app_identifier: app_identifier,
313
319
  type: prov_type,
314
320
  platform: params[:platform]),
@@ -34,7 +34,7 @@ module Match
34
34
  end
35
35
 
36
36
  def storage_options
37
- return ["git", "google_cloud", "s3"]
37
+ return ["git", "google_cloud", "s3", "gitlab_secure_files"]
38
38
  end
39
39
  end
40
40
  end
@@ -69,7 +69,23 @@ module Match
69
69
  "name" => target_file
70
70
  )
71
71
 
72
- execute_request(url, request)
72
+ response = execute_request(url, request)
73
+
74
+ log_upload_error(response, target_file) if response.code != "201"
75
+ end
76
+ end
77
+
78
+ def log_upload_error(response, target_file)
79
+ begin
80
+ response_body = JSON.parse(response.body)
81
+ rescue JSON::ParserError
82
+ response_body = response.body
83
+ end
84
+
85
+ if response_body["message"] && (response_body["message"]["name"] == ["has already been taken"])
86
+ UI.error("#{target_file} already exists in GitLab project #{@project_id}, file not uploaded")
87
+ else
88
+ UI.error("Upload error for #{target_file}: #{response_body}")
73
89
  end
74
90
  end
75
91
 
@@ -43,8 +43,7 @@ module Match
43
43
  saved_file.write(data.read)
44
44
  end
45
45
 
46
- # Set file mode to read-only
47
- FileUtils.chmod('u=r,go-r', destination_file)
46
+ FileUtils.chmod('u=rw,go-r', destination_file)
48
47
  end
49
48
 
50
49
  UI.crash!("Checksum validation failed for #{@file.name}") unless valid_checksum?(destination_file)
@@ -15,6 +15,7 @@ module Match
15
15
  # Store the code signing identities in GitLab Secure Files
16
16
  class GitLabSecureFiles < Interface
17
17
  attr_reader :gitlab_client
18
+ attr_reader :project_id
18
19
  attr_reader :readonly
19
20
  attr_reader :username
20
21
  attr_reader :team_id
@@ -161,7 +162,7 @@ module Match
161
162
  end
162
163
 
163
164
  def skip_docs
164
- false
165
+ true
165
166
  end
166
167
 
167
168
  def list_files(file_name: "", file_ext: "")
@@ -172,7 +173,9 @@ module Match
172
173
  # This method must return the content of the Matchfile
173
174
  # that should be generated
174
175
  def generate_matchfile_content(template: nil)
175
- return "gitlab_project(\"#{self.project_id}\")"
176
+ project = UI.input("What is your GitLab Project (i.e. gitlab-org/gitlab): ")
177
+
178
+ return "gitlab_project(\"#{project}\")"
176
179
  end
177
180
  end
178
181
  end
@@ -33,7 +33,8 @@ module Match
33
33
  Utils.environment_variable_name(app_identifier: app_identifier, type: type, platform: platform) => "Profile UUID",
34
34
  Utils.environment_variable_name_profile_name(app_identifier: app_identifier, type: type, platform: platform) => "Profile Name",
35
35
  Utils.environment_variable_name_profile_path(app_identifier: app_identifier, type: type, platform: platform) => "Profile Path",
36
- Utils.environment_variable_name_team_id(app_identifier: app_identifier, type: type, platform: platform) => "Development Team ID"
36
+ Utils.environment_variable_name_team_id(app_identifier: app_identifier, type: type, platform: platform) => "Development Team ID",
37
+ Utils.environment_variable_name_certificate_name(app_identifier: app_identifier, type: type, platform: platform) => "Certificate Name"
37
38
  }.each do |env_key, name|
38
39
  rows << [name, env_key, ENV[env_key]]
39
40
  end
@@ -31,8 +31,21 @@ module Match
31
31
  (base_environment_variable_name(app_identifier: app_identifier, type: type, platform: platform) + ["profile-path"]).join("_")
32
32
  end
33
33
 
34
- def self.get_cert_info(cer_certificate_path)
35
- cert = OpenSSL::X509::Certificate.new(File.binread(cer_certificate_path))
34
+ def self.environment_variable_name_certificate_name(app_identifier: nil, type: nil, platform: :ios)
35
+ (base_environment_variable_name(app_identifier: app_identifier, type: type, platform: platform) + ["certificate-name"]).join("_")
36
+ end
37
+
38
+ def self.get_cert_info(cer_certificate)
39
+ # can receive a certificate path or the file data
40
+ begin
41
+ if File.exist?(cer_certificate)
42
+ cer_certificate = File.binread(cer_certificate)
43
+ end
44
+ rescue ArgumentError
45
+ # cert strings have null bytes; suppressing output
46
+ end
47
+
48
+ cert = OpenSSL::X509::Certificate.new(cer_certificate)
36
49
 
37
50
  # openssl output:
38
51
  # subject= /UID={User ID}/CN={Certificate Name}/OU={Certificate User}/O={Organisation}/C={Country}
@@ -108,10 +108,10 @@ module Pilot
108
108
 
109
109
  def wait_for_build_processing_to_be_complete(return_when_build_appears = false)
110
110
  platform = fetch_app_platform
111
- if config[:ipa] && platform != "osx"
111
+ if config[:ipa] && platform != "osx" && !config[:distribute_only]
112
112
  app_version = FastlaneCore::IpaFileAnalyser.fetch_app_version(config[:ipa])
113
113
  app_build = FastlaneCore::IpaFileAnalyser.fetch_app_build(config[:ipa])
114
- elsif config[:pkg]
114
+ elsif config[:pkg] && !config[:distribute_only]
115
115
  app_version = FastlaneCore::PkgFileAnalyser.fetch_app_version(config[:pkg])
116
116
  app_build = FastlaneCore::PkgFileAnalyser.fetch_app_build(config[:pkg])
117
117
  else
@@ -133,7 +133,7 @@ module Snapshot
133
133
  is_string: false),
134
134
  FastlaneCore::ConfigItem.new(key: :override_status_bar_arguments,
135
135
  env_name: 'SNAPSHOT_OVERRIDE_STATUS_BAR_ARGUMENTS',
136
- description: "Fully customize the status bar by setting each option here. See `xcrun simctl status_bar --help`",
136
+ description: "Fully customize the status bar by setting each option here. Requires `override_status_bar` to be set to `true`. See `xcrun simctl status_bar --help`",
137
137
  optional: true,
138
138
  type: String),
139
139
  FastlaneCore::ConfigItem.new(key: :localize_simulator,
@@ -135,7 +135,10 @@ module Snapshot
135
135
  if arguments.nil? || arguments.empty?
136
136
  # The time needs to be passed as ISO8601 so the simulator formats it correctly
137
137
  time = Time.new(2007, 1, 9, 9, 41, 0)
138
- arguments = "--time #{time.iso8601} --dataNetwork wifi --wifiMode active --wifiBars 3 --cellularMode active --cellularBars 4 --batteryState charged --batteryLevel 100"
138
+
139
+ # If you don't override the operator name, you'll get "Carrier" in the status bar on no-notch devices such as iPhone 8. Pass an empty string to blank it out.
140
+
141
+ arguments = "--time #{time.iso8601} --dataNetwork wifi --wifiMode active --wifiBars 3 --cellularMode active --operatorName '' --cellularBars 4 --batteryState charged --batteryLevel 100"
139
142
  end
140
143
 
141
144
  Helper.backticks("xcrun simctl status_bar #{device_udid} override #{arguments} &> /dev/null")
@@ -22,13 +22,17 @@ module Spaceship
22
22
  return links["next"]
23
23
  end
24
24
 
25
- def next_page
25
+ def next_page(&block)
26
26
  url = next_url
27
27
  return nil if url.nil?
28
- return client.get(url)
28
+ if block_given?
29
+ return yield(url)
30
+ else
31
+ return client.get(url)
32
+ end
29
33
  end
30
34
 
31
- def next_pages(count: 1)
35
+ def next_pages(count: 1, &block)
32
36
  if !count.nil? && count < 0
33
37
  count = 0
34
38
  end
@@ -38,7 +42,7 @@ module Spaceship
38
42
 
39
43
  resp = self
40
44
  loop do
41
- resp = resp.next_page
45
+ resp = resp.next_page(&block)
42
46
  break if resp.nil?
43
47
  responses << resp
44
48
  counter += 1
@@ -49,8 +53,8 @@ module Spaceship
49
53
  return responses
50
54
  end
51
55
 
52
- def all_pages
53
- return next_pages(count: nil)
56
+ def all_pages(&block)
57
+ return next_pages(count: nil, &block)
54
58
  end
55
59
 
56
60
  def to_models
@@ -9,6 +9,7 @@ require_relative 'errors'
9
9
  require_relative 'iap_subscription_pricing_tier'
10
10
  require_relative 'pricing_tier'
11
11
  require_relative 'territory'
12
+ require_relative '../connect_api/response'
12
13
  module Spaceship
13
14
  # rubocop:disable Metrics/ClassLength
14
15
  class TunesClient < Spaceship::Client
@@ -254,8 +255,68 @@ module Spaceship
254
255
  #####################################################
255
256
 
256
257
  def applications
257
- r = request(:get, 'ra/apps/manageyourapps/summary/v2')
258
- parse_response(r, 'data')['summaries']
258
+ # Doing this real bad puts for now until a more formal deprecation logic can get made
259
+ puts("Spaceship::Tunes::Application.all is deprecated")
260
+ puts(" It's using a temporary patch to keep it from raising an error but things may not work correctly")
261
+ puts(" Please consider switching to Spaceship::ConnectAPI if you can")
262
+ puts(" For more details - https://github.com/fastlane/fastlane/pull/20480")
263
+
264
+ # This legacy endpoint went offline around July 7th, 2022. This is a rough attempt
265
+ # at retrofitting using the newer App Store Connect API endpoints
266
+ #
267
+ # This could all be done easily with Spaceship::ConnectAPI::App.find but there were a lot of
268
+ # circular dependency issues that were very difficult to solve because. Spaceship::Tunes would be
269
+ # using Spaceship::ConnectAPI which uses Spaceship::Tunes
270
+ #
271
+ # However, using Spaceship::ConnectAPI::Response works. This will fetch multiple pages of app
272
+ # if it needs to
273
+ #
274
+ # https://github.com/fastlane/fastlane/pull/20480
275
+ r = request(:get, "https://appstoreconnect.apple.com/iris/v1/apps?include=appStoreVersions,prices")
276
+ response = Spaceship::ConnectAPI::Response.new(
277
+ body: r.body,
278
+ status: r.status,
279
+ headers: r.headers,
280
+ client: nil
281
+ )
282
+
283
+ apps = response.all_pages do |url|
284
+ r = request(:get, url)
285
+ Spaceship::ConnectAPI::Response.new(
286
+ body: r.body,
287
+ status: r.status,
288
+ headers: r.headers,
289
+ client: nil
290
+ )
291
+ end.flat_map(&:to_models)
292
+
293
+ apps.map do |asc_app|
294
+ platforms = (asc_app.app_store_versions || []).map(&:platform).uniq.map do |asc_platform|
295
+ case asc_platform
296
+ when "TV_OS"
297
+ "appletvos"
298
+ when "MAC_OS"
299
+ "osx"
300
+ when "IOS"
301
+ "ios"
302
+ else
303
+ raise "Cannot find a matching platform for '#{asc_platform}'}"
304
+ end
305
+ end
306
+
307
+ {
308
+ 'adamId' => asc_app.id,
309
+ 'name' => asc_app.name,
310
+ 'vendorId' => "",
311
+ 'bundleId' => asc_app.bundle_id,
312
+ 'lastModifiedDate' => nil,
313
+ 'issuesCount' => nil,
314
+ 'iconUrl' => nil,
315
+ 'versionSets' => platforms.map do |platform|
316
+ { 'type' => 'app', 'platformString' => platform }
317
+ end
318
+ }
319
+ end
259
320
  end
260
321
 
261
322
  def app_details(app_id)
@@ -164,7 +164,7 @@ module Spaceship
164
164
  body = { "securityCode" => { "code" => code.to_s } }.to_json
165
165
 
166
166
  # User exited by entering `sms` and wants to choose phone number for SMS
167
- if code == 'sms'
167
+ if code.casecmp?("sms")
168
168
  code_type = 'phone'
169
169
  body = request_two_factor_code_from_phone_choose(response.body["trustedPhoneNumbers"], code_length)
170
170
  end
@@ -15,7 +15,7 @@ module Trainer
15
15
 
16
16
  lib_path = Trainer::ROOT
17
17
  xml_path = File.join(lib_path, "lib/assets/junit.xml.erb")
18
- xml = ERB.new(File.read(xml_path), nil, '<>').result(binding) # http://www.rrn.dk/rubys-erb-templating-system
18
+ xml = ERB.new(File.read(xml_path), trim_mode: '<>').result(binding) # http://www.rrn.dk/rubys-erb-templating-system
19
19
 
20
20
  xml = xml.gsub('system_', 'system-').delete("\e") # Jenkins can not parse 'ESC' symbol
21
21