fastlane 2.196.0 → 2.212.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (211) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/README.md +88 -81
  4. data/cert/lib/cert/runner.rb +19 -8
  5. data/deliver/lib/assets/ScreenshotsHelp +29 -6
  6. data/deliver/lib/deliver/app_screenshot.rb +30 -4
  7. data/deliver/lib/deliver/app_screenshot_iterator.rb +1 -1
  8. data/deliver/lib/deliver/options.rb +6 -2
  9. data/deliver/lib/deliver/runner.rb +88 -24
  10. data/deliver/lib/deliver/submit_for_review.rb +25 -3
  11. data/deliver/lib/deliver/upload_price_tier.rb +3 -1
  12. data/deliver/lib/deliver/upload_screenshots.rb +2 -2
  13. data/fastlane/lib/assets/AppfileTemplate +1 -1
  14. data/fastlane/lib/assets/AppfileTemplate.swift +1 -1
  15. data/fastlane/lib/fastlane/actions/badge.rb +1 -1
  16. data/fastlane/lib/fastlane/actions/changelog_from_git_commits.rb +1 -1
  17. data/fastlane/lib/fastlane/actions/danger.rb +14 -0
  18. data/fastlane/lib/fastlane/actions/docs/build_app.md +5 -5
  19. data/fastlane/lib/fastlane/actions/docs/capture_android_screenshots.md +19 -2
  20. data/fastlane/lib/fastlane/actions/docs/frame_screenshots.md +1 -1
  21. data/fastlane/lib/fastlane/actions/docs/run_tests.md +1 -1
  22. data/fastlane/lib/fastlane/actions/docs/upload_to_app_store.md.erb +1 -1
  23. data/fastlane/lib/fastlane/actions/download_dsyms.rb +62 -46
  24. data/fastlane/lib/fastlane/actions/ensure_git_status_clean.rb +15 -4
  25. data/fastlane/lib/fastlane/actions/ensure_xcode_version.rb +1 -1
  26. data/fastlane/lib/fastlane/actions/get_push_certificate.rb +1 -1
  27. data/fastlane/lib/fastlane/actions/get_version_number.rb +8 -3
  28. data/fastlane/lib/fastlane/actions/git_commit.rb +4 -6
  29. data/fastlane/lib/fastlane/actions/import_certificate.rb +1 -1
  30. data/fastlane/lib/fastlane/actions/notarize.rb +29 -11
  31. data/fastlane/lib/fastlane/actions/pod_lib_lint.rb +1 -1
  32. data/fastlane/lib/fastlane/actions/pod_push.rb +19 -1
  33. data/fastlane/lib/fastlane/actions/read_podspec.rb +1 -1
  34. data/fastlane/lib/fastlane/actions/run_tests.rb +19 -9
  35. data/fastlane/lib/fastlane/actions/set_github_release.rb +11 -5
  36. data/fastlane/lib/fastlane/actions/setup_ci.rb +13 -4
  37. data/fastlane/lib/fastlane/actions/trainer.rb +49 -0
  38. data/fastlane/lib/fastlane/actions/update_code_signing_settings.rb +31 -4
  39. data/fastlane/lib/fastlane/actions/update_info_plist.rb +1 -1
  40. data/fastlane/lib/fastlane/actions/update_project_provisioning.rb +10 -1
  41. data/fastlane/lib/fastlane/actions/upload_symbols_to_sentry.rb +1 -1
  42. data/fastlane/lib/fastlane/actions/verify_build.rb +1 -1
  43. data/fastlane/lib/fastlane/actions/xcode_install.rb +5 -1
  44. data/fastlane/lib/fastlane/actions/xcode_select.rb +1 -1
  45. data/fastlane/lib/fastlane/actions/xcodebuild.rb +8 -2
  46. data/fastlane/lib/fastlane/actions/xcodes.rb +152 -0
  47. data/fastlane/lib/fastlane/actions/xcov.rb +5 -0
  48. data/fastlane/lib/fastlane/actions/xcversion.rb +17 -7
  49. data/fastlane/lib/fastlane/cli_tools_distributor.rb +5 -0
  50. data/fastlane/lib/fastlane/commands_generator.rb +2 -1
  51. data/fastlane/lib/fastlane/documentation/docs_generator.rb +17 -12
  52. data/fastlane/lib/fastlane/fast_file.rb +18 -5
  53. data/fastlane/lib/fastlane/features.rb +3 -0
  54. data/fastlane/lib/fastlane/helper/xcodebuild_formatter_helper.rb +9 -0
  55. data/fastlane/lib/fastlane/helper/xcodes_helper.rb +28 -0
  56. data/fastlane/lib/fastlane/helper/xcversion_helper.rb +0 -9
  57. data/fastlane/lib/fastlane/lane_manager.rb +1 -1
  58. data/fastlane/lib/fastlane/plugins/template/%gem_name%.gemspec.erb +1 -1
  59. data/fastlane/lib/fastlane/plugins/template/.rubocop.yml +5 -1
  60. data/fastlane/lib/fastlane/setup/setup_ios.rb +1 -1
  61. data/fastlane/lib/fastlane/swift_fastlane_api_generator.rb +1 -1
  62. data/fastlane/lib/fastlane/swift_lane_manager.rb +11 -3
  63. data/fastlane/lib/fastlane/swift_runner_upgrader.rb +54 -1
  64. data/fastlane/lib/fastlane/tools.rb +18 -1
  65. data/fastlane/lib/fastlane/version.rb +1 -1
  66. data/fastlane/swift/Actions.swift +1 -1
  67. data/fastlane/swift/Appfile.swift +2 -2
  68. data/fastlane/swift/ArgumentProcessor.swift +1 -1
  69. data/fastlane/swift/Atomic.swift +150 -0
  70. data/fastlane/swift/ControlCommand.swift +1 -1
  71. data/fastlane/swift/Deliverfile.swift +2 -2
  72. data/fastlane/swift/DeliverfileProtocol.swift +8 -4
  73. data/fastlane/swift/Fastlane.swift +570 -239
  74. data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/project.pbxproj +30 -20
  75. data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/xcshareddata/xcschemes/FastlaneRunner.xcscheme +1 -1
  76. data/fastlane/swift/Gymfile.swift +2 -2
  77. data/fastlane/swift/GymfileProtocol.swift +20 -8
  78. data/fastlane/swift/LaneFileProtocol.swift +2 -2
  79. data/fastlane/swift/MainProcess.swift +3 -3
  80. data/fastlane/swift/Matchfile.swift +2 -2
  81. data/fastlane/swift/MatchfileProtocol.swift +21 -5
  82. data/fastlane/swift/OptionalConfigValue.swift +1 -1
  83. data/fastlane/swift/Plugins.swift +1 -1
  84. data/fastlane/swift/Precheckfile.swift +2 -2
  85. data/fastlane/swift/PrecheckfileProtocol.swift +3 -3
  86. data/fastlane/swift/RubyCommand.swift +1 -1
  87. data/fastlane/swift/RubyCommandable.swift +1 -1
  88. data/fastlane/swift/Runner.swift +13 -9
  89. data/fastlane/swift/RunnerArgument.swift +1 -1
  90. data/fastlane/swift/Scanfile.swift +2 -2
  91. data/fastlane/swift/ScanfileProtocol.swift +31 -11
  92. data/fastlane/swift/Screengrabfile.swift +2 -2
  93. data/fastlane/swift/ScreengrabfileProtocol.swift +3 -3
  94. data/fastlane/swift/Snapshotfile.swift +2 -2
  95. data/fastlane/swift/SnapshotfileProtocol.swift +12 -8
  96. data/fastlane/swift/SocketClient.swift +9 -5
  97. data/fastlane/swift/SocketClientDelegateProtocol.swift +2 -2
  98. data/fastlane/swift/SocketResponse.swift +1 -1
  99. data/fastlane/swift/formatting/Brewfile.lock.json +46 -23
  100. data/fastlane/swift/main.swift +1 -1
  101. data/fastlane/swift/upgrade_manifest.json +1 -1
  102. data/fastlane_core/README.md +1 -0
  103. data/fastlane_core/lib/fastlane_core/cert_checker.rb +79 -17
  104. data/fastlane_core/lib/fastlane_core/device_manager.rb +5 -1
  105. data/fastlane_core/lib/fastlane_core/ipa_file_analyser.rb +10 -5
  106. data/fastlane_core/lib/fastlane_core/itunes_transporter.rb +409 -26
  107. data/fastlane_core/lib/fastlane_core/keychain_importer.rb +1 -0
  108. data/fastlane_core/lib/fastlane_core/project.rb +19 -2
  109. data/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb +7 -0
  110. data/fastlane_core/lib/fastlane_core/ui/implementations/shell.rb +4 -2
  111. data/frameit/lib/frameit/device.rb +1 -1
  112. data/frameit/lib/frameit/device_types.rb +9 -0
  113. data/frameit/lib/frameit/editor.rb +16 -18
  114. data/frameit/lib/frameit/frame_downloader.rb +1 -1
  115. data/frameit/lib/frameit/trim_box.rb +6 -0
  116. data/gym/lib/gym/generators/build_command_generator.rb +70 -23
  117. data/gym/lib/gym/options.rb +30 -5
  118. data/match/lib/match/change_password.rb +2 -0
  119. data/match/lib/match/commands_generator.rb +2 -1
  120. data/match/lib/match/encryption/openssl.rb +1 -1
  121. data/match/lib/match/encryption.rb +3 -0
  122. data/match/lib/match/generator.rb +1 -0
  123. data/match/lib/match/importer.rb +10 -1
  124. data/match/lib/match/migrate.rb +4 -3
  125. data/match/lib/match/module.rb +54 -2
  126. data/match/lib/match/nuke.rb +114 -47
  127. data/match/lib/match/options.rb +22 -1
  128. data/match/lib/match/runner.rb +25 -6
  129. data/match/lib/match/setup.rb +1 -1
  130. data/match/lib/match/spaceship_ensure.rb +5 -2
  131. data/match/lib/match/storage/gitlab/client.rb +102 -0
  132. data/match/lib/match/storage/gitlab/secure_file.rb +65 -0
  133. data/match/lib/match/storage/gitlab_secure_files.rb +182 -0
  134. data/match/lib/match/storage/google_cloud_storage.rb +7 -6
  135. data/match/lib/match/storage/s3_storage.rb +3 -3
  136. data/match/lib/match/storage.rb +4 -0
  137. data/match/lib/match/table_printer.rb +2 -1
  138. data/match/lib/match/utils.rb +15 -2
  139. data/pem/lib/pem/manager.rb +30 -7
  140. data/pem/lib/pem/options.rb +9 -0
  141. data/pilot/lib/pilot/build_manager.rb +34 -14
  142. data/pilot/lib/pilot/options.rb +6 -1
  143. data/scan/lib/scan/detect_values.rb +6 -0
  144. data/scan/lib/scan/error_handler.rb +9 -0
  145. data/scan/lib/scan/options.rb +49 -9
  146. data/scan/lib/scan/runner.rb +171 -25
  147. data/scan/lib/scan/test_command_generator.rb +65 -5
  148. data/sigh/lib/sigh/download_all.rb +14 -2
  149. data/sigh/lib/sigh/module.rb +3 -1
  150. data/sigh/lib/sigh/options.rb +5 -0
  151. data/sigh/lib/sigh/runner.rb +12 -2
  152. data/snapshot/lib/assets/SnapshotHelper.swift +3 -3
  153. data/snapshot/lib/snapshot/latest_os_version.rb +2 -5
  154. data/snapshot/lib/snapshot/options.rb +24 -8
  155. data/snapshot/lib/snapshot/reports_generator.rb +1 -0
  156. data/snapshot/lib/snapshot/simulator_launchers/simulator_launcher_base.rb +10 -3
  157. data/snapshot/lib/snapshot/test_command_generator.rb +37 -2
  158. data/spaceship/lib/spaceship/client.rb +71 -40
  159. data/spaceship/lib/spaceship/commands_generator.rb +1 -1
  160. data/spaceship/lib/spaceship/connect_api/api_client.rb +10 -5
  161. data/spaceship/lib/spaceship/connect_api/models/actor.rb +26 -0
  162. data/spaceship/lib/spaceship/connect_api/models/app.rb +52 -6
  163. data/spaceship/lib/spaceship/connect_api/models/app_info.rb +1 -0
  164. data/spaceship/lib/spaceship/connect_api/models/app_info_localization.rb +5 -0
  165. data/spaceship/lib/spaceship/connect_api/models/app_screenshot_set.rb +7 -0
  166. data/spaceship/lib/spaceship/connect_api/models/app_store_version.rb +1 -1
  167. data/spaceship/lib/spaceship/connect_api/models/app_store_version_localization.rb +27 -10
  168. data/spaceship/lib/spaceship/connect_api/models/build.rb +4 -2
  169. data/spaceship/lib/spaceship/connect_api/models/build_bundle.rb +68 -0
  170. data/spaceship/lib/spaceship/connect_api/models/build_bundle_file_sizes.rb +34 -0
  171. data/spaceship/lib/spaceship/connect_api/models/build_delivery.rb +2 -1
  172. data/spaceship/lib/spaceship/connect_api/models/certificate.rb +4 -0
  173. data/spaceship/lib/spaceship/connect_api/models/device.rb +47 -4
  174. data/spaceship/lib/spaceship/connect_api/models/profile.rb +4 -0
  175. data/spaceship/lib/spaceship/connect_api/models/resolution_center_message.rb +29 -0
  176. data/spaceship/lib/spaceship/connect_api/models/resolution_center_thread.rb +67 -0
  177. data/spaceship/lib/spaceship/connect_api/models/review_rejection.rb +19 -0
  178. data/spaceship/lib/spaceship/connect_api/models/review_submission.rb +86 -0
  179. data/spaceship/lib/spaceship/connect_api/models/review_submission_item.rb +40 -0
  180. data/spaceship/lib/spaceship/connect_api/models/user.rb +5 -0
  181. data/spaceship/lib/spaceship/connect_api/provisioning/provisioning.rb +19 -0
  182. data/spaceship/lib/spaceship/connect_api/response.rb +23 -6
  183. data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +33 -2
  184. data/spaceship/lib/spaceship/connect_api/token.rb +5 -2
  185. data/spaceship/lib/spaceship/connect_api/tunes/tunes.rb +124 -8
  186. data/spaceship/lib/spaceship/connect_api.rb +9 -0
  187. data/spaceship/lib/spaceship/errors.rb +34 -0
  188. data/spaceship/lib/spaceship/globals.rb +9 -0
  189. data/spaceship/lib/spaceship/hashcash.rb +52 -0
  190. data/spaceship/lib/spaceship/portal/certificate.rb +4 -3
  191. data/spaceship/lib/spaceship/spaceauth_runner.rb +1 -1
  192. data/spaceship/lib/spaceship/tunes/app_ratings.rb +6 -6
  193. data/spaceship/lib/spaceship/tunes/iap_families.rb +1 -1
  194. data/spaceship/lib/spaceship/tunes/tunes.rb +0 -1
  195. data/spaceship/lib/spaceship/tunes/tunes_client.rb +79 -21
  196. data/spaceship/lib/spaceship/two_step_or_factor_client.rb +11 -3
  197. data/spaceship/lib/spaceship.rb +1 -0
  198. data/supply/lib/supply/client.rb +2 -7
  199. data/supply/lib/supply/options.rb +8 -0
  200. data/supply/lib/supply/uploader.rb +6 -2
  201. data/trainer/lib/assets/junit.xml.erb +28 -0
  202. data/trainer/lib/trainer/commands_generator.rb +51 -0
  203. data/trainer/lib/trainer/junit_generator.rb +31 -0
  204. data/trainer/lib/trainer/module.rb +10 -0
  205. data/trainer/lib/trainer/options.rb +66 -0
  206. data/trainer/lib/trainer/test_parser.rb +398 -0
  207. data/trainer/lib/trainer/xcresult.rb +403 -0
  208. data/trainer/lib/trainer.rb +7 -0
  209. metadata +49 -24
  210. data/spaceship/lib/spaceship/connect_api/testflight/.testflight.rb.swp +0 -0
  211. data/spaceship/lib/spaceship/tunes/user_detail.rb +0 -15
