fastlane 2.182.0 → 2.184.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +103 -96
  3. data/cert/lib/cert/runner.rb +3 -7
  4. data/deliver/lib/assets/summary.html.erb +10 -10
  5. data/deliver/lib/deliver/commands_generator.rb +1 -1
  6. data/deliver/lib/deliver/detect_values.rb +5 -3
  7. data/deliver/lib/deliver/download_screenshots.rb +1 -1
  8. data/deliver/lib/deliver/html_generator.rb +2 -2
  9. data/deliver/lib/deliver/module.rb +6 -0
  10. data/deliver/lib/deliver/options.rb +36 -51
  11. data/deliver/lib/deliver/runner.rb +8 -11
  12. data/deliver/lib/deliver/setup.rb +1 -1
  13. data/deliver/lib/deliver/submit_for_review.rb +4 -4
  14. data/deliver/lib/deliver/upload_metadata.rb +20 -6
  15. data/deliver/lib/deliver/upload_price_tier.rb +1 -1
  16. data/deliver/lib/deliver/upload_screenshots.rb +1 -1
  17. data/fastlane/lib/fastlane/actions/app_store_build_number.rb +7 -11
  18. data/fastlane/lib/fastlane/actions/app_store_connect_api_key.rb +12 -2
  19. data/fastlane/lib/fastlane/actions/carthage.rb +1 -1
  20. data/fastlane/lib/fastlane/actions/check_app_store_metadata.rb +5 -1
  21. data/fastlane/lib/fastlane/actions/danger.rb +7 -1
  22. data/fastlane/lib/fastlane/actions/docs/upload_to_app_store.md.erb +32 -12
  23. data/fastlane/lib/fastlane/actions/get_certificates.rb +5 -1
  24. data/fastlane/lib/fastlane/actions/get_managed_play_store_publishing_rights.rb +3 -1
  25. data/fastlane/lib/fastlane/actions/get_provisioning_profile.rb +5 -1
  26. data/fastlane/lib/fastlane/actions/git_pull.rb +4 -10
  27. data/fastlane/lib/fastlane/actions/hipchat.rb +2 -1
  28. data/fastlane/lib/fastlane/actions/notification.rb +1 -1
  29. data/fastlane/lib/fastlane/actions/register_device.rb +7 -10
  30. data/fastlane/lib/fastlane/actions/register_devices.rb +7 -10
  31. data/fastlane/lib/fastlane/actions/set_changelog.rb +7 -10
  32. data/fastlane/lib/fastlane/actions/swiftlint.rb +17 -15
  33. data/fastlane/lib/fastlane/actions/sync_code_signing.rb +6 -1
  34. data/fastlane/lib/fastlane/actions/upload_to_app_store.rb +5 -1
  35. data/fastlane/lib/fastlane/actions/upload_to_testflight.rb +2 -1
  36. data/fastlane/lib/fastlane/actions/xcodebuild.rb +5 -5
  37. data/fastlane/lib/fastlane/plugins/plugin_manager.rb +1 -1
  38. data/fastlane/lib/fastlane/plugins/template/%gem_name%.gemspec.erb +1 -1
  39. data/fastlane/lib/fastlane/plugins/template/.rubocop.yml +1 -1
  40. data/fastlane/lib/fastlane/swift_fastlane_function.rb +6 -4
  41. data/fastlane/lib/fastlane/version.rb +1 -1
  42. data/fastlane/swift/Deliverfile.swift +1 -1
  43. data/fastlane/swift/DeliverfileProtocol.swift +20 -20
  44. data/fastlane/swift/Fastlane.swift +473 -247
  45. data/fastlane/swift/Gymfile.swift +1 -1
  46. data/fastlane/swift/GymfileProtocol.swift +1 -1
  47. data/fastlane/swift/Matchfile.swift +1 -1
  48. data/fastlane/swift/MatchfileProtocol.swift +1 -1
  49. data/fastlane/swift/OptionalConfigValue.swift +2 -32
  50. data/fastlane/swift/Precheckfile.swift +1 -1
  51. data/fastlane/swift/PrecheckfileProtocol.swift +1 -1
  52. data/fastlane/swift/Scanfile.swift +1 -1
  53. data/fastlane/swift/ScanfileProtocol.swift +1 -1
  54. data/fastlane/swift/Screengrabfile.swift +1 -1
  55. data/fastlane/swift/ScreengrabfileProtocol.swift +1 -1
  56. data/fastlane/swift/Snapshotfile.swift +1 -1
  57. data/fastlane/swift/SnapshotfileProtocol.swift +1 -1
  58. data/fastlane/swift/formatting/Brewfile.lock.json +11 -11
  59. data/fastlane_core/lib/fastlane_core/build_watcher.rb +39 -3
  60. data/fastlane_core/lib/fastlane_core/configuration/commander_generator.rb +5 -0
  61. data/fastlane_core/lib/fastlane_core/configuration/config_item.rb +5 -3
  62. data/fastlane_core/lib/fastlane_core/configuration/configuration.rb +1 -1
  63. data/fastlane_core/lib/fastlane_core/device_manager.rb +1 -1
  64. data/fastlane_core/lib/fastlane_core/ui/implementations/shell.rb +4 -1
  65. data/frameit/lib/frameit/config_parser.rb +2 -2
  66. data/frameit/lib/frameit/frame_downloader.rb +2 -1
  67. data/gym/lib/gym/code_signing_mapping.rb +2 -2
  68. data/gym/lib/gym/generators/package_command_generator_xcode7.rb +6 -5
  69. data/match/lib/match/importer.rb +6 -10
  70. data/match/lib/match/migrate.rb +2 -3
  71. data/match/lib/match/nuke.rb +3 -7
  72. data/match/lib/match/options.rb +1 -0
  73. data/match/lib/match/runner.rb +2 -3
  74. data/match/lib/match/spaceship_ensure.rb +3 -0
  75. data/match/lib/match/storage/google_cloud_storage.rb +2 -2
  76. data/match/lib/match/storage/s3_storage.rb +2 -2
  77. data/pilot/lib/pilot/build_manager.rb +7 -4
  78. data/pilot/lib/pilot/manager.rb +3 -7
  79. data/pilot/lib/pilot/options.rb +8 -0
  80. data/precheck/lib/precheck/runner.rb +8 -7
  81. data/scan/lib/scan/runner.rb +1 -1
  82. data/sigh/lib/assets/resign.sh +77 -46
  83. data/sigh/lib/sigh/download_all.rb +4 -8
  84. data/sigh/lib/sigh/runner.rb +4 -8
  85. data/spaceship/README.md +2 -2
  86. data/spaceship/lib/spaceship/connect_api/model.rb +1 -1
  87. data/spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb +35 -4
  88. data/spaceship/lib/spaceship/connect_api/models/app_info.rb +10 -0
  89. data/spaceship/lib/spaceship/connect_api/models/app_store_version.rb +2 -3
  90. data/spaceship/lib/spaceship/connect_api/models/beta_group.rb +3 -1
  91. data/spaceship/lib/spaceship/connect_api/models/build.rb +2 -0
  92. data/spaceship/lib/spaceship/connect_api/token.rb +6 -0
  93. data/spaceship/lib/spaceship/connect_api/tunes/tunes.rb +4 -2
  94. data/supply/lib/supply/client.rb +2 -2
  95. data/supply/lib/supply/uploader.rb +2 -2
  96. metadata +42 -39
