fastlane_hotfix 2.165.1 → 2.187.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +1 -1
- data/README.md +106 -86
- data/cert/lib/cert/commands_generator.rb +2 -1
- data/cert/lib/cert/options.rb +6 -5
- data/cert/lib/cert/runner.rb +8 -8
- data/deliver/lib/assets/summary.html.erb +10 -10
- data/deliver/lib/deliver/app_screenshot.rb +17 -11
- data/deliver/lib/deliver/app_screenshot_validator.rb +108 -0
- data/deliver/lib/deliver/commands_generator.rb +4 -3
- data/deliver/lib/deliver/detect_values.rb +5 -3
- data/deliver/lib/deliver/download_screenshots.rb +2 -3
- data/deliver/lib/deliver/html_generator.rb +2 -2
- data/deliver/lib/deliver/languages.rb +1 -1
- data/deliver/lib/deliver/loader.rb +123 -21
- data/deliver/lib/deliver/module.rb +6 -0
- data/deliver/lib/deliver/options.rb +41 -55
- data/deliver/lib/deliver/runner.rb +19 -14
- data/deliver/lib/deliver/setup.rb +9 -5
- data/deliver/lib/deliver/submit_for_review.rb +4 -4
- data/deliver/lib/deliver/upload_metadata.rb +32 -21
- data/deliver/lib/deliver/upload_price_tier.rb +1 -1
- data/deliver/lib/deliver/upload_screenshots.rb +14 -76
- data/fastlane/lib/fastlane/actions/actions_helper.rb +3 -3
- data/fastlane/lib/fastlane/actions/adb.rb +2 -5
- data/fastlane/lib/fastlane/actions/adb_devices.rb +0 -1
- data/fastlane/lib/fastlane/actions/add_git_tag.rb +22 -6
- data/fastlane/lib/fastlane/actions/app_store_build_number.rb +17 -17
- data/fastlane/lib/fastlane/actions/app_store_connect_api_key.rb +21 -7
- data/fastlane/lib/fastlane/actions/appaloosa.rb +7 -2
- data/fastlane/lib/fastlane/actions/appetize.rb +13 -8
- data/fastlane/lib/fastlane/actions/appetize_viewing_url_generator.rb +0 -11
- data/fastlane/lib/fastlane/actions/appium.rb +40 -65
- data/fastlane/lib/fastlane/actions/appledoc.rb +46 -46
- data/fastlane/lib/fastlane/actions/apteligent.rb +3 -2
- data/fastlane/lib/fastlane/actions/artifactory.rb +41 -9
- data/fastlane/lib/fastlane/actions/automatic_code_signing.rb +7 -13
- data/fastlane/lib/fastlane/actions/backup_file.rb +1 -1
- data/fastlane/lib/fastlane/actions/backup_xcarchive.rb +3 -3
- data/fastlane/lib/fastlane/actions/badge.rb +9 -13
- data/fastlane/lib/fastlane/actions/build_and_upload_to_appetize.rb +11 -5
- data/fastlane/lib/fastlane/actions/build_app.rb +7 -1
- data/fastlane/lib/fastlane/actions/bundle_install.rb +8 -10
- data/fastlane/lib/fastlane/actions/carthage.rb +22 -14
- data/fastlane/lib/fastlane/actions/changelog_from_git_commits.rb +8 -17
- data/fastlane/lib/fastlane/actions/chatwork.rb +3 -2
- data/fastlane/lib/fastlane/actions/check_app_store_metadata.rb +9 -1
- data/fastlane/lib/fastlane/actions/clean_build_artifacts.rb +0 -1
- data/fastlane/lib/fastlane/actions/clean_cocoapods_cache.rb +0 -1
- data/fastlane/lib/fastlane/actions/clipboard.rb +3 -6
- data/fastlane/lib/fastlane/actions/cloc.rb +9 -13
- data/fastlane/lib/fastlane/actions/cocoapods.rb +23 -15
- data/fastlane/lib/fastlane/actions/commit_github_file.rb +12 -4
- data/fastlane/lib/fastlane/actions/commit_version_bump.rb +6 -7
- data/fastlane/lib/fastlane/actions/copy_artifacts.rb +3 -4
- data/fastlane/lib/fastlane/actions/crashlytics.rb +7 -11
- data/fastlane/lib/fastlane/actions/create_app_on_managed_play_store.rb +70 -76
- data/fastlane/lib/fastlane/actions/create_keychain.rb +13 -11
- data/fastlane/lib/fastlane/actions/create_pull_request.rb +15 -9
- data/fastlane/lib/fastlane/actions/create_xcframework.rb +123 -0
- data/fastlane/lib/fastlane/actions/danger.rb +13 -12
- data/fastlane/lib/fastlane/actions/deploygate.rb +1 -2
- data/fastlane/lib/fastlane/actions/docs/build_app.md +1 -1
- data/fastlane/lib/fastlane/actions/docs/capture_android_screenshots.md +27 -28
- data/fastlane/lib/fastlane/actions/docs/capture_ios_screenshots.md +7 -3
- data/fastlane/lib/fastlane/actions/docs/create_app_online.md +171 -67
- data/fastlane/lib/fastlane/actions/docs/frame_screenshots.md +20 -3
- data/fastlane/lib/fastlane/actions/docs/sync_code_signing.md +9 -3
- data/fastlane/lib/fastlane/actions/docs/upload_to_app_store.md.erb +39 -16
- data/fastlane/lib/fastlane/actions/docs/upload_to_play_store.md +2 -1
- data/fastlane/lib/fastlane/actions/docs/upload_to_testflight.md +15 -5
- data/fastlane/lib/fastlane/actions/download_app_privacy_details_from_app_store.rb +142 -0
- data/fastlane/lib/fastlane/actions/download_dsyms.rb +8 -20
- data/fastlane/lib/fastlane/actions/dsym_zip.rb +1 -1
- data/fastlane/lib/fastlane/actions/ensure_env_vars.rb +2 -6
- data/fastlane/lib/fastlane/actions/ensure_git_branch.rb +0 -1
- data/fastlane/lib/fastlane/actions/ensure_git_status_clean.rb +3 -4
- data/fastlane/lib/fastlane/actions/ensure_no_debug_code.rb +3 -5
- data/fastlane/lib/fastlane/actions/ensure_xcode_version.rb +1 -2
- data/fastlane/lib/fastlane/actions/environment_variable.rb +13 -21
- data/fastlane/lib/fastlane/actions/erb.rb +2 -5
- data/fastlane/lib/fastlane/actions/get_build_number_repository.rb +1 -1
- data/fastlane/lib/fastlane/actions/get_certificates.rb +5 -1
- data/fastlane/lib/fastlane/actions/get_github_release.rb +11 -1
- data/fastlane/lib/fastlane/actions/get_ipa_info_plist_value.rb +0 -1
- data/fastlane/lib/fastlane/actions/get_managed_play_store_publishing_rights.rb +32 -35
- data/fastlane/lib/fastlane/actions/get_provisioning_profile.rb +9 -1
- data/fastlane/lib/fastlane/actions/get_push_certificate.rb +1 -1
- data/fastlane/lib/fastlane/actions/get_version_number.rb +17 -10
- data/fastlane/lib/fastlane/actions/git_add.rb +5 -10
- data/fastlane/lib/fastlane/actions/git_branch.rb +4 -10
- data/fastlane/lib/fastlane/actions/git_commit.rb +12 -10
- data/fastlane/lib/fastlane/actions/git_pull.rb +4 -10
- data/fastlane/lib/fastlane/actions/git_remote_branch.rb +57 -0
- data/fastlane/lib/fastlane/actions/git_submodule_update.rb +16 -8
- data/fastlane/lib/fastlane/actions/git_tag_exists.rb +4 -0
- data/fastlane/lib/fastlane/actions/github_api.rb +17 -8
- data/fastlane/lib/fastlane/actions/gradle.rb +12 -20
- data/fastlane/lib/fastlane/actions/hg_commit_version_bump.rb +1 -1
- data/fastlane/lib/fastlane/actions/hg_push.rb +1 -1
- data/fastlane/lib/fastlane/actions/hipchat.rb +6 -6
- data/fastlane/lib/fastlane/actions/hockey.rb +5 -12
- data/fastlane/lib/fastlane/actions/ifttt.rb +3 -6
- data/fastlane/lib/fastlane/actions/import_from_git.rb +7 -9
- data/fastlane/lib/fastlane/actions/increment_build_number.rb +8 -2
- data/fastlane/lib/fastlane/actions/install_on_device.rb +3 -6
- data/fastlane/lib/fastlane/actions/install_provisioning_profile.rb +4 -0
- data/fastlane/lib/fastlane/actions/installr.rb +22 -25
- data/fastlane/lib/fastlane/actions/ipa.rb +2 -2
- data/fastlane/lib/fastlane/actions/jazzy.rb +11 -8
- data/fastlane/lib/fastlane/actions/jira.rb +61 -14
- data/fastlane/lib/fastlane/actions/latest_testflight_build_number.rb +6 -6
- data/fastlane/lib/fastlane/actions/lcov.rb +0 -4
- data/fastlane/lib/fastlane/actions/mailgun.rb +21 -27
- data/fastlane/lib/fastlane/actions/make_changelog_from_jenkins.rb +1 -1
- data/fastlane/lib/fastlane/actions/match_nuke.rb +59 -0
- data/fastlane/lib/fastlane/actions/modify_services.rb +59 -24
- data/fastlane/lib/fastlane/actions/nexus_upload.rb +3 -2
- data/fastlane/lib/fastlane/actions/notarize.rb +98 -54
- data/fastlane/lib/fastlane/actions/notification.rb +1 -1
- data/fastlane/lib/fastlane/actions/number_of_commits.rb +1 -1
- data/fastlane/lib/fastlane/actions/oclint.rb +15 -14
- data/fastlane/lib/fastlane/actions/onesignal.rb +13 -3
- data/fastlane/lib/fastlane/actions/pod_push.rb +9 -2
- data/fastlane/lib/fastlane/actions/podio_item.rb +0 -7
- data/fastlane/lib/fastlane/actions/prompt.rb +3 -4
- data/fastlane/lib/fastlane/actions/push_git_tags.rb +1 -1
- data/fastlane/lib/fastlane/actions/push_to_git_remote.rb +14 -3
- data/fastlane/lib/fastlane/actions/puts.rb +1 -2
- data/fastlane/lib/fastlane/actions/register_device.rb +10 -13
- data/fastlane/lib/fastlane/actions/register_devices.rb +11 -14
- data/fastlane/lib/fastlane/actions/reset_git_repo.rb +5 -8
- data/fastlane/lib/fastlane/actions/reset_simulator_contents.rb +0 -2
- data/fastlane/lib/fastlane/actions/resign.rb +2 -9
- data/fastlane/lib/fastlane/actions/restore_file.rb +1 -1
- data/fastlane/lib/fastlane/actions/rsync.rb +3 -6
- data/fastlane/lib/fastlane/actions/run_tests.rb +1 -1
- data/fastlane/lib/fastlane/actions/s3.rb +1 -1
- data/fastlane/lib/fastlane/actions/say.rb +2 -3
- data/fastlane/lib/fastlane/actions/scp.rb +4 -10
- data/fastlane/lib/fastlane/actions/set_build_number_repository.rb +1 -1
- data/fastlane/lib/fastlane/actions/set_changelog.rb +10 -13
- data/fastlane/lib/fastlane/actions/set_github_release.rb +23 -16
- data/fastlane/lib/fastlane/actions/set_info_plist_value.rb +1 -1
- data/fastlane/lib/fastlane/actions/set_pod_key.rb +3 -4
- data/fastlane/lib/fastlane/actions/setup_ci.rb +1 -2
- data/fastlane/lib/fastlane/actions/setup_circle_ci.rb +1 -1
- data/fastlane/lib/fastlane/actions/setup_jenkins.rb +7 -12
- data/fastlane/lib/fastlane/actions/setup_travis.rb +1 -1
- data/fastlane/lib/fastlane/actions/sh.rb +2 -4
- data/fastlane/lib/fastlane/actions/slack.rb +164 -145
- data/fastlane/lib/fastlane/actions/slather.rb +5 -21
- data/fastlane/lib/fastlane/actions/sonar.rb +12 -19
- data/fastlane/lib/fastlane/actions/sourcedocs.rb +128 -0
- data/fastlane/lib/fastlane/actions/spaceship_logs.rb +1 -1
- data/fastlane/lib/fastlane/actions/splunkmint.rb +2 -2
- data/fastlane/lib/fastlane/actions/spm.rb +8 -2
- data/fastlane/lib/fastlane/actions/ssh.rb +5 -10
- data/fastlane/lib/fastlane/actions/swiftlint.rb +21 -19
- data/fastlane/lib/fastlane/actions/sync_code_signing.rb +6 -1
- data/fastlane/lib/fastlane/actions/testfairy.rb +0 -1
- data/fastlane/lib/fastlane/actions/tryouts.rb +2 -3
- data/fastlane/lib/fastlane/actions/twitter.rb +0 -5
- data/fastlane/lib/fastlane/actions/unlock_keychain.rb +3 -3
- data/fastlane/lib/fastlane/actions/update_app_group_identifiers.rb +1 -4
- data/fastlane/lib/fastlane/actions/update_code_signing_settings.rb +8 -15
- data/fastlane/lib/fastlane/actions/update_fastlane.rb +31 -10
- data/fastlane/lib/fastlane/actions/update_icloud_container_identifiers.rb +1 -4
- data/fastlane/lib/fastlane/actions/update_info_plist.rb +1 -1
- data/fastlane/lib/fastlane/actions/update_keychain_access_groups.rb +1 -4
- data/fastlane/lib/fastlane/actions/update_plist.rb +1 -1
- data/fastlane/lib/fastlane/actions/update_project_provisioning.rb +3 -4
- data/fastlane/lib/fastlane/actions/update_urban_airship_configuration.rb +0 -1
- data/fastlane/lib/fastlane/actions/update_url_schemes.rb +15 -26
- data/fastlane/lib/fastlane/actions/upload_app_privacy_details_to_app_store.rb +290 -0
- data/fastlane/lib/fastlane/actions/upload_symbols_to_crashlytics.rb +8 -7
- data/fastlane/lib/fastlane/actions/upload_symbols_to_sentry.rb +3 -10
- data/fastlane/lib/fastlane/actions/upload_to_app_store.rb +8 -4
- data/fastlane/lib/fastlane/actions/upload_to_testflight.rb +7 -2
- data/fastlane/lib/fastlane/actions/validate_play_store_json_key.rb +40 -44
- data/fastlane/lib/fastlane/actions/version_get_podspec.rb +1 -2
- data/fastlane/lib/fastlane/actions/xcode_install.rb +8 -5
- data/fastlane/lib/fastlane/actions/xcode_server_get_assets.rb +3 -3
- data/fastlane/lib/fastlane/actions/xcodebuild.rb +5 -5
- data/fastlane/lib/fastlane/cli_tools_distributor.rb +6 -3
- data/fastlane/lib/fastlane/commands_generator.rb +2 -1
- data/fastlane/lib/fastlane/documentation/actions_list.rb +2 -2
- data/fastlane/lib/fastlane/documentation/docs_generator.rb +1 -1
- data/fastlane/lib/fastlane/documentation/markdown_docs_generator.rb +1 -1
- data/fastlane/lib/fastlane/environment_printer.rb +1 -0
- data/fastlane/lib/fastlane/erb_template_helper.rb +7 -1
- data/fastlane/lib/fastlane/fast_file.rb +19 -7
- data/fastlane/lib/fastlane/fastlane_require.rb +7 -1
- data/fastlane/lib/fastlane/features.rb +1 -1
- data/fastlane/lib/fastlane/helper/adb_helper.rb +1 -1
- data/fastlane/lib/fastlane/helper/crashlytics_helper.rb +4 -4
- data/fastlane/lib/fastlane/helper/gem_helper.rb +2 -2
- data/fastlane/lib/fastlane/helper/git_helper.rb +34 -5
- data/fastlane/lib/fastlane/lane_manager.rb +3 -2
- data/fastlane/lib/fastlane/notification/slack.rb +56 -0
- data/fastlane/lib/fastlane/plugins/plugin_fetcher.rb +1 -2
- data/fastlane/lib/fastlane/plugins/plugin_info.rb +2 -2
- data/fastlane/lib/fastlane/plugins/plugin_info_collector.rb +1 -2
- data/fastlane/lib/fastlane/plugins/plugin_manager.rb +2 -3
- data/fastlane/lib/fastlane/plugins/template/%gem_name%.gemspec.erb +7 -6
- data/fastlane/lib/fastlane/plugins/template/.circleci/config.yml +1 -1
- data/fastlane/lib/fastlane/plugins/template/.github/workflows/test.yml +1 -1
- data/fastlane/lib/fastlane/plugins/template/.rubocop.yml +31 -35
- data/fastlane/lib/fastlane/plugins/template/spec/spec_helper.rb.erb +1 -1
- data/fastlane/lib/fastlane/setup/setup.rb +23 -10
- data/fastlane/lib/fastlane/setup/setup_ios.rb +3 -3
- data/fastlane/lib/fastlane/swift_fastlane_api_generator.rb +3 -0
- data/fastlane/lib/fastlane/swift_fastlane_function.rb +44 -16
- data/fastlane/lib/fastlane/swift_runner_upgrader.rb +2 -0
- data/fastlane/lib/fastlane/version.rb +2 -2
- data/fastlane/swift/Actions.swift +1 -1
- data/fastlane/swift/Appfile.swift +1 -1
- data/fastlane/swift/ArgumentProcessor.swift +1 -1
- data/fastlane/swift/ControlCommand.swift +1 -1
- data/fastlane/swift/Deliverfile.swift +2 -2
- data/fastlane/swift/DeliverfileProtocol.swift +23 -23
- data/fastlane/swift/Fastfile.swift +1 -1
- data/fastlane/swift/Fastlane.swift +7965 -4213
- data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/project.pbxproj +4 -0
- data/fastlane/swift/Gymfile.swift +2 -2
- data/fastlane/swift/GymfileProtocol.swift +15 -3
- data/fastlane/swift/LaneFileProtocol.swift +12 -6
- data/fastlane/swift/MainProcess.swift +3 -1
- data/fastlane/swift/Matchfile.swift +2 -2
- data/fastlane/swift/MatchfileProtocol.swift +4 -4
- data/fastlane/swift/OptionalConfigValue.swift +101 -0
- data/fastlane/swift/Plugins.swift +1 -1
- data/fastlane/swift/Precheckfile.swift +2 -2
- data/fastlane/swift/PrecheckfileProtocol.swift +8 -4
- data/fastlane/swift/RubyCommand.swift +2 -2
- data/fastlane/swift/RubyCommandable.swift +1 -1
- data/fastlane/swift/Runner.swift +3 -3
- data/fastlane/swift/RunnerArgument.swift +1 -1
- data/fastlane/swift/Scanfile.swift +2 -2
- data/fastlane/swift/ScanfileProtocol.swift +34 -2
- data/fastlane/swift/Screengrabfile.swift +2 -2
- data/fastlane/swift/ScreengrabfileProtocol.swift +5 -5
- data/fastlane/swift/Snapshotfile.swift +2 -2
- data/fastlane/swift/SnapshotfileProtocol.swift +19 -3
- data/fastlane/swift/SocketClient.swift +4 -3
- data/fastlane/swift/SocketClientDelegateProtocol.swift +1 -1
- data/fastlane/swift/SocketResponse.swift +5 -3
- data/fastlane/swift/formatting/Brewfile.lock.json +24 -16
- data/fastlane/swift/main.swift +1 -1
- data/fastlane/swift/upgrade_manifest.json +1 -1
- data/fastlane_core/lib/fastlane_core.rb +22 -20
- data/fastlane_core/lib/fastlane_core/build_watcher.rb +89 -12
- data/fastlane_core/lib/fastlane_core/cert_checker.rb +12 -7
- data/fastlane_core/lib/fastlane_core/clipboard.rb +20 -0
- data/fastlane_core/lib/fastlane_core/command_executor.rb +3 -9
- data/fastlane_core/lib/fastlane_core/configuration/commander_generator.rb +6 -1
- data/fastlane_core/lib/fastlane_core/configuration/config_item.rb +41 -3
- data/fastlane_core/lib/fastlane_core/configuration/configuration.rb +14 -8
- data/fastlane_core/lib/fastlane_core/device_manager.rb +1 -1
- data/fastlane_core/lib/fastlane_core/helper.rb +78 -14
- data/fastlane_core/lib/fastlane_core/ipa_file_analyser.rb +41 -16
- data/fastlane_core/lib/fastlane_core/ipa_upload_package_builder.rb +3 -2
- data/fastlane_core/lib/fastlane_core/itunes_transporter.rb +20 -15
- data/fastlane_core/lib/fastlane_core/keychain_importer.rb +1 -1
- data/fastlane_core/lib/fastlane_core/languages.rb +2 -2
- data/fastlane_core/lib/fastlane_core/pkg_upload_package_builder.rb +3 -2
- data/fastlane_core/lib/fastlane_core/print_table.rb +5 -3
- data/fastlane_core/lib/fastlane_core/project.rb +48 -28
- data/fastlane_core/lib/fastlane_core/provisioning_profile.rb +3 -1
- data/{deliver/lib/deliver → fastlane_core/lib/fastlane_core}/queue_worker.rb +4 -4
- data/fastlane_core/lib/fastlane_core/swag.rb +1 -1
- data/fastlane_core/lib/fastlane_core/ui/disable_colors.rb +8 -0
- data/fastlane_core/lib/fastlane_core/ui/help.erb +35 -0
- data/fastlane_core/lib/fastlane_core/ui/help_formatter.rb +16 -0
- data/fastlane_core/lib/fastlane_core/ui/implementations/shell.rb +16 -2
- data/fastlane_core/lib/fastlane_core/ui/interface.rb +1 -1
- data/fastlane_core/lib/fastlane_core/update_checker/update_checker.rb +2 -2
- data/frameit/lib/frameit/commands_generator.rb +2 -1
- data/frameit/lib/frameit/config_parser.rb +2 -2
- data/frameit/lib/frameit/device_types.rb +7 -1
- data/frameit/lib/frameit/frame_downloader.rb +2 -1
- data/gym/lib/gym/code_signing_mapping.rb +3 -3
- data/gym/lib/gym/commands_generator.rb +2 -1
- data/gym/lib/gym/error_handler.rb +8 -0
- data/gym/lib/gym/generators/build_command_generator.rb +3 -0
- data/gym/lib/gym/generators/package_command_generator.rb +4 -0
- data/gym/lib/gym/generators/package_command_generator_xcode7.rb +21 -15
- data/gym/lib/gym/options.rb +19 -3
- data/gym/lib/gym/runner.rb +15 -4
- data/match/lib/match/change_password.rb +3 -3
- data/match/lib/match/commands_generator.rb +2 -1
- data/match/lib/match/encryption/interface.rb +1 -1
- data/match/lib/match/encryption/openssl.rb +5 -3
- data/match/lib/match/importer.rb +9 -10
- data/match/lib/match/migrate.rb +2 -3
- data/match/lib/match/module.rb +2 -1
- data/match/lib/match/nuke.rb +19 -15
- data/match/lib/match/options.rb +4 -3
- data/match/lib/match/runner.rb +3 -4
- data/match/lib/match/spaceship_ensure.rb +3 -0
- data/match/lib/match/storage/git_storage.rb +14 -10
- data/match/lib/match/storage/google_cloud_storage.rb +2 -2
- data/match/lib/match/storage/s3_storage.rb +2 -2
- data/pem/lib/pem/commands_generator.rb +2 -1
- data/pilot/lib/pilot.rb +0 -1
- data/pilot/lib/pilot/build_manager.rb +41 -15
- data/pilot/lib/pilot/commands_generator.rb +2 -1
- data/pilot/lib/pilot/manager.rb +11 -8
- data/pilot/lib/pilot/options.rb +18 -9
- data/pilot/lib/pilot/tester_exporter.rb +0 -1
- data/pilot/lib/pilot/tester_manager.rb +0 -1
- data/precheck/lib/precheck/commands_generator.rb +2 -1
- data/precheck/lib/precheck/options.rb +9 -3
- data/precheck/lib/precheck/rule_processor.rb +1 -1
- data/precheck/lib/precheck/runner.rb +14 -9
- data/produce/lib/produce/commands_generator.rb +101 -28
- data/produce/lib/produce/developer_center.rb +42 -4
- data/produce/lib/produce/options.rb +1 -1
- data/produce/lib/produce/service.rb +270 -179
- data/scan/lib/scan/commands_generator.rb +2 -1
- data/scan/lib/scan/detect_values.rb +7 -2
- data/scan/lib/scan/module.rb +4 -0
- data/scan/lib/scan/options.rb +46 -1
- data/scan/lib/scan/runner.rb +88 -3
- data/scan/lib/scan/slack_poster.rb +4 -1
- data/scan/lib/scan/test_command_generator.rb +13 -8
- data/screengrab/lib/screengrab/android_environment.rb +5 -53
- data/screengrab/lib/screengrab/commands_generator.rb +2 -1
- data/screengrab/lib/screengrab/dependency_checker.rb +0 -20
- data/screengrab/lib/screengrab/options.rb +5 -2
- data/screengrab/lib/screengrab/runner.rb +111 -108
- data/sigh/lib/assets/resign.sh +81 -61
- data/sigh/lib/sigh/commands_generator.rb +2 -1
- data/sigh/lib/sigh/download_all.rb +4 -8
- data/sigh/lib/sigh/options.rb +3 -2
- data/sigh/lib/sigh/runner.rb +9 -9
- data/snapshot/lib/assets/SnapfileTemplate +3 -2
- data/snapshot/lib/assets/SnapfileTemplate.swift +2 -1
- data/snapshot/lib/assets/SnapshotHelper.swift +20 -12
- data/snapshot/lib/snapshot/commands_generator.rb +3 -1
- data/snapshot/lib/snapshot/options.rb +22 -2
- data/snapshot/lib/snapshot/reports_generator.rb +7 -1
- data/snapshot/lib/snapshot/simulator_launchers/launcher_configuration.rb +2 -0
- data/snapshot/lib/snapshot/simulator_launchers/simulator_launcher.rb +1 -1
- data/snapshot/lib/snapshot/simulator_launchers/simulator_launcher_base.rb +10 -5
- data/snapshot/lib/snapshot/test_command_generator.rb +18 -4
- data/snapshot/lib/snapshot/test_command_generator_base.rb +3 -1
- data/snapshot/lib/snapshot/test_command_generator_xcode_8.rb +1 -1
- data/snapshot/lib/snapshot/update.rb +1 -1
- data/spaceship/README.md +4 -14
- data/spaceship/lib/spaceship/base.rb +2 -2
- data/spaceship/lib/spaceship/client.rb +47 -29
- data/spaceship/lib/spaceship/commands_generator.rb +4 -2
- data/spaceship/lib/spaceship/connect_api.rb +6 -0
- data/spaceship/lib/spaceship/connect_api/api_client.rb +67 -9
- data/spaceship/lib/spaceship/connect_api/model.rb +1 -1
- data/spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb +39 -6
- data/spaceship/lib/spaceship/connect_api/models/app.rb +95 -55
- data/spaceship/lib/spaceship/connect_api/models/app_data_usage.rb +59 -0
- data/spaceship/lib/spaceship/connect_api/models/app_data_usage_category.rb +65 -0
- data/spaceship/lib/spaceship/connect_api/models/app_data_usage_data_protection.rb +27 -0
- data/spaceship/lib/spaceship/connect_api/models/app_data_usage_grouping.rb +18 -0
- data/spaceship/lib/spaceship/connect_api/models/app_data_usage_purposes.rb +37 -0
- data/spaceship/lib/spaceship/connect_api/models/app_data_usages_publish_state.rb +36 -0
- data/spaceship/lib/spaceship/connect_api/models/app_info.rb +26 -10
- data/spaceship/lib/spaceship/connect_api/models/app_info_localization.rb +8 -4
- data/spaceship/lib/spaceship/connect_api/models/app_preview.rb +15 -11
- data/spaceship/lib/spaceship/connect_api/models/app_preview_set.rb +18 -9
- data/spaceship/lib/spaceship/connect_api/models/app_screenshot.rb +10 -8
- data/spaceship/lib/spaceship/connect_api/models/app_screenshot_set.rb +20 -11
- data/spaceship/lib/spaceship/connect_api/models/app_store_review_attachment.rb +7 -5
- data/spaceship/lib/spaceship/connect_api/models/app_store_review_detail.rb +6 -4
- data/spaceship/lib/spaceship/connect_api/models/app_store_version.rb +62 -38
- data/spaceship/lib/spaceship/connect_api/models/app_store_version_localization.rb +27 -14
- data/spaceship/lib/spaceship/connect_api/models/app_store_version_submission.rb +3 -2
- data/spaceship/lib/spaceship/connect_api/models/beta_app_review_submission.rb +3 -2
- data/spaceship/lib/spaceship/connect_api/models/beta_feedback.rb +6 -4
- data/spaceship/lib/spaceship/connect_api/models/beta_group.rb +29 -3
- data/spaceship/lib/spaceship/connect_api/models/beta_tester.rb +15 -9
- data/spaceship/lib/spaceship/connect_api/models/build.rb +34 -17
- data/spaceship/lib/spaceship/connect_api/models/build_beta_detail.rb +4 -0
- data/spaceship/lib/spaceship/connect_api/models/build_delivery.rb +3 -2
- data/spaceship/lib/spaceship/connect_api/models/bundle_id.rb +41 -6
- data/spaceship/lib/spaceship/connect_api/models/bundle_id_capability.rb +86 -21
- data/spaceship/lib/spaceship/connect_api/models/certificate.rb +12 -8
- data/spaceship/lib/spaceship/connect_api/models/device.rb +36 -4
- data/spaceship/lib/spaceship/connect_api/models/idfa_declaration.rb +6 -4
- data/spaceship/lib/spaceship/connect_api/models/profile.rb +18 -8
- data/spaceship/lib/spaceship/connect_api/models/reset_ratings_request.rb +3 -2
- data/spaceship/lib/spaceship/connect_api/models/sandbox_tester.rb +9 -6
- data/spaceship/lib/spaceship/connect_api/models/territory.rb +3 -2
- data/spaceship/lib/spaceship/connect_api/models/user.rb +6 -4
- data/spaceship/lib/spaceship/connect_api/models/user_invitation.rb +22 -6
- data/spaceship/lib/spaceship/connect_api/provisioning/provisioning.rb +99 -2
- data/spaceship/lib/spaceship/connect_api/response.rb +3 -1
- data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +50 -0
- data/spaceship/lib/spaceship/connect_api/token.rb +15 -3
- data/spaceship/lib/spaceship/connect_api/tunes/tunes.rb +122 -2
- data/spaceship/lib/spaceship/errors.rb +19 -0
- data/spaceship/lib/spaceship/playground.rb +2 -2
- data/spaceship/lib/spaceship/spaceauth_runner.rb +38 -15
- data/spaceship/lib/spaceship/tunes/iap_detail.rb +1 -1
- data/spaceship/lib/spaceship/tunes/members.rb +1 -1
- data/spaceship/lib/spaceship/tunes/tunes_client.rb +4 -4
- data/spaceship/lib/spaceship/two_step_or_factor_client.rb +59 -33
- data/spaceship/lib/spaceship/ui.rb +2 -2
- data/spaceship/lib/spaceship/upgrade_2fa_later_client.rb +91 -0
- data/supply/lib/supply.rb +1 -1
- data/supply/lib/supply/client.rb +5 -3
- data/supply/lib/supply/commands_generator.rb +2 -1
- data/supply/lib/supply/options.rb +3 -3
- data/supply/lib/supply/uploader.rb +6 -4
- metadata +125 -93
- data/pilot/lib/pilot/features.rb +0 -0
- data/pilot/lib/pilot/tester_util.rb +0 -0
@@ -82,15 +82,12 @@ module Deliver
|
|
82
82
|
# @param path (String) path to the screenshot file
|
83
83
|
# @param language (String) Language of this screenshot (e.g. English)
|
84
84
|
# @param screen_size (Deliver::AppScreenshot::ScreenSize) the screen size, which
|
85
|
-
# will automatically be calculated when you don't set it.
|
85
|
+
# will automatically be calculated when you don't set it. (Deprecated)
|
86
86
|
def initialize(path, language, screen_size = nil)
|
87
|
+
UI.deprecated('`screen_size` for Deliver::AppScreenshot.new is deprecated in favor of the default behavior to calculate size automatically. Passed value is no longer validated.') if screen_size
|
87
88
|
self.path = path
|
88
89
|
self.language = language
|
89
|
-
screen_size
|
90
|
-
|
91
|
-
self.screen_size = screen_size
|
92
|
-
|
93
|
-
UI.error("Looks like the screenshot given (#{path}) does not match the requirements of #{screen_size}") unless self.is_valid?
|
90
|
+
self.screen_size = screen_size || self.class.calculate_screen_size(path)
|
94
91
|
end
|
95
92
|
|
96
93
|
# The iTC API requires a different notation for the device
|
@@ -161,6 +158,7 @@ module Deliver
|
|
161
158
|
|
162
159
|
# Validates the given screenshots (size and format)
|
163
160
|
def is_valid?
|
161
|
+
UI.deprecated('Deliver::AppScreenshot#is_valid? is deprecated in favor of Deliver::AppScreenshotValidator')
|
164
162
|
return false unless ["png", "PNG", "jpg", "JPG", "jpeg", "JPEG"].include?(self.path.split(".").last)
|
165
163
|
|
166
164
|
return self.screen_size == self.class.calculate_screen_size(self.path)
|
@@ -187,7 +185,9 @@ module Deliver
|
|
187
185
|
return {
|
188
186
|
ScreenSize::IOS_65_MESSAGES => [
|
189
187
|
[1242, 2688],
|
190
|
-
[2688, 1242]
|
188
|
+
[2688, 1242],
|
189
|
+
[1284, 2778],
|
190
|
+
[2778, 1284]
|
191
191
|
],
|
192
192
|
ScreenSize::IOS_61_MESSAGES => [
|
193
193
|
[828, 1792],
|
@@ -195,7 +195,9 @@ module Deliver
|
|
195
195
|
],
|
196
196
|
ScreenSize::IOS_58_MESSAGES => [
|
197
197
|
[1125, 2436],
|
198
|
-
[2436, 1125]
|
198
|
+
[2436, 1125],
|
199
|
+
[1170, 2532],
|
200
|
+
[2532, 1170]
|
199
201
|
],
|
200
202
|
ScreenSize::IOS_55_MESSAGES => [
|
201
203
|
[1242, 2208],
|
@@ -243,7 +245,9 @@ module Deliver
|
|
243
245
|
return {
|
244
246
|
ScreenSize::IOS_65 => [
|
245
247
|
[1242, 2688],
|
246
|
-
[2688, 1242]
|
248
|
+
[2688, 1242],
|
249
|
+
[1284, 2778],
|
250
|
+
[2778, 1284]
|
247
251
|
],
|
248
252
|
ScreenSize::IOS_61 => [
|
249
253
|
[828, 1792],
|
@@ -251,7 +255,9 @@ module Deliver
|
|
251
255
|
],
|
252
256
|
ScreenSize::IOS_58 => [
|
253
257
|
[1125, 2436],
|
254
|
-
[2436, 1125]
|
258
|
+
[2436, 1125],
|
259
|
+
[1170, 2532],
|
260
|
+
[2532, 1170]
|
255
261
|
],
|
256
262
|
ScreenSize::IOS_55 => [
|
257
263
|
[1242, 2208],
|
@@ -346,7 +352,7 @@ module Deliver
|
|
346
352
|
end
|
347
353
|
end
|
348
354
|
|
349
|
-
|
355
|
+
nil
|
350
356
|
end
|
351
357
|
end
|
352
358
|
|
@@ -0,0 +1,108 @@
|
|
1
|
+
require 'fastimage'
|
2
|
+
|
3
|
+
module Deliver
|
4
|
+
class AppScreenshotValidator
|
5
|
+
# A simple structure that holds error information as well as formatted error messages consistently
|
6
|
+
# Set `to_skip` to `true` when just needing to skip uploading rather than causing a crash.
|
7
|
+
class ValidationError
|
8
|
+
# Constants that can be given to `type` param
|
9
|
+
INVALID_SCREEN_SIZE = 'Invalid screen size'.freeze
|
10
|
+
UNACCEPTABLE_DEVICE = 'Not an accepted App Store Connect device'.freeze
|
11
|
+
INVALID_FILE_EXTENSION = 'Invalid file extension'.freeze
|
12
|
+
FILE_EXTENSION_MISMATCH = 'File extension mismatches its image format'.freeze
|
13
|
+
|
14
|
+
attr_reader :type, :path, :debug_info, :to_skip
|
15
|
+
|
16
|
+
def initialize(type: nil, path: nil, debug_info: nil, to_skip: false)
|
17
|
+
@type = type
|
18
|
+
@path = path
|
19
|
+
@debug_info = debug_info
|
20
|
+
@to_skip = to_skip
|
21
|
+
end
|
22
|
+
|
23
|
+
def to_s
|
24
|
+
"#{to_skip ? '🏃 Skipping' : '🚫 Error'}: #{path} - #{type} (#{debug_info})"
|
25
|
+
end
|
26
|
+
|
27
|
+
def inspect
|
28
|
+
"\"#{type}\""
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
# Access each array by symbol returned from FastImage.type
|
33
|
+
ALLOWED_SCREENSHOT_FILE_EXTENSION = { png: ['png', 'PNG'], jpeg: ['jpg', 'JPG', 'jpeg', 'JPEG'] }.freeze
|
34
|
+
|
35
|
+
APP_SCREENSHOT_SPEC_URL = 'https://help.apple.com/app-store-connect/#/devd274dd925'.freeze
|
36
|
+
|
37
|
+
# Validate a screenshot and inform an error message via `errors` parameter. `errors` is mutated
|
38
|
+
# to append the messages and each message should contain the corresponding path to let users know which file is throwing the error.
|
39
|
+
#
|
40
|
+
# @param screenshot [AppScreenshot]
|
41
|
+
# @param errors [Array<Deliver::AppScreenshotValidator::ValidationError>] Pass an array object to add validation errors when detecting errors.
|
42
|
+
# This will be mutated to add more error objects as validation detects errors.
|
43
|
+
# @return [Boolean] true if given screenshot is valid
|
44
|
+
def self.validate(screenshot, errors)
|
45
|
+
# Given screenshot will be diagnosed and errors found are accumulated
|
46
|
+
errors_found = []
|
47
|
+
|
48
|
+
validate_screen_size(screenshot, errors_found)
|
49
|
+
validate_device_type(screenshot, errors_found)
|
50
|
+
validate_file_extension_and_format(screenshot, errors_found)
|
51
|
+
|
52
|
+
# Merge errors found into given errors array
|
53
|
+
errors_found.each { |error| errors.push(error) }
|
54
|
+
errors_found.empty?
|
55
|
+
end
|
56
|
+
|
57
|
+
def self.validate_screen_size(screenshot, errors_found)
|
58
|
+
if screenshot.screen_size.nil?
|
59
|
+
errors_found << ValidationError.new(type: ValidationError::INVALID_SCREEN_SIZE,
|
60
|
+
path: screenshot.path,
|
61
|
+
debug_info: "Actual size is #{get_formatted_size(screenshot)}. See the specifications to fix #{APP_SCREENSHOT_SPEC_URL}")
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
# Checking if the device type exists in spaceship
|
66
|
+
# Ex: iPhone 6.1 inch isn't supported in App Store Connect but need
|
67
|
+
# to have it in there for frameit support
|
68
|
+
def self.validate_device_type(screenshot, errors_found)
|
69
|
+
if !screenshot.screen_size.nil? && screenshot.device_type.nil?
|
70
|
+
errors_found << ValidationError.new(type: ValidationError::UNACCEPTABLE_DEVICE,
|
71
|
+
path: screenshot.path,
|
72
|
+
debug_info: "Screen size #{screenshot.screen_size} is not accepted. See the specifications to fix #{APP_SCREENSHOT_SPEC_URL}",
|
73
|
+
to_skip: true)
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
def self.validate_file_extension_and_format(screenshot, errors_found)
|
78
|
+
extension = File.extname(screenshot.path).delete('.')
|
79
|
+
valid_file_extensions = ALLOWED_SCREENSHOT_FILE_EXTENSION.values.flatten
|
80
|
+
is_valid_extension = valid_file_extensions.include?(extension)
|
81
|
+
|
82
|
+
unless is_valid_extension
|
83
|
+
errors_found << ValidationError.new(type: ValidationError::INVALID_FILE_EXTENSION,
|
84
|
+
path: screenshot.path,
|
85
|
+
debug_info: "Only #{valid_file_extensions.join(', ')} are allowed")
|
86
|
+
end
|
87
|
+
|
88
|
+
format = FastImage.type(screenshot.path)
|
89
|
+
is_extension_matched = ALLOWED_SCREENSHOT_FILE_EXTENSION[format] &&
|
90
|
+
ALLOWED_SCREENSHOT_FILE_EXTENSION[format].include?(extension)
|
91
|
+
|
92
|
+
# This error only appears when file extension is valid
|
93
|
+
if is_valid_extension && !is_extension_matched
|
94
|
+
expected_extension = ALLOWED_SCREENSHOT_FILE_EXTENSION[format].first
|
95
|
+
expected_filename = File.basename(screenshot.path, File.extname(screenshot.path)) + ".#{expected_extension}"
|
96
|
+
errors_found << ValidationError.new(type: ValidationError::FILE_EXTENSION_MISMATCH,
|
97
|
+
path: screenshot.path,
|
98
|
+
debug_info: %(Actual format is "#{format}". Rename the filename to "#{expected_filename}".))
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
def self.get_formatted_size(screenshot)
|
103
|
+
size = FastImage.size(screenshot.path)
|
104
|
+
return size.join('x') if size
|
105
|
+
nil
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'commander'
|
2
2
|
require 'fastlane/version'
|
3
|
+
require 'fastlane_core/ui/help_formatter'
|
3
4
|
|
4
5
|
require_relative 'download_screenshots'
|
5
6
|
require_relative 'options'
|
@@ -48,7 +49,7 @@ module Deliver
|
|
48
49
|
program :help, 'Author', 'Felix Krause <deliver@krausefx.com>'
|
49
50
|
program :help, 'Website', 'https://fastlane.tools'
|
50
51
|
program :help, 'Documentation', 'https://docs.fastlane.tools/actions/deliver/'
|
51
|
-
program :help_formatter,
|
52
|
+
program :help_formatter, FastlaneCore::HelpFormatter
|
52
53
|
|
53
54
|
global_option('--verbose') { FastlaneCore::Globals.verbose = true }
|
54
55
|
global_option('--env STRING[,STRING2]', String, 'Add environment(s) to use with `dotenv`')
|
@@ -167,7 +168,7 @@ module Deliver
|
|
167
168
|
return 0 unless res
|
168
169
|
|
169
170
|
require 'deliver/setup'
|
170
|
-
app =
|
171
|
+
app = Deliver.cache[:app]
|
171
172
|
platform = Spaceship::ConnectAPI::Platform.map(options[:platform])
|
172
173
|
v = app.get_latest_app_store_version(platform: platform)
|
173
174
|
if options[:app_version].to_s.length > 0
|
@@ -177,7 +178,7 @@ module Deliver
|
|
177
178
|
end
|
178
179
|
end
|
179
180
|
|
180
|
-
Deliver::Setup.new.generate_metadata_files(app, v, path)
|
181
|
+
Deliver::Setup.new.generate_metadata_files(app, v, path, options)
|
181
182
|
end
|
182
183
|
end
|
183
184
|
|
@@ -10,6 +10,8 @@ require_relative 'languages'
|
|
10
10
|
module Deliver
|
11
11
|
class DetectValues
|
12
12
|
def run!(options, skip_params = {})
|
13
|
+
Deliver.cache = {}
|
14
|
+
|
13
15
|
find_platform(options)
|
14
16
|
find_app_identifier(options)
|
15
17
|
find_app(options)
|
@@ -46,9 +48,9 @@ module Deliver
|
|
46
48
|
app = Spaceship::ConnectAPI::App.get(app_id: app_id)
|
47
49
|
end
|
48
50
|
|
49
|
-
|
50
|
-
|
51
|
-
|
51
|
+
Deliver.cache[:app] = app
|
52
|
+
|
53
|
+
unless app
|
52
54
|
UI.user_error!("Could not find app with app identifier '#{options[:app_identifier]}' in your App Store Connect account (#{options[:username]} - Team: #{Spaceship::Tunes.client.team_id})")
|
53
55
|
end
|
54
56
|
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
require_relative 'module'
|
2
2
|
require 'spaceship'
|
3
|
-
require 'open-uri'
|
4
3
|
|
5
4
|
module Deliver
|
6
5
|
class DownloadScreenshots
|
@@ -14,7 +13,7 @@ module Deliver
|
|
14
13
|
end
|
15
14
|
|
16
15
|
def self.download(options, folder_path)
|
17
|
-
app =
|
16
|
+
app = Deliver.cache[:app]
|
18
17
|
|
19
18
|
platform = Spaceship::ConnectAPI::Platform.map(options[:platform])
|
20
19
|
if options[:use_live_version]
|
@@ -68,7 +67,7 @@ module Deliver
|
|
68
67
|
end
|
69
68
|
|
70
69
|
path = File.join(containing_folder, file_name)
|
71
|
-
File.binwrite(path,
|
70
|
+
File.binwrite(path, FastlaneCore::Helper.open_uri(url).read)
|
72
71
|
end
|
73
72
|
end
|
74
73
|
end
|
@@ -50,12 +50,12 @@ module Deliver
|
|
50
50
|
@export_path = export_path
|
51
51
|
|
52
52
|
@app_name = (options[:name]['en-US'] || options[:name].values.first) if options[:name]
|
53
|
-
@app_name ||=
|
53
|
+
@app_name ||= Deliver.cache[:app].name
|
54
54
|
|
55
55
|
@languages = options[:description].keys if options[:description]
|
56
56
|
@languages ||= begin
|
57
57
|
platform = Spaceship::ConnectAPI::Platform.map(options[:platform])
|
58
|
-
version =
|
58
|
+
version = Deliver.cache[:app].get_edit_app_store_version(platform: platform)
|
59
59
|
|
60
60
|
version.get_app_store_version_localizations.collect(&:locale)
|
61
61
|
end
|
@@ -2,6 +2,6 @@ module Deliver
|
|
2
2
|
module Languages
|
3
3
|
# 2020-08-24 - Available locales are not available as an endpoint in App Store Connect
|
4
4
|
# Update with Spaceship::Tunes.client.available_languages.sort (as long as endpoint is avilable)
|
5
|
-
ALL_LANGUAGES = [
|
5
|
+
ALL_LANGUAGES = %w[ar-SA ca cs da de-DE el en-AU en-CA en-GB en-US es-ES es-MX fi fr-CA fr-FR he hi hr hu id it ja ko ms nl-NL no pl pt-BR pt-PT ro ru sk sv th tr uk vi zh-Hans zh-Hant]
|
6
6
|
end
|
7
7
|
end
|
@@ -1,7 +1,6 @@
|
|
1
|
-
require 'fastlane_core/languages'
|
2
|
-
require 'spaceship/tunes/tunes'
|
3
|
-
|
4
1
|
require_relative 'module'
|
2
|
+
require_relative 'app_screenshot'
|
3
|
+
require_relative 'app_screenshot_validator'
|
5
4
|
require_relative 'upload_metadata'
|
6
5
|
require_relative 'languages'
|
7
6
|
|
@@ -13,6 +12,7 @@ module Deliver
|
|
13
12
|
IMESSAGE_DIR_NAME = "iMessage".freeze
|
14
13
|
DEFAULT_DIR_NAME = "default".freeze
|
15
14
|
|
15
|
+
EXPANDABLE_DIR_NAMES = [APPLE_TV_DIR_NAME, IMESSAGE_DIR_NAME].freeze
|
16
16
|
SPECIAL_DIR_NAMES = [APPLE_TV_DIR_NAME, IMESSAGE_DIR_NAME, DEFAULT_DIR_NAME].freeze
|
17
17
|
|
18
18
|
# Some exception directories may exist from other actions that should not be iterated through
|
@@ -20,35 +20,137 @@ module Deliver
|
|
20
20
|
FRAMEIT_FONTS_DIR_NAME = "fonts".freeze
|
21
21
|
META_DIR_NAMES = UploadMetadata::ALL_META_SUB_DIRS.map(&:downcase)
|
22
22
|
|
23
|
-
EXCEPTION_DIRECTORIES =
|
23
|
+
EXCEPTION_DIRECTORIES = (META_DIR_NAMES << SUPPLY_DIR_NAME << FRAMEIT_FONTS_DIR_NAME).freeze
|
24
24
|
|
25
|
-
|
26
|
-
|
25
|
+
# A class that represents language folder under screenshots or metadata folder
|
26
|
+
class LanguageFolder
|
27
|
+
attr_reader :path
|
28
|
+
|
29
|
+
# @return [String] A normalized language name that corresponds to the directory's name
|
30
|
+
attr_reader :language
|
31
|
+
|
32
|
+
def self.available_languages
|
33
|
+
# 2020-08-24 - Available locales are not available as an endpoint in App Store Connect
|
34
|
+
# Update with Spaceship::Tunes.client.available_languages.sort (as long as endpoint is avilable)
|
35
|
+
Deliver::Languages::ALL_LANGUAGES
|
36
|
+
end
|
37
|
+
|
38
|
+
def self.allowed_directory_names_with_case
|
39
|
+
available_languages + SPECIAL_DIR_NAMES
|
40
|
+
end
|
41
|
+
|
42
|
+
# @param path [String] A directory path otherwise this initializer fails
|
43
|
+
# @param nested [Boolan] Whether given path is nested of another special directory.
|
44
|
+
# This affects `expandable?` to return `false` when this set to `true`.
|
45
|
+
def initialize(path, nested: false)
|
46
|
+
raise(ArgumentError, "Given path must be a directory path - #{path}") unless File.directory?(path)
|
47
|
+
@path = path
|
48
|
+
@language = self.class.available_languages.find { |lang| basename.casecmp?(lang) }
|
49
|
+
@nested = nested
|
50
|
+
end
|
27
51
|
|
28
|
-
|
29
|
-
|
30
|
-
|
52
|
+
def nested?
|
53
|
+
@nested
|
54
|
+
end
|
31
55
|
|
32
|
-
|
33
|
-
|
56
|
+
def valid?
|
57
|
+
self.class.allowed_directory_names_with_case.any? { |name| name.casecmp?(basename) }
|
58
|
+
end
|
34
59
|
|
35
|
-
|
36
|
-
|
37
|
-
end
|
60
|
+
def expandable?
|
61
|
+
!nested? && EXPANDABLE_DIR_NAMES.any? { |name| name.casecmp?(basename) }
|
62
|
+
end
|
38
63
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
64
|
+
def skip?
|
65
|
+
EXCEPTION_DIRECTORIES.map(&:downcase).include?(basename.downcase)
|
66
|
+
end
|
67
|
+
|
68
|
+
def file_paths(extensions = '{png,jpg,jpeg}')
|
69
|
+
Dir.glob(File.join(path, "*.#{extensions}"), File::FNM_CASEFOLD).sort
|
70
|
+
end
|
71
|
+
|
72
|
+
def framed_file_paths(extensions = '{png,jpg,jpeg}')
|
73
|
+
Dir.glob(File.join(path, "*_framed.#{extensions}"), File::FNM_CASEFOLD).sort
|
74
|
+
end
|
75
|
+
|
76
|
+
def basename
|
77
|
+
File.basename(@path)
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
# Returns the list of valid app screenshot. When detecting invalid screenshots, this will cause an error.
|
82
|
+
#
|
83
|
+
# @param root [String] A directory path
|
84
|
+
# @param ignore_validation [String] Set false not to raise the error when finding invalid folder name
|
85
|
+
# @return [Array<AppScreenshot>] The list of AppScreenshot that exist under given `root` directory
|
86
|
+
def self.load_app_screenshots(root, ignore_validation)
|
87
|
+
screenshots = language_folders(root, ignore_validation, true).flat_map do |language_folder|
|
88
|
+
paths = if language_folder.framed_file_paths.count > 0
|
89
|
+
UI.important("Framed screenshots are detected! 🖼 Non-framed screenshot files may be skipped. 🏃")
|
90
|
+
# watchOS screenshots can be picked up even when framed ones were found since frameit doesn't support watchOS screenshots
|
91
|
+
framed_or_watch, skipped = language_folder.file_paths.partition { |path| path.downcase.include?('framed') || path.downcase.include?('watch') }
|
92
|
+
skipped.each { |path| UI.important("🏃 Skipping screenshot file: #{path}") }
|
93
|
+
framed_or_watch
|
94
|
+
else
|
95
|
+
language_folder.file_paths
|
96
|
+
end
|
97
|
+
paths.map { |path| AppScreenshot.new(path, language_folder.language) }
|
98
|
+
end
|
99
|
+
|
100
|
+
errors = []
|
101
|
+
valid_screenshots = screenshots.select { |screenshot| Deliver::AppScreenshotValidator.validate(screenshot, errors) }
|
102
|
+
|
103
|
+
errors_to_skip, errors_to_crash = errors.partition(&:to_skip)
|
104
|
+
|
105
|
+
unless errors_to_skip.empty?
|
106
|
+
UI.important("🏃 Screenshots to be skipped are detected!")
|
107
|
+
errors_to_skip.each { |error| UI.message(error) }
|
108
|
+
end
|
109
|
+
|
110
|
+
unless errors_to_crash.empty?
|
111
|
+
UI.important("🚫 Invalid screenshots were detected! Here are the reasons:")
|
112
|
+
errors_to_crash.each { |error| UI.error(error) }
|
113
|
+
UI.user_error!("Canceled uploading screenshots. Please check the error messages above and fix the screenshots.")
|
114
|
+
end
|
115
|
+
|
116
|
+
valid_screenshots
|
117
|
+
end
|
118
|
+
|
119
|
+
# Returns the list of language folders
|
120
|
+
#
|
121
|
+
# @param roort [String] A directory path to get the list of language folders
|
122
|
+
# @param ignore_validation [Boolean] Set false not to raise the error when finding invalid folder name
|
123
|
+
# @param expand_sub_folders [Boolean] Set true to expand special folders; such as "iMessage" to nested language folders
|
124
|
+
# @return [Array<LanguageFolder>] The list of LanguageFolder whose each of them
|
125
|
+
def self.language_folders(root, ignore_validation, expand_sub_folders = false)
|
126
|
+
folders = Dir.glob(File.join(root, '*'))
|
127
|
+
.select { |path| File.directory?(path) }
|
128
|
+
.map { |path| LanguageFolder.new(path, nested: false) }
|
129
|
+
.reject(&:skip?)
|
130
|
+
|
131
|
+
selected_folders, rejected_folders = folders.partition(&:valid?)
|
44
132
|
|
45
133
|
if !ignore_validation && !rejected_folders.empty?
|
46
|
-
rejected_folders = rejected_folders.map
|
134
|
+
rejected_folders = rejected_folders.map(&:basename)
|
47
135
|
UI.user_error!("Unsupported directory name(s) for screenshots/metadata in '#{root}': #{rejected_folders.join(', ')}" \
|
48
|
-
"\nValid directory names are: #{allowed_directory_names_with_case}" \
|
136
|
+
"\nValid directory names are: #{LanguageFolder.allowed_directory_names_with_case}" \
|
49
137
|
"\n\nEnable 'ignore_language_directory_validation' to prevent this validation from happening")
|
50
138
|
end
|
51
139
|
|
140
|
+
# Expand selected_folders for the special directories
|
141
|
+
if expand_sub_folders
|
142
|
+
selected_folders = selected_folders.flat_map do |folder|
|
143
|
+
if folder.expandable?
|
144
|
+
Dir.glob(File.join(folder.path, '*'))
|
145
|
+
.select { |p| File.directory?(p) }
|
146
|
+
.map { |p| LanguageFolder.new(p, nested: true) }
|
147
|
+
.select(&:valid?)
|
148
|
+
else
|
149
|
+
folder
|
150
|
+
end
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
52
154
|
selected_folders
|
53
155
|
end
|
54
156
|
end
|