deliver/lib/deliver/submit_for_review.rb in fastlane-2.150.0.rc4 vs deliver/lib/deliver/submit_for_review.rb in fastlane-2.150.0.rc5

- old
+ new

@@ -57,10 +57,12 @@ return build end def update_export_compliance(options, app, build) submission_information = options[:submission_information] || {} + submission_information = submission_information.collect { |k, v| [k.to_sym, v] }.to_h + uses_encryption = submission_information[:export_compliance_uses_encryption] if build.uses_non_exempt_encryption.nil? UI.verbose("Updating build for export compliance status of '#{uses_encryption}'") @@ -68,10 +70,12 @@ message = [ "Export compliance is required to submit", "Add information to the :submission_information option...", " Docs: http://docs.fastlane.tools/actions/deliver/#compliance-and-idfa-settings", " Example: submission_information: { export_compliance_uses_encryption: false }", + " Example CLI:", + " --submission_information \"{\\\"export_compliance_uses_encryption\\\": false}\"", "This can also be set in your Info.plist with key 'ITSAppUsesNonExemptEncryption'" ].join("\n") UI.user_error!(message) end @@ -83,26 +87,31 @@ end end def update_idfa(options, app, version) submission_information = options[:submission_information] || {} + submission_information = submission_information.collect { |k, v| [k.to_sym, v] }.to_h + uses_idfa = submission_information[:add_id_info_uses_idfa] idfa_declaration = begin version.fetch_idfa_declaration rescue nil end + updated_idfa = false + # Set IDFA on version - UI.verbose("Updating app store version for IDFA status of '#{uses_idfa}'") unless uses_idfa.nil? + UI.verbose("Updating app store version for IDFA status of '#{uses_idfa}'") version = version.update(attributes: { usesIdfa: uses_idfa }) + UI.verbose("Updated app store version for IDFA status of '#{version.uses_idfa}'") + updated_idfa = true end - UI.verbose("Updated app store version for IDFA status of '#{version.uses_idfa}'") # Error if uses_idfa not set if version.uses_idfa.nil? message = [ "Use of Advertising Identifier (IDFA) is required to submit", @@ -113,20 +122,23 @@ " add_id_info_uses_idfa: true,", " add_id_info_limits_tracking: false,", " add_id_info_serves_ads: false,", " add_id_info_uses_idfa: false,", " add_id_info_tracks_install: false", - " }" + " }", + " Example CLI:", + " --submission_information \"{\\\"add_id_info_uses_idfa\\\": false}\"" ].join("\n") UI.user_error!(message) end # Create, update, or delete IDFA declaration if uses_idfa == false if idfa_declaration UI.verbose("Deleting IDFA delcaration") idfa_declaration.delete! + updated_idfa = true UI.verbose("Deleted IDFA delcaration") end elsif uses_idfa == true attributes = { honorsLimitedAdTracking: !!submission_information[:add_id_info_limits_tracking], @@ -142,17 +154,20 @@ else UI.verbose("Creating IDFA delcaration") version.create_idfa_declaration(attributes: attributes) UI.verbose("Created IDFA delcaration") end + + updated_idfa = true end - UI.success("Successfully updated IDFA delcarations on App Store Connect") + UI.success("Successfully updated IDFA delcarations on App Store Connect") if updated_idfa end def update_submission_information(options, app) submission_information = options[:submission_information] || {} + submission_information = submission_information.collect { |k, v| [k.to_sym, v] }.to_h content_rights = submission_information[:content_rights_contains_third_party_content] unless content_rights.nil? value = if content_rights @@ -169,10 +184,11 @@ end end def wait_for_build_processing_to_be_complete(app: nil, platform: nil, options: nil) app_version = options[:app_version] + app_version ||= FastlaneCore::IpaFileAnalyser.fetch_app_version(options[:ipa]) if options[:ipa] app_version ||= FastlaneCore::PkgFileAnalyser.fetch_app_version(options[:pkg]) if options[:pkg] app_build ||= FastlaneCore::IpaFileAnalyser.fetch_app_build(options[:ipa]) if options[:ipa] app_build ||= FastlaneCore::PkgFileAnalyser.fetch_app_build(options[:pkg]) if options[:pkg] @@ -182,14 +198,17 @@ platform: platform, app_version: app_version, build_version: app_build, poll_interval: 15, return_when_build_appears: false, - return_spaceship_testflight_build: false + return_spaceship_testflight_build: false, + select_latest: true ) - unless latest_build.app_version == app_version && latest_build.version == app_build - UI.important("Uploaded app #{app_version} - #{app_build}, but received build #{latest_build.app_version} - #{latest_build.version}.") + if !app_version.nil? && !app_build.nil? + unless latest_build.app_version == app_version && latest_build.version == app_build + UI.important("Uploaded app #{app_version} - #{app_build}, but received build #{latest_build.app_version} - #{latest_build.version}.") + end end return latest_build end end