fastlane 2.167.0 → 2.172.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (130) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +76 -76
  3. data/cert/lib/cert/options.rb +3 -3
  4. data/deliver/lib/deliver/app_screenshot.rb +5 -7
  5. data/deliver/lib/deliver/app_screenshot_validator.rb +108 -0
  6. data/deliver/lib/deliver/commands_generator.rb +1 -1
  7. data/deliver/lib/deliver/loader.rb +123 -21
  8. data/deliver/lib/deliver/setup.rb +8 -3
  9. data/deliver/lib/deliver/upload_metadata.rb +6 -10
  10. data/deliver/lib/deliver/upload_screenshots.rb +1 -64
  11. data/fastlane/lib/fastlane/actions/{.download_dsyms.rb.swp → .update_fastlane.rb.swp} +0 -0
  12. data/fastlane/lib/fastlane/actions/add_git_tag.rb +12 -3
  13. data/fastlane/lib/fastlane/actions/artifactory.rb +36 -3
  14. data/fastlane/lib/fastlane/actions/build_app.rb +3 -1
  15. data/fastlane/lib/fastlane/actions/create_pull_request.rb +16 -1
  16. data/fastlane/lib/fastlane/actions/create_xcframework.rb +118 -0
  17. data/fastlane/lib/fastlane/actions/docs/frame_screenshots.md +1 -1
  18. data/fastlane/lib/fastlane/actions/docs/sync_code_signing.md +1 -1
  19. data/fastlane/lib/fastlane/actions/docs/upload_to_app_store.md.erb +4 -0
  20. data/fastlane/lib/fastlane/actions/docs/upload_to_testflight.md +5 -1
  21. data/fastlane/lib/fastlane/actions/download_app_privacy_details_from_app_store.rb +142 -0
  22. data/fastlane/lib/fastlane/actions/download_dsyms.rb +0 -1
  23. data/fastlane/lib/fastlane/actions/git_commit.rb +6 -2
  24. data/fastlane/lib/fastlane/actions/github_api.rb +14 -3
  25. data/fastlane/lib/fastlane/actions/nexus_upload.rb +1 -0
  26. data/fastlane/lib/fastlane/actions/onesignal.rb +13 -3
  27. data/fastlane/lib/fastlane/actions/pod_push.rb +9 -0
  28. data/fastlane/lib/fastlane/actions/push_to_git_remote.rb +9 -1
  29. data/fastlane/lib/fastlane/actions/register_device.rb +1 -1
  30. data/fastlane/lib/fastlane/actions/register_devices.rb +2 -1
  31. data/fastlane/lib/fastlane/actions/set_github_release.rb +21 -8
  32. data/fastlane/lib/fastlane/actions/slack.rb +4 -5
  33. data/fastlane/lib/fastlane/actions/slather.rb +2 -2
  34. data/fastlane/lib/fastlane/actions/spm.rb +2 -2
  35. data/fastlane/lib/fastlane/actions/swiftlint.rb +4 -4
  36. data/fastlane/lib/fastlane/actions/upload_app_privacy_details_to_app_store.rb +291 -0
  37. data/fastlane/lib/fastlane/actions/upload_to_app_store.rb +3 -3
  38. data/fastlane/lib/fastlane/actions/xcode_install.rb +8 -5
  39. data/fastlane/lib/fastlane/cli_tools_distributor.rb +3 -0
  40. data/fastlane/lib/fastlane/plugins/template/.rubocop.yml +1 -1
  41. data/fastlane/lib/fastlane/swift_fastlane_api_generator.rb +3 -0
  42. data/fastlane/lib/fastlane/version.rb +1 -1
  43. data/fastlane/swift/Deliverfile.swift +2 -2
  44. data/fastlane/swift/DeliverfileProtocol.swift +2 -2
  45. data/fastlane/swift/Fastlane.swift +276 -54
  46. data/fastlane/swift/Gymfile.swift +2 -2
  47. data/fastlane/swift/GymfileProtocol.swift +15 -3
  48. data/fastlane/swift/Matchfile.swift +2 -2
  49. data/fastlane/swift/MatchfileProtocol.swift +4 -4
  50. data/fastlane/swift/Precheckfile.swift +2 -2
  51. data/fastlane/swift/PrecheckfileProtocol.swift +6 -2
  52. data/fastlane/swift/Scanfile.swift +2 -2
  53. data/fastlane/swift/ScanfileProtocol.swift +18 -2
  54. data/fastlane/swift/Screengrabfile.swift +2 -2
  55. data/fastlane/swift/ScreengrabfileProtocol.swift +2 -2
  56. data/fastlane/swift/Snapshotfile.swift +2 -2
  57. data/fastlane/swift/SnapshotfileProtocol.swift +15 -3
  58. data/fastlane_core/lib/fastlane_core/helper.rb +3 -3
  59. data/fastlane_core/lib/fastlane_core/ipa_file_analyser.rb +41 -16
  60. data/fastlane_core/lib/fastlane_core/itunes_transporter.rb +3 -4
  61. data/fastlane_core/lib/fastlane_core/project.rb +18 -5
  62. data/frameit/lib/frameit/device_types.rb +7 -1
  63. data/gym/lib/gym/generators/build_command_generator.rb +3 -0
  64. data/gym/lib/gym/options.rb +19 -3
  65. data/match/lib/match/encryption/openssl.rb +4 -2
  66. data/match/lib/match/module.rb +1 -1
  67. data/match/lib/match/options.rb +1 -1
  68. data/match/lib/match/runner.rb +1 -1
  69. data/match/lib/match/storage/git_storage.rb +14 -10
  70. data/precheck/lib/precheck/options.rb +6 -1
  71. data/precheck/lib/precheck/rule_processor.rb +1 -1
  72. data/precheck/lib/precheck/runner.rb +1 -1
  73. data/scan/lib/scan/options.rb +22 -1
  74. data/scan/lib/scan/runner.rb +7 -2
  75. data/scan/lib/scan/slack_poster.rb +4 -1
  76. data/scan/lib/scan/test_command_generator.rb +3 -0
  77. data/screengrab/lib/screengrab/runner.rb +2 -0
  78. data/sigh/lib/sigh/runner.rb +1 -1
  79. data/snapshot/lib/assets/SnapshotHelper.swift +6 -2
  80. data/snapshot/lib/snapshot/options.rb +17 -2
  81. data/snapshot/lib/snapshot/update.rb +1 -1
  82. data/spaceship/lib/spaceship/client.rb +14 -0
  83. data/spaceship/lib/spaceship/connect_api.rb +6 -0
  84. data/spaceship/lib/spaceship/connect_api/api_client.rb +1 -1
  85. data/spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb +3 -2
  86. data/spaceship/lib/spaceship/connect_api/models/app.rb +94 -54
  87. data/spaceship/lib/spaceship/connect_api/models/app_data_usage.rb +59 -0
  88. data/spaceship/lib/spaceship/connect_api/models/app_data_usage_category.rb +65 -0
  89. data/spaceship/lib/spaceship/connect_api/models/app_data_usage_data_protection.rb +27 -0
  90. data/spaceship/lib/spaceship/connect_api/models/app_data_usage_grouping.rb +18 -0
  91. data/spaceship/lib/spaceship/connect_api/models/app_data_usage_purposes.rb +37 -0
  92. data/spaceship/lib/spaceship/connect_api/models/app_data_usages_publish_state.rb +36 -0
  93. data/spaceship/lib/spaceship/connect_api/models/app_info.rb +16 -10
  94. data/spaceship/lib/spaceship/connect_api/models/app_info_localization.rb +8 -4
  95. data/spaceship/lib/spaceship/connect_api/models/app_preview.rb +15 -11
  96. data/spaceship/lib/spaceship/connect_api/models/app_preview_set.rb +13 -9
  97. data/spaceship/lib/spaceship/connect_api/models/app_screenshot.rb +9 -7
  98. data/spaceship/lib/spaceship/connect_api/models/app_screenshot_set.rb +15 -11
  99. data/spaceship/lib/spaceship/connect_api/models/app_store_review_attachment.rb +7 -5
  100. data/spaceship/lib/spaceship/connect_api/models/app_store_review_detail.rb +6 -4
  101. data/spaceship/lib/spaceship/connect_api/models/app_store_version.rb +62 -37
  102. data/spaceship/lib/spaceship/connect_api/models/app_store_version_localization.rb +21 -14
  103. data/spaceship/lib/spaceship/connect_api/models/app_store_version_submission.rb +3 -2
  104. data/spaceship/lib/spaceship/connect_api/models/beta_app_review_submission.rb +3 -2
  105. data/spaceship/lib/spaceship/connect_api/models/beta_feedback.rb +6 -4
  106. data/spaceship/lib/spaceship/connect_api/models/beta_group.rb +12 -2
  107. data/spaceship/lib/spaceship/connect_api/models/beta_tester.rb +12 -8
  108. data/spaceship/lib/spaceship/connect_api/models/build.rb +24 -16
  109. data/spaceship/lib/spaceship/connect_api/models/build_delivery.rb +3 -2
  110. data/spaceship/lib/spaceship/connect_api/models/bundle_id.rb +9 -6
  111. data/spaceship/lib/spaceship/connect_api/models/bundle_id_capability.rb +6 -4
  112. data/spaceship/lib/spaceship/connect_api/models/certificate.rb +12 -8
  113. data/spaceship/lib/spaceship/connect_api/models/device.rb +36 -4
  114. data/spaceship/lib/spaceship/connect_api/models/idfa_declaration.rb +6 -4
  115. data/spaceship/lib/spaceship/connect_api/models/profile.rb +12 -8
  116. data/spaceship/lib/spaceship/connect_api/models/reset_ratings_request.rb +3 -2
  117. data/spaceship/lib/spaceship/connect_api/models/sandbox_tester.rb +9 -6
  118. data/spaceship/lib/spaceship/connect_api/models/territory.rb +3 -2
  119. data/spaceship/lib/spaceship/connect_api/models/user.rb +6 -4
  120. data/spaceship/lib/spaceship/connect_api/models/user_invitation.rb +9 -6
  121. data/spaceship/lib/spaceship/connect_api/response.rb +3 -1
  122. data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +12 -0
  123. data/spaceship/lib/spaceship/connect_api/tunes/tunes.rb +103 -0
  124. data/spaceship/lib/spaceship/errors.rb +19 -0
  125. data/spaceship/lib/spaceship/tunes/iap_detail.rb +1 -1
  126. data/spaceship/lib/spaceship/tunes/tunes_client.rb +2 -2
  127. data/spaceship/lib/spaceship/two_step_or_factor_client.rb +19 -6
  128. data/supply/lib/supply/options.rb +1 -1
  129. data/supply/lib/supply/uploader.rb +3 -2
  130. metadata +45 -21