@@ -109,11 +109,11 @@ module Deliver
109
109
  default_value: false,
110
110
  env_name: "DELIVER_EDIT_LIVE",
111
111
  description: "Modify live metadata, this option disables ipa upload and screenshot upload",
112
- is_string: false),
112
+ type: Boolean),
113
113
  FastlaneCore::ConfigItem.new(key: :use_live_version,
114
114
  env_name: "DELIVER_USE_LIVE_VERSION",
115
115
  description: "Force usage of live version rather than edit version",
116
- is_string: false,
116
+ type: Boolean,
117
117
  default_value: false),
118
118
 
119
119
  # paths
@@ -132,22 +132,22 @@ module Deliver
132
132
  FastlaneCore::ConfigItem.new(key: :skip_binary_upload,
133
133
  env_name: "DELIVER_SKIP_BINARY_UPLOAD",
134
134
  description: "Skip uploading an ipa or pkg to App Store Connect",
135
- is_string: false,
135
+ type: Boolean,
136
136
  default_value: false),
137
137
  FastlaneCore::ConfigItem.new(key: :skip_screenshots,
138
138
  env_name: "DELIVER_SKIP_SCREENSHOTS",
139
139
  description: "Don't upload the screenshots",
140
- is_string: false,
140
+ type: Boolean,
141
141
  default_value: false),