@@ -46,6 +46,12 @@ module Deliver
46
46
  end
47
47
 
48
48
  def run
49
+ if options[:verify_only]
50
+ UI.important("Verify flag is set, only package validation will take place and no submission will be made")
51
+ verify_binary
52
+ return
53
+ end
54
+
49
55
  verify_version if options[:app_version].to_s.length > 0 && !options[:skip_app_version_update]
50
56
 
51
57
  # Rejecting before upload meta
@@ -155,39 +161,74 @@ module Deliver
155
161
  UploadPriceTier.new.upload(options)
156
162
  end
157
163
 
164
+ # Verify the binary with App Store Connect
165
+ def verify_binary
166
+ UI.message("Verifying binary with App Store Connect")
167
+
168
+ ipa_path = options[:ipa]
169
+ pkg_path = options[:pkg]
170
+
171
+ platform = options[:platform]
172
+ transporter = transporter_for_selected_team
173
+
174
+ case platform
175
+ when "ios", "appletvos"
176
+ package_path = FastlaneCore::IpaUploadPackageBuilder.new.generate(
177
+ app_id: Deliver.cache[:app].id,
178
+ ipa_path: ipa_path,
179
+ package_path: "/tmp",
180
+ platform: platform
181
+ )
182
+ result = transporter.verify(package_path: package_path, asset_path: ipa_path, platform: platform)
183
+ when "osx"
184
+ package_path = FastlaneCore::PkgUploadPackageBuilder.new.generate(
185
+ app_id: Deliver.cache[:app].id,
186
+ pkg_path: pkg_path,
187
+ package_path: "/tmp",
188
+ platform: platform
189
+ )
190
+ result = transporter.verify(package_path: package_path, asset_path: pkg_path, platform: platform)
191
+ else
192
+ UI.user_error!("No suitable file found for verify for platform: #{options[:platform]}")
193
+ end
194
+
195
+ unless result
196
+ transporter_errors = transporter.displayable_errors
197
+ UI.user_error!("Error verifying the binary file: \n #{transporter_errors}")
198
+ end
199
+ end
200
+
158
201
  # Upload the binary to App Store Connect