@@ -45,6 +45,8 @@ module Frameit
45
45
  GREEN ||= "Green"
46
46
  PINK ||= "Pink"
47
47
  PURPLE ||= "Purple"
48
+ GRAPHITE ||= "Graphite"
49
+ PACIFIC_BLUE ||= "Pacific Blue"
48
50
 
49
51
  def self.all_colors
50
52
  Color.constants.map { |c| Color.const_get(c).upcase.gsub(' ', '_') }
@@ -110,7 +112,7 @@ module Frameit
110
112
  IPHONE_7 ||= Frameit::Device.new("iphone-7", "Apple iPhone 7", 5, [[750, 1334], [1334, 750]], 326, Color::MATTE_BLACK, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_47, :use_legacy_iphone7)
111
113
  IPHONE_7_PLUS ||= Frameit::Device.new("iphone-7-plus", "Apple iPhone 7 Plus", 5, [[1242, 2208], [2208, 1242]], 401, Color::MATTE_BLACK, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_55, :use_legacy_iphone7)
112
114
  IPHONE_8 ||= Frameit::Device.new("iphone-8", "Apple iPhone 8", 6, [[750, 1334], [1334, 750]], 326, Color::SPACE_GRAY)
113
- IPHONE_8_PLUS ||= Frameit::Device.new("iphone-8-plus", "Apple iPhone 8 Plus", 6, [[1080, 1920], [1920, 1080]], 401, Color::SPACE_GRAY)
115
+ IPHONE_8_PLUS ||= Frameit::Device.new("iphone-8-plus", "Apple iPhone 8 Plus", 6, [[1242, 2208], [2208, 1242]], 401, Color::SPACE_GRAY)
114
116
  IPHONE_X ||= Frameit::Device.new("iphone-X", "Apple iPhone X", 7, [[1125, 2436], [2436, 1125]], 458, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_58, :use_legacy_iphonex)