142
142
  FastlaneCore::ConfigItem.new(key: :skip_metadata,
143
143
  env_name: "DELIVER_SKIP_METADATA",
144
144
  description: "Don't upload the metadata (e.g. title, description). This will still upload screenshots",
145
- is_string: false,
145
+ type: Boolean,
146
146
  default_value: false),
147
147
  FastlaneCore::ConfigItem.new(key: :skip_app_version_update,
148
148
  env_name: "DELIVER_SKIP_APP_VERSION_UPDATE",
149
149
  description: "Don’t create or update the app version that is being prepared for submission",
150
- is_string: false,
150
+ type: Boolean,
151
151
  default_value: false),
152
152
 
153
153
  # how to operate
@@ -155,22 +155,22 @@ module Deliver
155
155
  short_option: "-f",
156
156
  env_name: "DELIVER_FORCE",
157
157
  description: "Skip verification of HTML preview file",
158
- is_string: false,
158
+ type: Boolean,
159
159
  default_value: false),
160
160
  FastlaneCore::ConfigItem.new(key: :overwrite_screenshots,
161
161
  env_name: "DELIVER_OVERWRITE_SCREENSHOTS",
162
162
  description: "Clear all previously uploaded screenshots before uploading the new ones",
163
- is_string: false,
163
+ type: Boolean,
164
164
  default_value: false),
165
165
  FastlaneCore::ConfigItem.new(key: :submit_for_review,
166
166
  env_name: "DELIVER_SUBMIT_FOR_REVIEW",
167
167
  description: "Submit the new version for Review after uploading everything",
168
- is_string: false,
168
+ type: Boolean,
169
169
  default_value: false),
170
170
  FastlaneCore::ConfigItem.new(key: :reject_if_possible,
171
171
  env_name: "DELIVER_REJECT_IF_POSSIBLE",
172
172
  description: "Rejects the previously submitted build if it's in a state where it's possible",
173
- is_string: false,
173
+ type: Boolean,
174
174
  default_value: false),
175
175
 
176
176
  # release
@@ -198,13 +198,13 @@ module Deliver
198
198
  env_name: "DELIVER_PHASED_RELEASE",
199
199
  description: "Enable the phased release feature of iTC",
200
200
  optional: true,
201
- is_string: false,
201
+ type: Boolean,
202
202
  default_value: false),
203
203
  FastlaneCore::ConfigItem.new(key: :reset_ratings,
204
204
  env_name: "DELIVER_RESET_RATINGS",
205
205
  description: "Reset the summary rating when you release a new version of the application",
206
206
  optional: true,
207
- is_string: false,
207
+ type: Boolean,
208
208
  default_value: false),
209
209
 
210
210
  # other app configuration
@@ -212,13 +212,12 @@ module Deliver
212
212
  short_option: "-r",
