diff --git a/uploaders/ipa_uploader.rb b/uploaders/ipa_uploader.rb index 7cd9b734..6e825286 100644 --- a/uploaders/ipa_uploader.rb +++ b/uploaders/ipa_uploader.rb @@ -6,6 +6,24 @@ # --- upload ipa # ----------------------- +def export_method(mobileprovision_content) + # if ProvisionedDevices: !nil & "get-task-allow": true -> development + # if ProvisionedDevices: !nil & "get-task-allow": false -> ad-hoc + # if ProvisionedDevices: nil & "ProvisionsAllDevices": "true" -> enterprise + # if ProvisionedDevices: nil & ProvisionsAllDevices: nil -> app-store + if mobileprovision_content['ProvisionedDevices'].nil? + return 'enterprise' if !mobileprovision_content['ProvisionsAllDevices'].nil? && (mobileprovision_content['ProvisionsAllDevices'] == true || mobileprovision_content['ProvisionsAllDevices'] == 'true') + return 'app-store' + else + unless mobileprovision_content['Entitlements'].nil? + entitlements = mobileprovision_content['Entitlements'] + return 'development' if !entitlements['get-task-allow'].nil? && (entitlements['get-task-allow'] == true || entitlements['get-task-allow'] == 'true') + return 'ad-hoc' + end + end + return 'development' +end + def deploy_ipa_to_bitrise(ipa_path, build_url, api_token, notify_user_groups, notify_emails, is_enable_public_page) puts puts "# Deploying ipa file: #{ipa_path}" @@ -27,6 +45,16 @@ def deploy_ipa_to_bitrise(ipa_path, build_url, api_token, notify_user_groups, no parsed_ipa_infos[:mobileprovision] = ipa_analyzer.collect_provision_info fail 'Failed to collect Provisioning Profile information' if parsed_ipa_infos[:mobileprovision].nil? + if export_method(parsed_ipa_infos[:mobileprovision]) == 'app-store' + if is_enable_public_page + puts + puts ' (!) is_enable_public_page is set, but public download isn\'t allowed for app-store distributions' + puts ' (!) setting is_enable_public_page to false ...' + puts + is_enable_public_page = false + end + end + puts ' => Collecting Info.plist information' parsed_ipa_infos[:info_plist] = ipa_analyzer.collect_info_plist_info fail 'Failed to collect Info.plist information' if parsed_ipa_infos[:info_plist].nil?