159
202
  def upload_binary
160
203
  UI.message("Uploading binary to App Store Connect")
161
204
 
162
- upload_ipa = options[:ipa]
163
- upload_pkg = options[:pkg]
205
+ ipa_path = options[:ipa]
206
+ pkg_path = options[:pkg]
164
207
 
165
- # 2020-01-27
166
- # Only verify platform if if both ipa and pkg exists (for backwards support)
167
- if upload_ipa && upload_pkg
168
- upload_ipa = ["ios", "appletvos"].include?(options[:platform])
169
- upload_pkg = options[:platform] == "osx"
170
- end
208
+ platform = options[:platform]
209
+ transporter = transporter_for_selected_team
171
210
 
172
- if upload_ipa
211
+ case platform
212
+ when "ios", "appletvos"
173
213
  package_path = FastlaneCore::IpaUploadPackageBuilder.new.generate(
174
214
  app_id: Deliver.cache[:app].id,
175
- ipa_path: options[:ipa],
215
+ ipa_path: ipa_path,
176
216
  package_path: "/tmp",
177
- platform: options[:platform]
217
+ platform: platform
178
218
  )
179
- elsif upload_pkg
219
+ result = transporter.upload(package_path: package_path, asset_path: ipa_path, platform: platform)
220
+ when "osx"
180
221
  package_path = FastlaneCore::PkgUploadPackageBuilder.new.generate(
181
222
  app_id: Deliver.cache[:app].id,
182
- pkg_path: options[:pkg],
223
+ pkg_path: pkg_path,
183
224
  package_path: "/tmp",
184
- platform: options[:platform]
225
+ platform: platform
185
226
  )
