precheck/lib/precheck/runner.rb in fastlane-2.183.2 vs precheck/lib/precheck/runner.rb in fastlane-2.184.0

- old
+ new

@@ -16,10 +16,18 @@ FastlaneCore::PrintTable.print_values(config: Precheck.config, hide_keys: [:output_path], title: "Summary for precheck #{Fastlane::VERSION}") + api_token = if (token = Spaceship::ConnectAPI::Token.from(hash: Precheck.config[:api_key], filepath: Precheck.config[:api_key_path])) + UI.message("Creating authorization token for App Store Connect API") + token + elsif (token = Spaceship::ConnectAPI.token) + UI.message("Using existing authorization token for App Store Connect API") + token + end + if api_token # As of 2020-09-15, App Store Connect API does not have support for IAPs yet # This means that API Key will fail if checking for IAPs. # @@ -27,11 +35,10 @@ # Please remove check in Deliver when the API support IAPs. if Precheck.config[:include_in_app_purchases] UI.user_error!("Precheck cannot check In-app purchases with the App Store Connect API Key (yet). Exclude In-app purchases from precheck, disable the precheck step in your build step, or use Apple ID login") end - UI.message("Creating authorization token for App Store Connect API") Spaceship::ConnectAPI.token = api_token elsif Spaceship::Tunes.client.nil? # Username is now optional since addition of App Store Connect API Key # Force asking for username to prompt user if not already set Precheck.config.fetch(:username, force_ask: true) @@ -71,15 +78,9 @@ if !processor_result.has_errors_or_warnings? && !processor_result.items_not_checked? UI.message("precheck 👮‍♀️ 👮 finished without detecting any potential problems 🛫".green) end return true - end - - def api_token - @api_token ||= Spaceship::ConnectAPI::Token.create(**Precheck.config[:api_key]) if Precheck.config[:api_key] - @api_token ||= Spaceship::ConnectAPI::Token.from_json_file(Precheck.config[:api_key_path]) if Precheck.config[:api_key_path] - return @api_token end def print_items_not_checked(processor_result: nil) names = processor_result.items_not_checked.map(&:friendly_name) UI.message("😶 Metadata fields not checked by any rule: #{names.join(', ')}".yellow) if names.length > 0