115
117
  IPHONE_XS ||= Frameit::Device.new("iphone-XS", "Apple iPhone XS", 8, [[1125, 2436], [2436, 1125]], 458, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_58, :use_legacy_iphonexs)
116
118
  IPHONE_XR ||= Frameit::Device.new("iphone-XR", "Apple iPhone XR", 8, [[828, 1792], [1792, 828]], 326, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_61, :use_legacy_iphonexr)
@@ -118,6 +120,10 @@ module Frameit
118
120
  IPHONE_11 ||= Frameit::Device.new("iphone-11", "Apple iPhone 11", 9, [[828, 1792], [1792, 828]], 326, Color::BLACK, Platform::IOS)
119
121
  IPHONE_11_PRO ||= Frameit::Device.new("iphone-11-pro", "Apple iPhone 11 Pro", 9, [[1125, 2436], [2436, 1125]], 458, Color::SPACE_GRAY, Platform::IOS)
120
122
  IPHONE_11_PRO_MAX ||= Frameit::Device.new("iphone11-pro-max", "Apple iPhone 11 Pro Max", 9, [[1242, 2688], [2688, 1242]], 458, Color::SPACE_GRAY, Platform::IOS)
123
+ IPHONE_12 ||= Frameit::Device.new("iphone-12", "Apple iPhone 12", 10, [[1170, 2532], [2532, 1170]], 460, Color::BLACK, Platform::IOS)
124
+ IPHONE_12_PRO ||= Frameit::Device.new("iphone-12-pro", "Apple iPhone 12 Pro", 10, [[1170, 2532], [2532, 1170]], 460, Color::SPACE_GRAY, Platform::IOS)
125
+ IPHONE_12_PRO_MAX ||= Frameit::Device.new("iphone12-pro-max", "Apple iPhone 12 Pro Max", 10, [[1284, 2778], [2778, 1284]], 458, Color::GRAPHITE, Platform::IOS)
126
+ IPHONE_12_MINI ||= Frameit::Device.new("iphone-12-mini", "Apple iPhone 12 Mini", 10, [[1125, 2436], [2436, 1125]], 476, Color::BLACK, Platform::IOS)
121
127
  IPAD_10_2 ||= Frameit::Device.new("ipad-10-2", "Apple iPad 10.2", 1, [[1620, 2160], [2160, 1620]], 264, Color::SPACE_GRAY, Platform::IOS)