213
213
  env_name: "DELIVER_PRICE_TIER",
214
214
  description: "The price tier of this application",
215
- is_string: false,
215
+ type: Integer,
216
216
  optional: true),
217
217
  FastlaneCore::ConfigItem.new(key: :app_rating_config_path,
218
218
  short_option: "-g",
219
219
  env_name: "DELIVER_APP_RATING_CONFIG_PATH",
220
220
  description: "Path to the app rating's config",
221
- is_string: true,
222
221
  optional: true,
223
222
  verify_block: proc do |value|
224
223
  UI.user_error!("Could not find config file at path '#{File.expand_path(value)}'") unless File.exist?(value)
@@ -227,7 +226,6 @@ module Deliver
227
226
  FastlaneCore::ConfigItem.new(key: :submission_information,
228
227
  short_option: "-b",
229
228
  description: "Extra information for the submission (e.g. compliance specifications, IDFA settings)",
230
- is_string: false,
231
229
  type: Hash,
232
230
  optional: true),
233
231
 
@@ -237,7 +235,7 @@ module Deliver
237
235
  env_name: "DELIVER_TEAM_ID",
238
236
  description: "The ID of your App Store Connect team if you're in multiple teams",
239
237
  optional: true,
240
- is_string: false, # as we also allow integers, which we convert to strings anyway
238
+ skip_type_validation: true, # as we also allow integers, which we convert to strings anyway
241
239
  code_gen_sensitive: true,
242
240
  default_value: CredentialsManager::AppfileConfig.try_fetch_value(:itc_team_id),
243
241
  default_value_dynamic: true,
@@ -260,7 +258,6 @@ module Deliver
260
258
  env_name: "DELIVER_DEV_PORTAL_TEAM_ID",
261
259
  description: "The short ID of your Developer Portal team, if you're in multiple teams. Different from your iTC team ID!",
262
260
  optional: true,
263
- is_string: true,
264
261
  code_gen_sensitive: true,
265
262
  default_value: CredentialsManager::AppfileConfig.try_fetch_value(:team_id),
266
263
  default_value_dynamic: true,
@@ -293,13 +290,13 @@ module Deliver
293
290
  short_option: "-x",
294
291
  env_name: "DELIVER_RUN_PRECHECK_BEFORE_SUBMIT",
295
292
  description: "Run precheck before submitting to app review",
296
- is_string: false,
293
+ type: Boolean,
297
294
  default_value: true),
298
295
  FastlaneCore::ConfigItem.new(key: :precheck_default_rule_level,
299
296
  short_option: "-d",
300
297
  env_name: "DELIVER_PRECHECK_DEFAULT_RULE_LEVEL",
301
298
  description: "The default precheck rule level unless otherwise configured",
302
- is_string: false,
299
+ type: Symbol,
303
300
  default_value: :warn),
304
301
 
305
302
  # App Metadata
@@ -307,7 +304,6 @@ module Deliver
307
304
  env_name: "DELIVER_INDIVUDAL_METADATA_ITEMS",
308
305
  description: "An array of localized metadata items to upload individually by language so that errors can be identified. E.g. ['name', 'keywords', 'description']. Note: slow",
309
306
  deprecated: "Removed after the migration to the new App Store Connect API in June 2020",
310
- is_string: false,
311
307
  type: Array,
312
308
  optional: true),
313
309
 