227
+ result = transporter.upload(package_path: package_path, asset_path: pkg_path, platform: platform)
228
+ else
229
+ UI.user_error!("No suitable file found for upload for platform: #{options[:platform]}")
186
230
  end
187
231
 
188
- transporter = transporter_for_selected_team
189
- result = transporter.upload(package_path: package_path)
190
-
191
232
  unless result
192
233
  transporter_errors = transporter.displayable_errors
193
234
  UI.user_error!("Error uploading ipa file: \n #{transporter_errors}")
@@ -197,8 +238,21 @@ module Deliver
197
238
  def reject_version_if_possible
198
239
  app = Deliver.cache[:app]
199
240
  platform = Spaceship::ConnectAPI::Platform.map(options[:platform])
200
- if app.reject_version_if_possible!(platform: platform)
201
- UI.success("Successfully rejected previous version!")
241
+
242
+ submission = app.get_in_progress_review_submission(platform: platform)
243
+ if submission
244
+ submission.cancel_submission
245
+ UI.message("Review submission cancellation has been requested")
246
+
247
+ # An app version won't get removed from review instantly
248
+ # Polling until there is no longer an in-progress version
249
+ loop do
250
+ break if app.get_in_progress_review_submission(platform: platform).nil?
251
+ UI.message("Waiting for cancellation to take effect...")
252
+ sleep(15)
253
+ end
254
+
255
+ UI.success("Successfully cancelled previous submission!")
202
256
  end