122
128
  IPAD_AIR_2 ||= Frameit::Device.new("ipad-air-2", "Apple iPad Air 2", 1, [[1536, 2048], [2048, 1536]], 264, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_IPAD)
123
129
  IPAD_AIR_2019 ||= Frameit::Device.new("ipad-air-2019", "Apple iPad Air (2019)", 2, [[1668, 2224], [2224, 1668]], 265, Color::SPACE_GRAY, Platform::IOS)
@@ -39,6 +39,9 @@ module Gym
39
39
  options << "-destination '#{config[:destination]}'" if config[:destination]
40
40
  options << "-archivePath #{archive_path.shellescape}" unless config[:skip_archive]
41
41
  options << "-resultBundlePath '#{result_bundle_path}'" if config[:result_bundle]
42
+ if config[:use_system_scm] && !options.include?("-scmProvider system")
43
+ options << "-scmProvider system"
44
+ end
42
45
  options << config[:xcargs] if config[:xcargs]
43
46
  options << "OTHER_SWIFT_FLAGS=\"-Xfrontend -debug-time-function-bodies\"" if config[:analyze_build_time]
44
47
 
@@ -105,11 +105,11 @@ module Gym
105
105
  FastlaneCore::ConfigItem.new(key: :export_method,
106
106
  short_option: "-j",
107
107
  env_name: "GYM_EXPORT_METHOD",
108
- description: "Method used to export the archive. Valid values are: app-store, ad-hoc, package, enterprise, development, developer-id",
108
+ description: "Method used to export the archive. Valid values are: app-store, validation, ad-hoc, package, enterprise, development, developer-id and mac-application",
109
109
  type: String,
110
110
  optional: true,
111
111
  verify_block: proc do |value|
112
- av = %w(app-store ad-hoc package enterprise development developer-id)
112
+ av = %w(app-store validation ad-hoc package enterprise development developer-id mac-application)
113
113
  UI.user_error!("Unsupported export_method '#{value}', must be: #{av}") unless av.include?(value)
114
114
  end),
115
115
  FastlaneCore::ConfigItem.new(key: :export_options,
@@ -279,7 +279,23 @@ module Gym
279
279
  env_name: "GYM_CLONED_SOURCE_PACKAGES_PATH",
280
280
  description: "Sets a custom path for Swift Package Manager dependencies",
281
281
  type: String,
282
- optional: true)
282
+ optional: true),
283
+ FastlaneCore::ConfigItem.new(key: :skip_package_dependencies_resolution,
284
+ env_name: "GYM_SKIP_PACKAGE_DEPENDENCIES_RESOLUTION",
285
+ description: "Skips resolution of Swift Package Manager dependencies",
286
+ type: Boolean,
287
+ default_value: false),
288
+ FastlaneCore::ConfigItem.new(key: :disable_package_automatic_updates,
289
+ env_name: "GYM_DISABLE_PACKAGE_AUTOMATIC_UPDATES",
290
+ description: "Prevents packages from automatically being resolved to versions other than those recorded in the `Package.resolved` file",
291
+ type: Boolean,
292
+ default_value: false),
293
+ FastlaneCore::ConfigItem.new(key: :use_system_scm,
294
+ env_name: "GYM_USE_SYSTEM_SCM",
295
+ description: "Lets xcodebuild use system's scm configuration",
296
+ optional: true,
297
+ type: Boolean,
298
+ default_value: false)
283
299
  ]
284
300
  end
285
301
  end
@@ -30,6 +30,7 @@ module Match
30
30
 
31
31
  def encrypt_files
32
32
  files = []
33
+ password = fetch_password!
33
34
  iterate(self.working_directory) do |current|
34
35
  files << current
35
36
  encrypt_specific_file(path: current, password: password)
@@ -41,6 +42,7 @@ module Match
41
42
 