@@ -327,66 +323,56 @@ module Deliver
327
323
  FastlaneCore::ConfigItem.new(key: :copyright,
328
324
  env_name: "DELIVER_COPYRIGHT",
329
325
  description: "Metadata: The copyright notice",
330
- optional: true,
331
- is_string: true),
326
+ optional: true),
332
327
  FastlaneCore::ConfigItem.new(key: :primary_category,
333
328
  env_name: "DELIVER_PRIMARY_CATEGORY",
334
329
  description: "Metadata: The english name of the primary category (e.g. `Business`, `Books`)",
335
- optional: true,
336
- is_string: true),
330
+ optional: true),
337
331
  FastlaneCore::ConfigItem.new(key: :secondary_category,
338
332
  env_name: "DELIVER_SECONDARY_CATEGORY",
339
333
  description: "Metadata: The english name of the secondary category (e.g. `Business`, `Books`)",
340
- optional: true,
341
- is_string: true),
334
+ optional: true),
342
335
  FastlaneCore::ConfigItem.new(key: :primary_first_sub_category,
343
336
  env_name: "DELIVER_PRIMARY_FIRST_SUB_CATEGORY",
344
337
  description: "Metadata: The english name of the primary first sub category (e.g. `Educational`, `Puzzle`)",
345
- optional: true,
346
- is_string: true),
338
+ optional: true),
347
339
  FastlaneCore::ConfigItem.new(key: :primary_second_sub_category,
348
340
  env_name: "DELIVER_PRIMARY_SECOND_SUB_CATEGORY",
349
341
  description: "Metadata: The english name of the primary second sub category (e.g. `Educational`, `Puzzle`)",
350
- optional: true,
351
- is_string: true),
342
+ optional: true),
352
343
  FastlaneCore::ConfigItem.new(key: :secondary_first_sub_category,
353
344
  env_name: "DELIVER_SECONDARY_FIRST_SUB_CATEGORY",
354
345
  description: "Metadata: The english name of the secondary first sub category (e.g. `Educational`, `Puzzle`)",
355
- optional: true,
356
- is_string: true),
346
+ optional: true),
357
347
  FastlaneCore::ConfigItem.new(key: :secondary_second_sub_category,
358
348
  env_name: "DELIVER_SECONDARY_SECOND_SUB_CATEGORY",
359
349
  description: "Metadata: The english name of the secondary second sub category (e.g. `Educational`, `Puzzle`)",
360
- optional: true,
361
- is_string: true),
350
+ optional: true),
362
351
  FastlaneCore::ConfigItem.new(key: :trade_representative_contact_information,
363
352
  description: "Metadata: A hash containing the trade representative contact information",
364
353
  optional: true,
365
- is_string: false,
354
+ deprecated: "This is no longer used by App Store Connect",
366
355
  type: Hash),
367
356
  FastlaneCore::ConfigItem.new(key: :app_review_information,
368
357
  description: "Metadata: A hash containing the review information",
369
358
  optional: true,
370
- is_string: false,
371
359
  type: Hash),
372
360
  FastlaneCore::ConfigItem.new(key: :app_review_attachment_file,
373
361
  env_name: "DELIVER_APP_REVIEW_ATTACHMENT_FILE",
374
362
  description: "Metadata: Path to the app review attachment file",
375
- optional: true,
376
- is_string: true),
363
+ optional: true),
377
364
  # Localised