203
257
  end
204
258
 
@@ -215,22 +269,32 @@ module Deliver
215
269
  def transporter_for_selected_team
216
270
  # Use JWT auth
217
271
  api_token = Spaceship::ConnectAPI.token
272
+ api_key = if options[:api_key].nil? && !api_token.nil?
273
+ # Load api key info if user set api_key_path, not api_key
274
+ { key_id: api_token.key_id, issuer_id: api_token.issuer_id, key: api_token.key_raw }
275
+ elsif !options[:api_key].nil?
276
+ api_key = options[:api_key].transform_keys(&:to_sym).dup
277
+ # key is still base 64 style if api_key is loaded from option
278
+ api_key[:key] = Base64.decode64(api_key[:key]) if api_key[:is_key_content_base64]
279
+ api_key
280
+ end
281
+
218
282
  unless api_token.nil?
219
283
  api_token.refresh! if api_token.expired?
220
- return FastlaneCore::ItunesTransporter.new(nil, nil, false, nil, api_token.text)
284
+ return FastlaneCore::ItunesTransporter.new(nil, nil, false, nil, api_token.text, altool_compatible_command: true, api_key: api_key)
221
285
  end
222
286
 
223
287
  tunes_client = Spaceship::ConnectAPI.client.tunes_client
224
288
 
225
- generic_transporter = FastlaneCore::ItunesTransporter.new(options[:username], nil, false, options[:itc_provider])
289
+ generic_transporter = FastlaneCore::ItunesTransporter.new(options[:username], nil, false, options[:itc_provider], altool_compatible_command: true, api_key: api_key)
226
290
  return generic_transporter unless options[:itc_provider].nil? && tunes_client.teams.count > 1
227
291
 
228
292
  begin
229
- team = tunes_client.teams.find { |t| t['contentProvider']['contentProviderId'].to_s == tunes_client.team_id }
230
- name = team['contentProvider']['name']
293
+ team = tunes_client.teams.find { |t| t['providerId'].to_s == tunes_client.team_id }
294
+ name = team['name']
231
295
  provider_id = generic_transporter.provider_ids[name]
232
296
  UI.verbose("Inferred provider id #{provider_id} for team #{name}.")
233
- return FastlaneCore::ItunesTransporter.new(options[:username], nil, false, provider_id)
297
+ return FastlaneCore::ItunesTransporter.new(options[:username], nil, false, provider_id, altool_compatible_command: true, api_key: api_key)
234
298
  rescue => ex
235
299
  UI.verbose("Couldn't infer a provider short name for team with id #{tunes_client.team_id} automatically: #{ex}. Proceeding without provider short name.")
236
300
  return generic_transporter
@@ -23,12 +23,34 @@ module Deliver
23
23
  update_idfa(options, app, version)
24
24
  update_submission_information(options, app)
25
25
 
26
- version.create_app_store_version_submission
27
-
26
+ create_review_submission(options, app, version, platform)
28
27
  UI.success("Successfully submitted the app for review!")
29
28
  end
30
29
 
31
- private def select_build(options, app, version, platform)
30
+ private
31
+
32
+ def create_review_submission(options, app, version, platform)
33
+ # Can't submit a review if there is already a review in progress
34
+ if app.get_in_progress_review_submission(platform: platform)
35
+ UI.user_error!("Cannot submit for review - A review submission is already in progress")
36
+ end
37
+
38
+ # There can only be one open submission per platform per app
39
+ # There might be a submission already created so we need to check
40
+ # 1. Create the submission if its not already created
41
+ # 2. Error if submission already contains some items for review (because we don't know what they are)
42
+ submission = app.get_ready_review_submission(platform: platform, includes: "items")
43
+ if submission.nil?
44
+ submission = app.create_review_submission(platform: platform)
45
+ elsif !submission.items.empty?
46
+ UI.user_error!("Cannot submit for review - A review submission already exists with items not managed by fastlane. Please cancel or remove items from submission for the App Store Connect website")
47
+ end
48
+
49
+ submission.add_app_store_version_to_review_items(app_store_version_id: version.id)
50
+ submission.submit_for_review
51
+ end
52
+
53
+ def select_build(options, app, version, platform)
32
54
  if options[:build_number] && options[:build_number] != "latest"