42
43
  def decrypt_files
43
44
  files = []
45
+ password = fetch_password!
44
46
  iterate(self.working_directory) do |current|
45
47
  files << current
46
48
  begin
@@ -50,7 +52,7 @@ module Match
50
52
  UI.error("Couldn't decrypt the repo, please make sure you enter the right password!")
51
53
  UI.user_error!("Invalid password passed via 'MATCH_PASSWORD'") if ENV["MATCH_PASSWORD"]
52
54
  clear_password
53
- self.decrypt_files # call itself
55
+ self.decrypt_files # Call itself
54
56
  return
55
57
  end
56
58
  UI.success("🔓 Decrypted '#{File.basename(current)}'") if FastlaneCore::Globals.verbose?
@@ -83,7 +85,7 @@ module Match
83
85
  end
84
86
 
85
87
  # Access the MATCH_PASSWORD, either from ENV variable, Keychain or user input
86
- def password
88
+ def fetch_password!
87
89
  password = ENV["MATCH_PASSWORD"]
88
90
  unless password
89
91
  item = Security::InternetPassword.find(server: server_name(self.keychain_name))
@@ -9,7 +9,7 @@ module Match
9
9
  DESCRIPTION = "Easily sync your certificates and profiles across your team"
10
10
 
11
11
  def self.environments
12
- return %w(appstore adhoc development enterprise developer_id)
12
+ return %w(appstore adhoc development enterprise developer_id mac_installer_distribution)
13
13
  end
14
14
 
15
15
  def self.storage_modes
@@ -227,7 +227,7 @@ module Match
227
227
  short_option: "-p",
228
228
  env_name: "MATCH_KEYCHAIN_PASSWORD",
229
229
  sensitive: true,
230
- description: "This might be required the first time you access certificates on a new mac. For the login/default keychain this is your account password",
230
+ description: "This might be required the first time you access certificates on a new mac. For the login/default keychain this is your macOS account password",
231
231
  optional: true),
232
232
 
233
233
  # settings
@@ -355,7 +355,7 @@ module Match
355
355
  devices = Spaceship::ConnectAPI::Device.all
356
356
  unless device_classes.empty?
357
357
  devices = devices.select do |device|
358
- device_classes.include?(device.device_class)
358
+ device_classes.include?(device.device_class) && device.enabled?
359
359
  end
360
360
  end
361
361
 
@@ -89,15 +89,7 @@ module Match
89
89
  command += " -b #{self.branch.shellescape} --single-branch"
90
90
  end
91
91
 
92
- unless self.git_private_key.nil?
93
- if File.file?(self.git_private_key)
94
- ssh_add = File.expand_path(self.git_private_key).shellescape.to_s
95
- else
96
- UI.message("Private key file does not exist, will continue by using it as a raw key.")
97
- ssh_add = "- <<< \"#{self.git_private_key}\""
98
- end
99
- command = "ssh-agent bash -c 'ssh-add #{ssh_add}; #{command}'"
100
- end
92
+ command = command_from_private_key(command) unless self.git_private_key.nil?
101
93
 
102
94
  UI.message("Cloning remote git repo...")
103
95
  if self.branch && !self.clone_branch_directly
@@ -170,6 +162,16 @@ module Match
170
162
  Dir[File.join(working_directory, "**", file_name, "*.#{file_ext}")]
171
163
  end
172
164
 
165
+ def command_from_private_key(command)
166
+ if File.file?(self.git_private_key)
167
+ ssh_add = File.expand_path(self.git_private_key).shellescape.to_s
168
+ else
169
+ UI.message("Private key file does not exist, will continue by using it as a raw key.")
170
+ ssh_add = "- <<< \"#{self.git_private_key}\""
171
+ end
172
+ return "ssh-agent bash -c 'ssh-add #{ssh_add}; #{command}'"
173
+ end
174
+
173
175
  private
174
176
 
175
177
  # Create and checkout an specific branch in the git repo
@@ -231,7 +233,9 @@ module Match
231
233
  def git_push(commands: [], commit_message: nil)
232
234
  commit_message ||= generate_commit_message
233
235
  commands << "git commit -m #{commit_message.shellescape}"
234
- commands << "git push origin #{self.branch.shellescape}"
236
+ git_push_command = "git push origin #{self.branch.shellescape}"
237
+ git_push_command = command_from_private_key(git_push_command) unless self.git_private_key.nil?
238
+ commands << git_push_command
235
239
 
236
240
  UI.message("Pushing changes to remote git repo...")
237
241
  Helper.with_env_values('GIT_TERMINAL_PROMPT' => '0') do
@@ -97,7 +97,12 @@ module Precheck
97
97
  description: "Should check in-app purchases?",
98
98
  is_string: false,