378
365
  FastlaneCore::ConfigItem.new(key: :description,
379
366
  description: "Metadata: The localised app description",
380
367
  optional: true,
381
- is_string: false),
368
+ type: Hash),
382
369
  FastlaneCore::ConfigItem.new(key: :name,
383
370
  description: "Metadata: The localised app name",
384
371
  optional: true,
385
- is_string: false),
372
+ type: Hash),
386
373
  FastlaneCore::ConfigItem.new(key: :subtitle,
387
374
  description: "Metadata: The localised app subtitle",
388
375
  optional: true,
389
- is_string: false,
390
376
  type: Hash,
391
377
  verify_block: proc do |value|
392
378
  UI.user_error!(":subtitle must be a hash, with the language being the key") unless value.kind_of?(Hash)
@@ -394,7 +380,6 @@ module Deliver
394
380
  FastlaneCore::ConfigItem.new(key: :keywords,
395
381
  description: "Metadata: An array of localised keywords",
396
382
  optional: true,
397
- is_string: false,
398
383
  type: Hash,
399
384
  verify_block: proc do |value|
400
385
  UI.user_error!(":keywords must be a hash, with the language being the key") unless value.kind_of?(Hash)
@@ -409,7 +394,6 @@ module Deliver
409
394
  FastlaneCore::ConfigItem.new(key: :promotional_text,
410
395
  description: "Metadata: An array of localised promotional texts",
411
396
  optional: true,
412
- is_string: false,
413
397
  type: Hash,
414
398
  verify_block: proc do |value|
415
399
  UI.user_error!(":keywords must be a hash, with the language being the key") unless value.kind_of?(Hash)
@@ -417,23 +401,23 @@ module Deliver
417
401
  FastlaneCore::ConfigItem.new(key: :release_notes,
418
402
  description: "Metadata: Localised release notes for this version",
419
403
  optional: true,
420
- is_string: false),
404
+ type: Hash),
421
405
  FastlaneCore::ConfigItem.new(key: :privacy_url,
422
406
  description: "Metadata: Localised privacy url",
423
407
  optional: true,
424
- is_string: false),
408
+ type: Hash),
425
409
  FastlaneCore::ConfigItem.new(key: :apple_tv_privacy_policy,
426
410
  description: "Metadata: Localised Apple TV privacy policy text",
427
411
  optional: true,
428
- is_string: false),
412
+ type: Hash),
429
413
  FastlaneCore::ConfigItem.new(key: :support_url,
430
414
  description: "Metadata: Localised support url",
431
415
  optional: true,
432
- is_string: false),
416
+ type: Hash),
433
417
  FastlaneCore::ConfigItem.new(key: :marketing_url,
434
418
  description: "Metadata: Localised marketing url",
435
419
  optional: true,
436
- is_string: false),
420
+ type: Hash),
437
421
  # The verify_block has been removed from here and verification now happens in Deliver::DetectValues
438
422
  # Verification needed Spaceship::Tunes.client which required the Deliver::Runner to already by started
439
423
  FastlaneCore::ConfigItem.new(key: :languages,
@@ -445,11 +429,11 @@ module Deliver
445
429
  env_name: "DELIVER_IGNORE_LANGUAGE_DIRECTORY_VALIDATION",
446
430
  description: "Ignore errors when invalid languages are found in metadata and screenshot directories",
447
431
  default_value: false,
448
- is_string: false),
432
+ type: Boolean),
449
433
  FastlaneCore::ConfigItem.new(key: :precheck_include_in_app_purchases,
450
434
  env_name: "PRECHECK_INCLUDE_IN_APP_PURCHASES",
451
435
  description: "Should precheck check in-app purchases?",
452
- is_string: false,
436
+ type: Boolean,
453
437
  optional: true,
454
438
  default_value: true),
455
439
 
@@ -458,7 +442,8 @@ module Deliver
458
442
  short_option: "-p",
459
443
  env_name: "DELIVER_APP_ID",
460
444
  description: "The (spaceship) app ID of the app you want to use/modify",
461
- is_string: false) # don't add any verification here, as it's used to store a spaceship ref
445
+ optional: true,
446
+ type: Integer)
462
447
  ]
463
448
  end
464
449
  end
@@ -26,9 +26,11 @@ module Deliver
26
26
  end
27
27
 
28
28
  def login
29
- if api_token
29
+ if (api_token = Spaceship::ConnectAPI::Token.from(hash: options[:api_key], filepath: options[:api_key_path]))
30
30
  UI.message("Creating authorization token for App Store Connect API")
31
31
  Spaceship::ConnectAPI.token = api_token
32
+ elsif !Spaceship::ConnectAPI.token.nil?
33
+ UI.message("Using existing authorization token for App Store Connect API")
32
34
  else
33
35
  # Username is now optional since addition of App Store Connect API Key
34
36
  # Force asking for username to prompt user if not already set