33
55
  UI.message("Selecting existing build-number: #{options[:build_number]}")
34
56
 
@@ -12,7 +12,9 @@ module Deliver
12
12
  app = Deliver.cache[:app]
13
13
 
14
14
  attributes = {}
15
- territory_ids = []
15
+
16
+ # Check App update method to understand how to use territory_ids.
17
+ territory_ids = nil # nil won't update app's territory_ids, empty array would remove app from sale.
16
18
 
17
19
  # As of 2020-09-14:
18
20
  # Official App Store Connect does not have an endpoint to get app prices for an app
@@ -145,7 +145,7 @@ module Deliver
145
145
  if duplicate
146
146
  UI.message("Previous uploaded. Skipping '#{screenshot.path}'...")
147
147
  else
148
- UI.verbose("Queued uplaod sceeenshot job for #{localization.locale} #{app_screenshot_set.screenshot_display_type} #{screenshot.path}")
148
+ UI.verbose("Queued upload sceeenshot job for #{localization.locale} #{app_screenshot_set.screenshot_display_type} #{screenshot.path}")
149
149
  worker.enqueue(UploadScreenshotJob.new(app_screenshot_set, screenshot.path))
150
150
  number_of_screenshots_per_set[app_screenshot_set] += 1
151
151
  end
@@ -157,7 +157,7 @@ module Deliver
157
157
 
158
158
  UI.verbose('Uploading jobs are completed')
159
159
 
160
- Helper.show_loading_indicator("Waiting for all the screenshots processed...")
160
+ Helper.show_loading_indicator("Waiting for all the screenshots to finish being processed...")
161
161
  states = wait_for_complete(iterator)
162
162
  Helper.hide_loading_indicator
163
163
  retry_upload_screenshots_if_needed(iterator, states, total_number_of_screenshots, tries, localizations, screenshots_per_language)
@@ -1,5 +1,5 @@
1
1
  # app_identifier("[[APP_IDENTIFIER]]") # The bundle identifier of your app
2
- # apple_id("[[APPLE_ID]]") # Your Apple email address
2
+ # apple_id("[[APPLE_ID]]") # Your Apple Developer Portal username
3
3
 
4
4
  [[TEAMS]]
5
5
  # For more information about the Appfile, see:
@@ -1,5 +1,5 @@
1
1
  var appIdentifier: String { return "[[APP_IDENTIFIER]]" } // The bundle identifier of your app
2
- var appleID: String { return "[[APPLE_ID]]" } // Your Apple email address
2
+ var appleID: String { return "[[APPLE_ID]]" } // Your Apple Developer Portal username
3
3
 
4
4
  [[TEAMS]]
5
5
 