99
99
  optional: true,
100
- default_value: true)
100
+ default_value: true),
101
+ FastlaneCore::ConfigItem.new(key: :use_live,
102
+ env_name: "PRECHECK_USE_LIVE",
103
+ description: "Should force check live app?",
104
+ is_string: false,
105
+ default_value: false)
101
106
  ] + rules
102
107
  end
103
108
  end
@@ -130,7 +130,7 @@ module Precheck
130
130
  items = []
131
131
 
132
132
  # App info localizations
133
- app_info = app.fetch_edit_app_info
133
+ app_info = Precheck.config[:use_live] ? app.fetch_live_app_info : app.fetch_latest_app_info
134
134
  app_info_localizations = app_info.get_app_info_localizations
135
135
  app_info_localizations.each do |localization|
136
136
  items << collect_text_items_from_language_item(locale: localization.locale,
@@ -185,7 +185,7 @@ module Precheck
185
185
 
186
186
  def latest_app_version
187
187
  platform = Spaceship::ConnectAPI::Platform.map(Precheck.config[:platform])
188
- @latest_version ||= app.get_edit_app_store_version(platform: platform)
188
+ @latest_version ||= Precheck.config[:use_live] ? app.get_live_app_store_version(platform: platform) : app.get_latest_app_store_version(platform: platform)
189
189
  end
190
190
 
191
191
  # Makes sure the current App ID exists. If not, it will show an appropriate error message
@@ -411,6 +411,11 @@ module Scan
411
411
  description: "Only post on Slack if the tests fail",
412
412
  is_string: false,
413
413
  default_value: false),
414
+ FastlaneCore::ConfigItem.new(key: :slack_default_payloads,
415
+ env_name: "SCAN_SLACK_DEFAULT_PAYLOADS",
416
+ description: "Specifies default payloads to include in Slack messages. For more info visit https://docs.fastlane.tools/actions/slack",
417
+ optional: true,
418
+ type: Array),
414
419
 
415
420
  # misc
416
421
  FastlaneCore::ConfigItem.new(key: :destination,
@@ -445,7 +450,23 @@ module Scan
445
450
  env_name: "SCAN_CLONED_SOURCE_PACKAGES_PATH",
446
451
  description: "Sets a custom path for Swift Package Manager dependencies",
447
452
  type: String,
448
- optional: true)
453
+ optional: true),
454
+ FastlaneCore::ConfigItem.new(key: :skip_package_dependencies_resolution,
455
+ env_name: "SCAN_SKIP_PACKAGE_DEPENDENCIES_RESOLUTION",
456
+ description: "Skips resolution of Swift Package Manager dependencies",
457
+ type: Boolean,
458
+ default_value: false),
459
+ FastlaneCore::ConfigItem.new(key: :disable_package_automatic_updates,
460
+ env_name: "SCAN_DISABLE_PACKAGE_AUTOMATIC_UPDATES",
461
+ description: "Prevents packages from automatically being resolved to versions other than those recorded in the `Package.resolved` file",
462
+ type: Boolean,
463
+ default_value: false),
464
+ FastlaneCore::ConfigItem.new(key: :use_system_scm,
465
+ env_name: "SCAN_USE_SYSTEM_SCM",
466
+ description: "Lets xcodebuild use system's scm configuration",
467
+ optional: true,
468
+ type: Boolean,
469
+ default_value: false)
449
470
 
450
471
  ]
451
472
  end
@@ -83,6 +83,13 @@ module Scan
83
83
  end
84
84
 
85
85
  def handle_results(tests_exit_status)
86
+ if Scan.config[:disable_xcpretty]
87
+ unless tests_exit_status == 0
88
+ UI.test_failure!("Test execution failed. Exit status: #{tests_exit_status}")
89
+ end
90
+ return
91
+ end
92
+
86
93
  result = TestResultParser.new.parse_result(test_results)
87
94
  SlackPoster.new.run(result)
88
95
 
@@ -144,8 +151,6 @@ module Scan
144
151
  end
145
152
 
146
153
  def test_results
147
- return if Scan.config[:disable_xcpretty]
148
-
149
154
  temp_junit_report = Scan.cache[:temp_junit_report]
150
155
  return File.read(temp_junit_report) if temp_junit_report && File.file?(temp_junit_report)
151
156
 
@@ -1,5 +1,6 @@
1
1
  require 'fastlane/action'
2
2
  require 'fastlane/actions/slack'
3
+ require 'fastlane_core/configuration/configuration'
3
4
 
4
5
  require_relative 'module'
5
6
 
@@ -43,7 +44,7 @@ module Scan
43
44
  }
44
45
  end
45
46
 