@@ -42,12 +44,6 @@ module Deliver
42
44
  end
43
45
  end
44
46
 
45
- def api_token
46
- @api_token ||= Spaceship::ConnectAPI::Token.create(**options[:api_key]) if options[:api_key]
47
- @api_token ||= Spaceship::ConnectAPI::Token.from_json_file(options[:api_key_path]) if options[:api_key_path]
48
- return @api_token
49
- end
50
-
51
47
  def run
52
48
  verify_version if options[:app_version].to_s.length > 0 && !options[:skip_app_version_update]
53
49
 
@@ -118,7 +114,7 @@ module Deliver
118
114
  app_version = options[:app_version]
119
115
  UI.message("Making sure the latest version on App Store Connect matches '#{app_version}'...")
120
116
 
121
- app = options[:app]
117
+ app = Deliver.cache[:app]
122
118
 
123
119
  platform = Spaceship::ConnectAPI::Platform.map(options[:platform])
124
120
  changed = app.ensure_version!(app_version, platform: platform)
@@ -167,14 +163,14 @@ module Deliver
167
163
 
168
164
  if upload_ipa
169
165
  package_path = FastlaneCore::IpaUploadPackageBuilder.new.generate(
170
- app_id: options[:app].id,
166
+ app_id: Deliver.cache[:app].id,
171
167
  ipa_path: options[:ipa],
172
168
  package_path: "/tmp",
173
169
  platform: options[:platform]
174
170
  )
175
171
  elsif upload_pkg
