pilot/lib/pilot/build_manager.rb in fastlane-2.126.0.beta.20190606200048 vs pilot/lib/pilot/build_manager.rb in fastlane-2.126.0.beta.20190607200028
- old
+ new
@@ -98,18 +98,18 @@
if config[:apple_id].to_s.length == 0 && config[:app_identifier].to_s.length == 0
config[:app_identifier] = UI.input("App Identifier: ")
end
# Get latest uploaded build if no build specified
- build ||= Spaceship::ConnectAPI::Build.all(app_id: app.id, sort: "-uploadedDate", limit: 1).first
+ build ||= Spaceship::ConnectAPI::TestFlight::Build.all(app_id: app.id, sort: "-uploadedDate", limit: 1).first
# Verify the build has all the includes that we need
# and fetch a new build if not
if build && (!build.app || !build.build_beta_detail || !build.pre_release_version)
UI.important("Build did include information for app, build beta detail and pre release version")
UI.important("Fetching a new build with all the information needed")
- build = Spaceship::ConnectAPI::Build.get(build_id: build.id)
+ build = Spaceship::ConnectAPI::TestFlight::Build.get(build_id: build.id)
end
# Error out if no build
if build.nil?
UI.user_error!("No build to distribute!")
@@ -326,11 +326,11 @@
def set_export_compliance_if_needed(uploaded_build, options)
if uploaded_build.uses_non_exempt_encryption.nil?
uses_non_exempt_encryption = options[:uses_non_exempt_encryption]
attributes = { usesNonExemptEncryption: uses_non_exempt_encryption }
- client = Spaceship::ConnectAPI::Base.client
+ client = Spaceship::ConnectAPI::TestFlight.client
client.patch_builds(build_id: uploaded_build.id, attributes: attributes)
UI.important("Export compliance has been set to '#{uses_non_exempt_encryption}'. Need to wait for build to finishing processing again...")
UI.important("Set 'ITSAppUsesNonExemptEncryption' in the 'Info.plist' to skip this step and speed up the submission")
wait_for_build_processing_to_be_complete
@@ -348,11 +348,11 @@
attributes[:demoAccountName] = info[:demo_account_name] if info.key?(:demo_account_name)
attributes[:demoAccountPassword] = info[:demo_account_password] if info.key?(:demo_account_password)
attributes[:demoAccountRequired] = info[:demo_account_required] if info.key?(:demo_account_required)
attributes[:notes] = info[:notes] if info.key?(:notes)
- client = Spaceship::ConnectAPI::Base.client
+ client = Spaceship::ConnectAPI::TestFlight.client
client.patch_beta_app_review_detail(app_id: build.app.id, attributes: attributes)
end
def update_localized_app_review(build, info_by_lang, default_info: nil)
info_by_lang = info_by_lang.collect { |k, v| [k.to_sym, v] }.to_h
@@ -390,11 +390,11 @@
attributes[:marketingUrl] = info[:marketing_url] if info.key?(:marketing_url)
attributes[:privacyPolicyUrl] = info[:privacy_policy_url] if info.key?(:privacy_policy_url)
attributes[:tvOsPrivacyPolicy] = info[:tv_os_privacy_policy_url] if info.key?(:tv_os_privacy_policy_url)
attributes[:description] = info[:description] if info.key?(:description)
- client = Spaceship::ConnectAPI::Base.client
+ client = Spaceship::ConnectAPI::TestFlight.client
if localization
client.patch_beta_app_localizations(localization_id: localization.id, attributes: attributes)
else
attributes[:locale] = locale if locale
client.post_beta_app_localizations(app_id: app.id, attributes: attributes)
@@ -433,11 +433,11 @@
def update_localized_build_review_for_lang(build, localization, locale, info)
attributes = {}
attributes[:whatsNew] = self.class.sanitize_changelog(info[:whats_new]) if info.key?(:whats_new)
- client = Spaceship::ConnectAPI::Base.client
+ client = Spaceship::ConnectAPI::TestFlight.client
if localization
client.patch_beta_build_localizations(localization_id: localization.id, attributes: attributes)
else
attributes[:locale] = locale if locale
client.post_beta_build_localizations(build_id: build.id, attributes: attributes)
@@ -448,10 +448,10 @@
build_beta_detail = build.build_beta_detail
attributes = {}
attributes[:autoNotifyEnabled] = info[:auto_notify_enabled] if info.key?(:auto_notify_enabled)
- client = Spaceship::ConnectAPI::Base.client
+ client = Spaceship::ConnectAPI::TestFlight.client
client.patch_build_beta_details(build_beta_details_id: build_beta_detail.id, attributes: attributes)
end
end
# rubocop:enable Metrics/ClassLength
end