produce/lib/produce/developer_center.rb in fastlane-2.36.0.beta.20170530010040 vs produce/lib/produce/developer_center.rb in fastlane-2.36.0.beta.20170531010050

- old
+ new

@@ -1,9 +1,39 @@ require 'spaceship' module Produce class DeveloperCenter + SERVICE_ON = "on" + SERVICE_OFF = "off" + SERVICE_COMPLETE = "complete" + SERVICE_UNLESS_OPEN = "unlessopen" + SERVICE_UNTIL_FIRST_LAUNCH = "untilfirstauth" + SERVICE_LEGACY = "legacy" + SERVICE_CLOUDKIT = "cloudkit" + + ALLOWED_SERVICES = { + app_group: [SERVICE_ON, SERVICE_OFF], + apple_pay: [SERVICE_ON, SERVICE_OFF], + associated_domains: [SERVICE_ON, SERVICE_OFF], + data_protection: [ + SERVICE_COMPLETE, + SERVICE_UNLESS_OPEN, + SERVICE_UNTIL_FIRST_LAUNCH + ], + game_center: [SERVICE_ON, SERVICE_OFF], + health_kit: [SERVICE_ON, SERVICE_OFF], + home_kit: [SERVICE_ON, SERVICE_OFF], + wireless_accessory: [SERVICE_ON, SERVICE_OFF], + icloud: [SERVICE_LEGACY, SERVICE_CLOUDKIT], + in_app_purchase: [SERVICE_ON, SERVICE_OFF], + inter_app_audio: [SERVICE_ON, SERVICE_OFF], + passbook: [SERVICE_ON, SERVICE_OFF], + push_notification: [SERVICE_ON, SERVICE_OFF], + siri_kit: [SERVICE_ON, SERVICE_OFF], + vpn_configuration: [SERVICE_ON, SERVICE_OFF] + } + def run login create_new_app end @@ -17,11 +47,11 @@ app_name = Produce.config[:app_name] UI.message "Creating new app '#{app_name}' on the Apple Dev Center" app = Spaceship.app.create!(bundle_id: app_identifier, name: app_name, - enabled_features: enabled_features, + enable_services: enable_services, mac: Produce.config[:platform] == "osx") if app.name != Produce.config[:app_name] UI.important("Your app name includes non-ASCII characters, which are not supported by the Apple Developer Portal.") UI.important("To fix this a unique (internal) name '#{app.name}' has been created for you. Your app's real name '#{Produce.config[:app_name]}'") @@ -38,33 +68,37 @@ end return true end - def enabled_features + def enable_services app_service = Spaceship.app_service enabled_clean_options = {} - Produce.config[:enabled_features].each do |k, v| + + # "enable_services" was deprecated in favor of "enable_services" + config_enabled_services = Produce.config[:enable_services] || Produce.config[:enable_services] + + config_enabled_services.each do |k, v| if k.to_sym == :data_protection case v - when "complete" + when SERVICE_COMPLETE enabled_clean_options[app_service.data_protection.complete.service_id] = app_service.data_protection.complete - when "unlessopen" + when SERVICE_UNLESS_OPEN enabled_clean_options[app_service.data_protection.unlessopen.service_id] = app_service.data_protection.unlessopen - when "untilfirstauth" + when SERVICE_UNTIL_FIRST_LAUNCH enabled_clean_options[app_service.data_protection.untilfirstauth.service_id] = app_service.data_protection.untilfirstauth end elsif k.to_sym == :icloud case v - when "legacy" + when SERVICE_LEGACY enabled_clean_options[app_service.icloud.on.service_id] = app_service.icloud.on enabled_clean_options[app_service.cloud_kit.xcode5_compatible.service_id] = app_service.cloud_kit.xcode5_compatible - when "cloudkit" + when SERVICE_CLOUDKIT enabled_clean_options[app_service.icloud.on.service_id] = app_service.icloud.on enabled_clean_options[app_service.cloud_kit.cloud_kit.service_id] = app_service.cloud_kit.cloud_kit end else - if v == "on" + if v == SERVICE_ON enabled_clean_options[app_service.send(k.to_s).on.service_id] = app_service.send(k.to_s).on else enabled_clean_options[app_service.send(k.to_s).off.service_id] = app_service.send(k.to_s).off end end