176
172
  package_path = FastlaneCore::PkgUploadPackageBuilder.new.generate(
177
- app_id: options[:app].id,
173
+ app_id: Deliver.cache[:app].id,
178
174
  pkg_path: options[:pkg],
179
175
  package_path: "/tmp",
180
176
  platform: options[:platform]
@@ -191,7 +187,7 @@ module Deliver
191
187
  end
192
188
 
193
189
  def reject_version_if_possible
194
- app = options[:app]
190
+ app = Deliver.cache[:app]
195
191
  platform = Spaceship::ConnectAPI::Platform.map(options[:platform])
196
192
  if app.reject_version_if_possible!(platform: platform)
197
193
  UI.success("Successfully rejected previous version!")
@@ -210,6 +206,7 @@ module Deliver
210
206
  # If there are fewer than two teams, don't infer the provider.
211
207
  def transporter_for_selected_team
212
208
  # Use JWT auth
209
+ api_token = Spaceship::ConnectAPI.token
213
210
  unless api_token.nil?
214
211
  api_token.refresh! if api_token.expired?
215
212
  return FastlaneCore::ItunesTransporter.new(nil, nil, false, nil, api_token.text)
@@ -39,7 +39,7 @@ module Deliver
39
39
  # This method takes care of creating a new 'deliver' folder, containing the app metadata
40
40
  # and screenshots folders
41
41
  def generate_deliver_file(deliver_path, options)
42
- app = options[:app]
42
+ app = Deliver.cache[:app]
43
43
 
44
44
  platform = Spaceship::ConnectAPI::Platform.map(options[:platform])
45
45
  v = app.get_latest_app_store_version(platform: platform)
@@ -7,7 +7,7 @@ require 'fastlane_core/pkg_file_analyser'
7
7
  module Deliver
8
8
  class SubmitForReview
9
9
  def submit!(options)
10
- app = options[:app]
10
+ app = Deliver.cache[:app]
11
11
 
12
12
  platform = Spaceship::ConnectAPI::Platform.map(options[:platform])
13
13
  version = app.get_edit_app_store_version(platform: platform)
@@ -57,7 +57,7 @@ module Deliver
57
57
 
58
58
  def update_export_compliance(options, app, build)
59
59
  submission_information = options[:submission_information] || {}
60
- submission_information = submission_information.collect { |k, v| [k.to_sym, v] }.to_h
60
+ submission_information = submission_information.transform_keys(&:to_sym)
61
61
 
62
62
  uses_encryption = submission_information[:export_compliance_uses_encryption]
63
63
 
@@ -87,7 +87,7 @@ module Deliver
87
87
 
88
88
  def update_idfa(options, app, version)
89
89
  submission_information = options[:submission_information] || {}
90
- submission_information = submission_information.collect { |k, v| [k.to_sym, v] }.to_h
90
+ submission_information = submission_information.transform_keys(&:to_sym)
91
91
 
92
92
  uses_idfa = submission_information[:add_id_info_uses_idfa]
93
93
 
@@ -163,7 +163,7 @@ module Deliver
163
163
 
164
164
  def update_submission_information(options, app)
165
165
  submission_information = options[:submission_information] || {}
166
- submission_information = submission_information.collect { |k, v| [k.to_sym, v] }.to_h
166
+ submission_information = submission_information.transform_keys(&:to_sym)
167
167
 
168
168
  content_rights = submission_information[:content_rights_contains_third_party_content]
169
169
 
@@ -82,7 +82,7 @@ module Deliver
82
82
  def upload(options)
83
83
  return if options[:skip_metadata]
84
84
 
85
- app = options[:app]
85
+ app = Deliver.cache[:app]
86
86
 
87
87
  platform = Spaceship::ConnectAPI::Platform.map(options[:platform])
88
88
 
@@ -342,7 +342,7 @@ module Deliver
342
342
 
343
343
  set_review_information(version, options)
344
344
  set_review_attachment_file(version, options)
345
- set_app_rating(version, options)
345
+ set_app_rating(app_info, options)
346
346
  end
347
347
 
348
348
  # rubocop:enable Metrics/PerceivedComplexity
@@ -595,7 +595,7 @@ module Deliver
595
595
  info = options[:app_review_information]
596
596
  return if info.nil? || info.empty?
597
597
 
598
- info = info.collect { |k, v| [k.to_sym, v] }.to_h
598
+ info = info.transform_keys(&:to_sym)
599
599
  UI.user_error!("`app_review_information` must be a hash", show_github_issues: true) unless info.kind_of?(Hash)
600
600
 
601
601
  attributes = {}
@@ -642,7 +642,7 @@ module Deliver
642
642
  end
643
643
  end
644
644
 
645
- def set_app_rating(version, options)
645
+ def set_app_rating(app_info, options)
646
646
  return unless options[:app_rating_config_path]
647
647
 
648
648
  require 'json'
@@ -675,9 +675,23 @@ module Deliver
675
675
  has_mapped_values = true
676
676
  UI.deprecated("Age rating '#{k}' from iTunesConnect has been deprecated. Please replace with '#{v}'")
677
677
  end
678
- UI.deprecated("You can find more info at https://docs.fastlane.tools/actions/deliver/#reference") if has_mapped_values
679
678
 
680
- age_rating_declaration = version.fetch_age_rating_declaration
679
+ # Handle App Store Connect deprecation/migrations of keys/values if possible
680
+ attributes, deprecation_messages, errors = Spaceship::ConnectAPI::AgeRatingDeclaration.map_deprecation_if_possible(attributes)
681
+ deprecation_messages.each do |message|
682
+ UI.deprecated(message)
683
+ end
684
+
685
+ unless errors.empty?
686
+ errors.each do |error|
687
+ UI.error(error)
688
+ end
689
+ UI.user_error!("There are Age Rating deprecation errors that cannot be solved automatically... Please apply any fixes and try again")
690
+ end
691
+
692
+ UI.deprecated("You can find more info at https://docs.fastlane.tools/actions/deliver/#reference") if has_mapped_values || !deprecation_messages.empty?
693
+
694
+ age_rating_declaration = app_info.fetch_age_rating_declaration
681
695
  age_rating_declaration.update(attributes: attributes)
682
696
  end
683
697
  end