@@ -63,7 +63,7 @@ module Fastlane
63
63
  [
64
64
  FastlaneCore::ConfigItem.new(key: :dark,
65
65
  env_name: "FL_BADGE_DARK",
66
- description: "Adds a dark flavored badge ontop of your icon",
66
+ description: "Adds a dark flavored badge on top of your icon",
67
67
  optional: true,
68
68
  type: Boolean,
69
69
  verify_block: proc do |value|
@@ -141,7 +141,7 @@ module Fastlane
141
141
  end),
142
142
  FastlaneCore::ConfigItem.new(key: :merge_commit_filtering,
143
143
  env_name: 'FL_CHANGELOG_FROM_GIT_COMMITS_MERGE_COMMIT_FILTERING',
144
- description: "Controls inclusion of merge commits when collecting the changelog. Valid values: #{GIT_MERGE_COMMIT_FILTERING_OPTIONS.map { |o| "`:#{o}`" }.join(', ')}",
144
+ description: "Controls inclusion of merge commits when collecting the changelog. Valid values: #{GIT_MERGE_COMMIT_FILTERING_OPTIONS.map { |o| "'#{o}'" }.join(', ')}",
145
145
  optional: true,
146
146
  default_value: 'include_merges',
147
147
  verify_block: proc do |value|
@@ -25,6 +25,8 @@ module Fastlane
25
25
  cmd << "pr #{pr}" if pr
26
26
 
27
27
  ENV['DANGER_GITHUB_API_TOKEN'] = params[:github_api_token] if params[:github_api_token]
28
+ ENV['DANGER_GITHUB_HOST'] = params[:github_enterprise_host] if params[:github_enterprise_host]
29
+ ENV['DANGER_GITHUB_API_BASE_URL'] = params[:github_enterprise_api_base_url] if params[:github_enterprise_api_base_url]
28
30
 
29
31
  Actions.sh(cmd.join(' '))
30
32
  end
@@ -66,6 +68,18 @@ module Fastlane
66
68
  sensitive: true,
67
69
  code_gen_sensitive: true,
68
70
  optional: true),
71
+ FastlaneCore::ConfigItem.new(key: :github_enterprise_host,
72
+ env_name: "FL_DANGER_GITHUB_ENTERPRISE_HOST",
73
+ description: "GitHub host URL for GitHub Enterprise",
74
+ sensitive: true,
75
+ code_gen_sensitive: true,
76
+ optional: true),
77
+ FastlaneCore::ConfigItem.new(key: :github_enterprise_api_base_url,
78
+ env_name: "FL_DANGER_GITHUB_ENTERPRISE_API_BASE_URL",
79
+ description: "GitHub API base URL for GitHub Enterprise",
80
+ sensitive: true,
81
+ code_gen_sensitive: true,
82
+ optional: true),
69
83
  FastlaneCore::ConfigItem.new(key: :fail_on_errors,
70
84
  env_name: "FL_DANGER_FAIL_ON_ERRORS",
71
85
  description: "Should always fail the build process, defaults to false",
@@ -74,7 +74,7 @@ That's all you need to build your application. If you want more control, here ar
74
74
  fastlane gym --workspace "Example.xcworkspace" --scheme "AppName" --clean
75
75
  ```
76
76
 
77
- If you need to use a different Xcode installation, use `xcode-select` or define `DEVELOPER_DIR`:
77
+ If you need to use a different Xcode installation, use `[xcodes](https://docs.fastlane.tools/actions/xcodes)` or define `DEVELOPER_DIR`:
78
78
 
79
79
  ```no-highlight
80
80
  DEVELOPER_DIR="/Applications/Xcode6.2.app" fastlane gym
@@ -150,7 +150,7 @@ build_app(
150
150
  scheme: "Release",
151
151
  export_method: "app-store",
152
152
  export_options: {
153
- provisioningProfiles: {
153
+ provisioningProfiles: {
154
154
  "com.example.bundleid" => "Provisioning Profile Name",
155
155
  "com.example.bundleid2" => "Provisioning Profile Name 2"
156
156
  }
@@ -184,10 +184,10 @@ end
184
184
  error do |lane, exception|
185
185
  slack(
186
186
  # message with short human friendly message
187
- message: exception.to_s,
188
- success: false,
187
+ message: exception.to_s,
188
+ success: false,
189
189
  # Output containing extended log output
190
- payload: { "Output" => exception.error_info.to_s }
190
+ payload: { "Output" => exception.error_info.to_s }
191
191
  )
192
192
  end
193
193
  ```
@@ -25,6 +25,7 @@ gem install fastlane
25
25
  ```
26
26
 
27
27
  ##### Gradle dependency
28
+
28
29
  ```java
29
30
  androidTestImplementation 'tools.fastlane:screengrab:x.x.x'
30
31
  ```
@@ -60,17 +61,23 @@ Ensure that the following permissions exist in your **src/debug/AndroidManifest.
60
61
  ##### Configuring your <a href="#ui-tests">UI Tests</a> for Screenshots
61
62
 
62
63
  1. Add `LocaleTestRule` to your tests class to handle automatic switching of locales.
64
+
63
65
  If you're using Java use:
66
+
64
67
  ```java
65
68
  @ClassRule
66
69
  public static final LocaleTestRule localeTestRule = new LocaleTestRule();
67
70
  ```
71
+
68
72
  If you're using Kotlin use:
73
+
69
74
  ```kotlin
70
75
  @Rule @JvmField
71
76
  val localeTestRule = LocaleTestRule()
72
77
  ```
78
+
73
79
  The `@JvmField` annotation is important. It won't work like this:
80
+
74
81
  ```kotlin
75
82
  companion object {
76
83
  @get:ClassRule
@@ -84,6 +91,7 @@ Ensure that the following permissions exist in your **src/debug/AndroidManifest.
84
91
  - Then, before running `fastlane screengrab` you'll need a debug and test apk
85
92
  - You can create your APKs manually with `./gradlew assembleDebug assembleAndroidTest`
86
93
  - You can also create a lane and use `build_android_app`:
94
+
87
95
  ```ruby
88
96
  desc "Build debug and test APK for screenshots"
89
97
  lane :build_and_screengrab do
@@ -163,7 +171,9 @@ fastlane action screengrab
163
171
  Check out [Testing UI for a Single App](http://developer.android.com/training/testing/ui-testing/espresso-testing.html) for an introduction to using Espresso for UI testing.
164
172
 
165
173
  ##### Example UI Test Class (Using JUnit4)
174
+
166
175
  Java:
176
+
167
177
  ```java
168
178
  @RunWith(JUnit4.class)
169
179
  public class JUnit4StyleTests {
@@ -182,9 +192,10 @@ public class JUnit4StyleTests {
182
192
  Screengrab.screenshot("after_button_click");
183
193
  }
184
194
  }
185
-
186
195
  ```
196
+
187
197
  Kotlin:
198
+
188
199
  ```kotlin
189
200
  @RunWith(JUnit4.class)
190
201
  class JUnit4StyleTests {
@@ -203,7 +214,6 @@ class JUnit4StyleTests {
203
214
  Screengrab.screenshot("after_button_click")
204
215
  }
205
216
  }
206
-
207
217
  ```
208
218
 
209
219
  There is an [example project](https://github.com/fastlane/fastlane/tree/master/screengrab/example/src/androidTest/java/tools/fastlane/localetester) showing how to use JUnit 3 or 4 and Espresso with the screengrab Java library to capture screenshots during a UI test run.
@@ -224,6 +234,7 @@ Note: the clean status bar feature is only supported on devices with *API level
224
234
 
225
235
  You can enable and disable the clean status bar at any moment during your tests.
226
236
  In most cases you probably want to do this in the @BeforeClass and @AfterClass methods.
237
+
227
238
  ```java
228
239
  @BeforeClass
229
240
  public static void beforeAll() {
@@ -238,6 +249,7 @@ public static void afterAll() {
238
249
 
239
250
  Have a look at the methods of the `CleanStatusBar` class to customize the status bar even more.
240
251
  You could for example show the Bluetooth icon and the LTE text.
252
+
241
253
  ```java
242
254
  new CleanStatusBar()
243
255
  .setBluetoothState(BluetoothState.DISCONNECTED)
@@ -283,6 +295,7 @@ if (extras != null) {
283
295
  For some apps, it is helpful to know when _screengrab_ is running so that you can display specific data for your screenshots. For iOS fastlane users, this is much like "FASTLANE_SNAPSHOT". In order to do this, you'll need to have at least two product flavors of your app.
284
296
 
285
297
  Add two product flavors to the app-level build.gradle file:
298
+
286
299
  ```
287
300
  android {
288
301
  ...
@@ -300,6 +313,7 @@ android {
300
313
  ```
301
314
 
302
315
  Check for the existence of that flavor (i.e screengrab) in your app code as follows in order to use mock data or customize data for screenshots:
316
+
303
317
  ```
304
318
  if (BuildConfig.FLAVOR == "screengrab") {
305
319
  System.out.println("screengrab is running!");
@@ -307,14 +321,17 @@ if (BuildConfig.FLAVOR == "screengrab") {
307
321
  ```
308
322
 
309
323
  When running _screengrab_, do the following to build the flavor you want as well as the test apk. Note that you use "assembleFlavor_name" where Flavor_name is the flavor name, capitalized (i.e. Screengrab).
324
+
310
325
  ```
311
326
  ./gradlew assembleScreengrab assembleAndroidTest
312
327
  ```
313
328
 
314
329
  Run _screengrab_:
330
+
315
331
  ```
316
332
  fastlane screengrab
317
333
  ```
334
+
318
335
  _screengrab_ will ask you to select the debug and test apps (which you can then add to your Screengrabfile to skip this step later).
319
336
 
320
337
  The debug apk should be somewhere like this:
@@ -60,7 +60,7 @@ Here is a nice gif, that shows _frameit_ in action:
60
60
  <h5 align="center">The <em>frameit</em> 2.0 update was kindly sponsored by <a href="https://mindnode.com/">MindNode</a>, seen in the screenshots above.</h5>
61
61
 
62
62
 
63
- The first time that _frameit_ is executed the frames will be downloaded automatically. Originally the frames are coming from [Facebook frameset](http://facebook.design/devices) and they are kept on [this repo](https://github.com/fastlane/frameit-frames).
63
+ The first time that _frameit_ is executed the frames will be downloaded automatically. Originally the frames are coming from [Facebook frameset](https://design.facebook.com/toolsandresources/devices/) and they are kept on [this repo](https://github.com/fastlane/frameit-frames).
64
64
 
65
65
  More information about this process and how to update the frames can be found [here](https://github.com/fastlane/fastlane/tree/master/frameit/frames_generator)
66
66
 
@@ -100,7 +100,7 @@ That's all you need to run your tests. If you want more control, here are some a
100
100
  fastlane scan --workspace "Example.xcworkspace" --scheme "AppName" --device "iPhone 6" --clean
101
101
  ```
102
102
 
103
- If you need to use a different Xcode install, use `xcode-select` or define `DEVELOPER_DIR`:
103
+ If you need to use a different Xcode install, use `[xcodes](https://docs.fastlane.tools/actions/xcodes)` or define `DEVELOPER_DIR`:
104
104
 
105
105
  ```no-highlight
106
106
  DEVELOPER_DIR="/Applications/Xcode6.2.app" scan
@@ -694,7 +694,7 @@ In this case, default values for keywords, urls, name and release notes are used
694
694
 
695
695
  [Starting March 20, 2019 Apple's App Store](https://developer.apple.com/news/?id=03202019a) requires 12.9-inch iPad Pro (3rd generation) screenshots additionally to the iPad Pro 2nd generation [screenshots](https://help.apple.com/app-store-connect/#/devd274dd925). As fastlane historically uses the screenshot dimensions to determine the "display family" of a screenshot, this poses a problem as both use the same dimensions and are recognized as the same device family.
696
696
 
697
- To solve this a screenshot of a 12.9-inch iPad Pro (3rd generation) must contain either the string `iPad Pro (12.9-inch) (3rd generation)` or `ipadPro129` (Apple's internal naming of the display family for the 3rd generation iPad Pro) in its filename to be assigned the correct display family and to be uploaded to the correct screenshot slot in your app's metadata.
697
+ To solve this a screenshot of a 12.9-inch iPad Pro (3rd generation) must contain either the string `iPad Pro (12.9-inch) (3rd generation)`, `IPAD_PRO_3GEN_129`, or `ipadPro129` (Apple's internal naming of the display family for the 3rd generation iPad Pro) in its filename to be assigned the correct display family and to be uploaded to the correct screenshot slot in your app's metadata.
698
698
 
699
699
  ## Automatically create screenshots
700
700