46
- Fastlane::Actions::SlackAction.run({
47
+ options = FastlaneCore::Configuration.create(Fastlane::Actions::SlackAction.available_options, {
47
48
  message: "#{Scan.config[:app_name] || Scan.project.app_name} Tests:\n#{Scan.config[:slack_message]}",
48
49
  channel: channel,
49
50
  slack_url: Scan.config[:slack_url].to_s,
@@ -51,10 +52,12 @@ module Scan
51
52
  username: username,
52
53
  icon_url: icon_url,
53
54
  payload: {},
55
+ default_payloads: Scan.config[:slack_default_payloads],
54
56
  attachment_properties: {
55
57
  fields: fields
56
58
  }
57
59
  })
60
+ Fastlane::Actions::SlackAction.run(options)
58
61
  end
59
62
  end
60
63
  end
@@ -38,6 +38,9 @@ module Scan
38
38
  if config[:derived_data_path] && !options.include?("-derivedDataPath #{config[:derived_data_path].shellescape}")
39
39
  options << "-derivedDataPath #{config[:derived_data_path].shellescape}"
40
40
  end
41
+ if config[:use_system_scm] && !options.include?("-scmProvider system")
42
+ options << "-scmProvider system"
43
+ end
41
44
  options << "-resultBundlePath '#{result_bundle_path}'" if config[:result_bundle]
42
45
  if FastlaneCore::Helper.xcode_at_least?(10)
43
46
  options << "-parallel-testing-worker-count #{config[:concurrent_workers]}" if config[:concurrent_workers]
@@ -24,6 +24,8 @@ module Screengrab
24
24
  end
25
25
 
26
26
  def run
27
+ # Standardize the locales
28
+ @config[:locales].map! { |locale| locale.gsub("_", "-") }
27
29
  FastlaneCore::PrintTable.print_values(config: @config, hide_keys: [], title: "Summary for screengrab #{Fastlane::VERSION}")
28
30
 
29
31
  app_apk_path = @config.fetch(:app_apk_path, ask: false)
@@ -327,7 +327,7 @@ module Sigh
327
327
  UI.important("Found more than one code signing identity. Choosing the first one. Check out `fastlane sigh --help` to see all available options.")
328
328
  UI.important("Available Code Signing Identities for current filters:")
329
329
  certificates.each do |c|
330
- str = ["\t- Name:", c.display_name, "- ID:", c.id + " - Expires", c.expires.strftime("%d/%m/%Y")].join(" ")
330
+ str = ["\t- Name:", c.display_name, "- ID:", c.id + " - Expires", Time.parse(c.expiration_date).strftime("%Y-%m-%d")].join(" ")
331
331
  UI.message(str.green)
332
332
  end
333
333
  end
@@ -180,7 +180,11 @@ open class Snapshot: NSObject {
180
180
  simulator = regex.stringByReplacingMatches(in: simulator, range: range, withTemplate: "")
181
181
 
182
182
  let path = screenshotsDir.appendingPathComponent("\(simulator)-\(name).png")
183
- try image.pngData()?.write(to: path, options: .atomic)
183
+ #if swift(<5.0)
184
+ UIImagePNGRepresentation(image)?.write(to: path, options: .atomic)
185
+ #else
186
+ try image.pngData()?.write(to: path, options: .atomic)
187
+ #endif
184
188
  } catch let error {
185
189
  NSLog("Problem writing screenshot: \(name) to \(screenshotsDir)/\(simulator)-\(name).png")
186
190
  NSLog(error.localizedDescription)
@@ -223,7 +227,7 @@ open class Snapshot: NSObject {
223
227
  #if os(OSX)
224
228
  let homeDir = URL(fileURLWithPath: NSHomeDirectory())
225
229
  return homeDir.appendingPathComponent(cachePath)
226
- #elseif arch(i386) || arch(x86_64)
230
+ #elseif arch(i386) || arch(x86_64) || arch(arm64)
227
231
  guard let simulatorHostHome = ProcessInfo().environment["SIMULATOR_HOST_HOME"] else {
228
232
  throw SnapshotError.cannotFindSimulatorHomeDirectory
229
233
  }
@@ -123,7 +123,7 @@ module Snapshot
123
123
  type: Boolean),
124
124
  FastlaneCore::ConfigItem.new(key: :override_status_bar,
125
125
  env_name: 'SNAPSHOT_OVERRIDE_STATUS_BAR',
126
- description: "Enabling this option wil automatically override the status bar to show 9:41 AM, full battery, and full reception",
126
+ description: "Enabling this option will automatically override the status bar to show 9:41 AM, full battery, and full reception",
127
127
  default_value: false,
128
128
  is_string: false),
129
129
  FastlaneCore::ConfigItem.new(key: :localize_simulator,
@@ -253,6 +253,16 @@ module Snapshot
253
253
  description: "Sets a custom path for Swift Package Manager dependencies",
254
254
  type: String,
255
255
  optional: true),
256
+ FastlaneCore::ConfigItem.new(key: :skip_package_dependencies_resolution,
257
+ env_name: "SNAPSHOT_SKIP_PACKAGE_DEPENDENCIES_RESOLUTION",
258
+ description: "Skips resolution of Swift Package Manager dependencies",
259
+ type: Boolean,
260
+ default_value: false),
261
+ FastlaneCore::ConfigItem.new(key: :disable_package_automatic_updates,
262
+ env_name: "SNAPSHOT_DISABLE_PACKAGE_AUTOMATIC_UPDATES",
263
+ description: "Prevents packages from automatically being resolved to versions other than those recorded in the `Package.resolved` file",
264
+ type: Boolean,
265
+ default_value: false),
256
266
  FastlaneCore::ConfigItem.new(key: :testplan,
257
267
  env_name: "SNAPSHOT_TESTPLAN",
258
268
  description: "The testplan associated with the scheme that should be used for testing",
@@ -283,7 +293,12 @@ module Snapshot
283
293
  env_name: "SNAPSHOT_SUPPRESS_XCODE_OUTPUT",
284
294
  description: "Suppress the output of xcodebuild to stdout. Output is still saved in buildlog_path",
285
295
  type: Boolean,
286
- optional: true)
296
+ optional: true),
297
+ FastlaneCore::ConfigItem.new(key: :use_system_scm,
298
+ env_name: "SNAPSHOT_USE_SYSTEM_SCM",
299
+ description: "Lets xcodebuild use system's scm configuration",
300
+ type: Boolean,
301
+ default_value: false)
287
302
  ]
288
303
  end
289
304
  end
@@ -8,7 +8,7 @@ module Snapshot
8
8
  def self.find_helper
9
9
  paths = Dir["./**/SnapshotHelper.swift"] + Dir["./**/SnapshotHelperXcode8.swift"]
10
10
  # exclude assets in gym
11
- paths.reject { |p| p.include?("snapshot/lib/assets/") }
11
+ paths.reject { |p| p.include?("snapshot/lib/assets/") || p.include?("DerivedData") }
12
12
  end
13
13
 
14
14
  def update(force: false)
@@ -57,6 +57,7 @@ module Spaceship
57
57
  InternalServerError = Spaceship::InternalServerError
58
58
  BadGatewayError = Spaceship::BadGatewayError
59
59
  AccessForbiddenError = Spaceship::AccessForbiddenError
60
+ TooManyRequestsError = Spaceship::TooManyRequestsError
60
61
 
61
62
  def self.hostname
62
63
  raise "You must implement self.hostname"
@@ -645,6 +646,17 @@ module Spaceship
645
646
  retry
646
647
  end
647
648
  raise ex # re-raise the exception
649
+ rescue TooManyRequestsError => ex
650
+ tries -= 1
651
+ unless tries.zero?
652
+ msg = "Timeout received: '#{ex.class}', '#{ex.message}'. Retrying after #{ex.retry_after} seconds (remaining: #{tries})..."
653
+ puts(msg) if Spaceship::Globals.verbose?
654
+ logger.warn(msg)
655
+
656
+ sleep(ex.retry_after) unless Object.const_defined?("SpecHelper")
657
+ retry
658
+ end
659
+ raise ex # re-raise the exception
648
660
  rescue \
649
661
  Faraday::ParsingError, # <h2>Internal Server Error</h2> with content type json
650
662
  InternalServerError => ex
@@ -873,6 +885,8 @@ module Spaceship
873
885
  msg = "Access forbidden"
874
886
  logger.warn(msg)
875
887
  raise AccessForbiddenError.new, msg
888
+ elsif resp_hash[:status] == 429
889
+ raise TooManyRequestsError, resp_hash
876
890
  end
877
891
 
878
892
  return response
@@ -35,6 +35,12 @@ require 'spaceship/connect_api/models/custom_app_organization'
35
35
  require 'spaceship/connect_api/models/custom_app_user'
36
36
  require 'spaceship/connect_api/models/pre_release_version'
37
37
 
38
+ require 'spaceship/connect_api/models/app_data_usage'
39
+ require 'spaceship/connect_api/models/app_data_usage_category'
40
+ require 'spaceship/connect_api/models/app_data_usage_data_protection'
41
+ require 'spaceship/connect_api/models/app_data_usage_grouping'
42
+ require 'spaceship/connect_api/models/app_data_usage_purposes'
43
+ require 'spaceship/connect_api/models/app_data_usages_publish_state'
38
44
  require 'spaceship/connect_api/models/age_rating_declaration'
39
45
  require 'spaceship/connect_api/models/app_category'
40
46
  require 'spaceship/connect_api/models/app_info'