fastlane 2.173.0 → 2.194.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 +105 -85
- data/cert/lib/cert/commands_generator.rb +2 -1
- data/cert/lib/cert/options.rb +4 -3
- data/cert/lib/cert/runner.rb +7 -7
- data/deliver/lib/assets/summary.html.erb +10 -10
- data/deliver/lib/deliver/app_screenshot.rb +8 -3
- data/deliver/lib/deliver/app_screenshot_iterator.rb +2 -2
- data/deliver/lib/deliver/commands_generator.rb +3 -2
- 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 +1 -1
- data/deliver/lib/deliver/module.rb +6 -0
- data/deliver/lib/deliver/options.rb +48 -56
- data/deliver/lib/deliver/runner.rb +28 -15
- data/deliver/lib/deliver/screenshot_comparable.rb +62 -0
- data/deliver/lib/deliver/setup.rb +1 -2
- data/deliver/lib/deliver/submit_for_review.rb +4 -4
- data/deliver/lib/deliver/sync_screenshots.rb +200 -0
- data/deliver/lib/deliver/upload_metadata.rb +26 -11
- data/deliver/lib/deliver/upload_price_tier.rb +1 -1
- data/deliver/lib/deliver/upload_screenshots.rb +13 -12
- data/fastlane/lib/assets/completions/completion.bash +4 -1
- data/fastlane/lib/assets/completions/completion.zsh +6 -5
- data/{spaceship/lib/spaceship/connect_api/models/.app_store_version_submission.rb.swp → fastlane/lib/fastlane/actions/.notarize.rb.swp} +0 -0
- data/fastlane/lib/fastlane/actions/actions_helper.rb +2 -2
- 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 +4 -4
- data/fastlane/lib/fastlane/actions/app_store_build_number.rb +18 -18
- 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 +45 -45
- data/fastlane/lib/fastlane/actions/apteligent.rb +3 -2
- data/fastlane/lib/fastlane/actions/artifactory.rb +5 -6
- 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 +4 -0
- data/fastlane/lib/fastlane/actions/bundle_install.rb +21 -11
- 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 +25 -2
- 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 +0 -9
- data/fastlane/lib/fastlane/actions/create_xcframework.rb +102 -17
- 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 +29 -30
- data/fastlane/lib/fastlane/actions/docs/capture_ios_screenshots.md +3 -3
- data/fastlane/lib/fastlane/actions/docs/create_app_online.md +171 -67
- data/fastlane/lib/fastlane/actions/docs/frame_screenshots.md +19 -2
- data/fastlane/lib/fastlane/actions/docs/sync_code_signing.md +8 -2
- data/fastlane/lib/fastlane/actions/docs/upload_to_app_store.md.erb +37 -18
- data/fastlane/lib/fastlane/actions/docs/upload_to_play_store.md +2 -1
- data/fastlane/lib/fastlane/actions/docs/upload_to_testflight.md +10 -4
- data/fastlane/lib/fastlane/actions/download_app_privacy_details_from_app_store.rb +1 -1
- data/fastlane/lib/fastlane/actions/download_dsyms.rb +8 -19
- 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 +10 -2
- 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 +6 -8
- 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 +4 -6
- data/fastlane/lib/fastlane/actions/gradle.rb +13 -21
- 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 +7 -7
- 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 +2 -2
- data/fastlane/lib/fastlane/actions/notarize.rb +181 -52
- 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/pod_push.rb +0 -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 +2 -2
- data/fastlane/lib/fastlane/actions/push_to_git_remote.rb +6 -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 +10 -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 +11 -14
- data/fastlane/lib/fastlane/actions/set_github_release.rb +2 -8
- 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 +161 -141
- data/fastlane/lib/fastlane/actions/slather.rb +9 -19
- 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 +3 -3
- data/fastlane/lib/fastlane/actions/ssh.rb +5 -10
- data/fastlane/lib/fastlane/actions/swiftlint.rb +18 -16
- data/fastlane/lib/fastlane/actions/sync_code_signing.rb +7 -2
- 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 +2 -2
- 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 +1 -2
- 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 +5 -1
- data/fastlane/lib/fastlane/actions/upload_to_testflight.rb +10 -3
- 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_server_get_assets.rb +3 -3
- data/fastlane/lib/fastlane/actions/xcodebuild.rb +5 -5
- data/fastlane/lib/fastlane/actions/zip.rb +86 -21
- data/fastlane/lib/fastlane/cli_tools_distributor.rb +1 -1
- 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 +12 -6
- 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 +3 -0
- 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 +30 -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_function.rb +43 -15
- 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 +1 -1
- data/fastlane/swift/DeliverfileProtocol.swift +27 -23
- data/fastlane/swift/Fastlane.swift +7993 -4352
- data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/project.pbxproj +4 -0
- data/fastlane/swift/Gymfile.swift +1 -1
- data/fastlane/swift/GymfileProtocol.swift +1 -1
- data/fastlane/swift/LaneFileProtocol.swift +10 -4
- data/fastlane/swift/MainProcess.swift +1 -1
- data/fastlane/swift/Matchfile.swift +1 -1
- data/fastlane/swift/MatchfileProtocol.swift +3 -3
- data/fastlane/swift/OptionalConfigValue.swift +101 -0
- data/fastlane/swift/Plugins.swift +1 -1
- data/fastlane/swift/Precheckfile.swift +1 -1
- data/fastlane/swift/PrecheckfileProtocol.swift +4 -4
- data/fastlane/swift/RubyCommand.swift +2 -2
- data/fastlane/swift/RubyCommandable.swift +1 -1
- data/fastlane/swift/Runner.swift +2 -2
- data/fastlane/swift/RunnerArgument.swift +1 -1
- data/fastlane/swift/Scanfile.swift +1 -1
- data/fastlane/swift/ScanfileProtocol.swift +17 -1
- data/fastlane/swift/Screengrabfile.swift +1 -1
- data/fastlane/swift/ScreengrabfileProtocol.swift +4 -4
- data/fastlane/swift/Snapshotfile.swift +1 -1
- data/fastlane/swift/SnapshotfileProtocol.swift +5 -1
- data/fastlane/swift/SocketClient.swift +3 -2
- data/fastlane/swift/SocketClientDelegateProtocol.swift +1 -1
- data/fastlane/swift/SocketResponse.swift +5 -3
- data/fastlane/swift/formatting/Brewfile.lock.json +37 -21
- data/fastlane/swift/main.swift +1 -1
- data/fastlane/swift/upgrade_manifest.json +1 -1
- data/fastlane_core/lib/fastlane_core/build_watcher.rb +113 -17
- 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 +66 -10
- data/fastlane_core/lib/fastlane_core/ipa_upload_package_builder.rb +3 -2
- data/fastlane_core/lib/fastlane_core/itunes_transporter.rb +14 -8
- data/fastlane_core/lib/fastlane_core/keychain_importer.rb +12 -5
- data/fastlane_core/lib/fastlane_core/languages.rb +2 -2
- data/fastlane_core/lib/fastlane_core/pkg_file_analyser.rb +5 -0
- 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 +30 -23
- 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 +1 -0
- data/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb +41 -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/fastlane_core/lib/fastlane_core.rb +22 -20
- data/frameit/lib/frameit/commands_generator.rb +2 -1
- data/frameit/lib/frameit/config_parser.rb +2 -2
- data/frameit/lib/frameit/frame_downloader.rb +2 -1
- data/gym/lib/gym/code_signing_mapping.rb +2 -2
- data/gym/lib/gym/commands_generator.rb +2 -1
- data/gym/lib/gym/generators/package_command_generator.rb +4 -0
- data/gym/lib/gym/generators/package_command_generator_xcode7.rb +19 -13
- 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 +2 -2
- data/match/lib/match/importer.rb +9 -10
- data/match/lib/match/migrate.rb +2 -3
- data/match/lib/match/module.rb +1 -0
- data/match/lib/match/nuke.rb +10 -10
- data/match/lib/match/options.rb +5 -4
- data/match/lib/match/runner.rb +12 -12
- data/match/lib/match/spaceship_ensure.rb +3 -0
- 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/build_manager.rb +45 -15
- data/pilot/lib/pilot/commands_generator.rb +2 -1
- data/pilot/lib/pilot/manager.rb +14 -9
- data/pilot/lib/pilot/options.rb +39 -11
- data/pilot/lib/pilot/tester_exporter.rb +0 -1
- data/pilot/lib/pilot/tester_manager.rb +0 -1
- data/pilot/lib/pilot.rb +0 -1
- data/precheck/lib/precheck/commands_generator.rb +2 -1
- data/precheck/lib/precheck/module.rb +2 -0
- data/precheck/lib/precheck/options.rb +7 -6
- data/precheck/lib/precheck/runner.rb +13 -8
- data/produce/lib/produce/commands_generator.rb +129 -28
- data/produce/lib/produce/developer_center.rb +42 -4
- data/produce/lib/produce/options.rb +1 -1
- data/produce/lib/produce/service.rb +285 -179
- data/scan/lib/scan/commands_generator.rb +2 -1
- data/scan/lib/scan/detect_values.rb +26 -14
- data/scan/lib/scan/module.rb +1 -0
- data/scan/lib/scan/options.rb +32 -6
- data/scan/lib/scan/runner.rb +81 -1
- data/scan/lib/scan/test_command_generator.rb +37 -12
- data/scan/lib/scan/xcpretty_reporter_options_generator.rb +1 -1
- 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 +110 -109
- 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 +6 -4
- data/sigh/lib/sigh/runner.rb +8 -8
- data/snapshot/lib/assets/SnapfileTemplate +3 -2
- data/snapshot/lib/assets/SnapfileTemplate.swift +2 -1
- data/snapshot/lib/assets/SnapshotHelper.swift +14 -10
- data/snapshot/lib/snapshot/commands_generator.rb +3 -1
- data/snapshot/lib/snapshot/options.rb +5 -0
- 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 +12 -6
- data/snapshot/lib/snapshot/test_command_generator.rb +17 -3
- data/spaceship/README.md +4 -14
- data/spaceship/lib/spaceship/base.rb +2 -2
- data/spaceship/lib/spaceship/client.rb +37 -20
- data/spaceship/lib/spaceship/commands_generator.rb +4 -2
- data/spaceship/lib/spaceship/connect_api/api_client.rb +80 -8
- data/spaceship/lib/spaceship/connect_api/model.rb +1 -1
- data/spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb +36 -4
- data/spaceship/lib/spaceship/connect_api/models/app.rb +10 -2
- data/spaceship/lib/spaceship/connect_api/models/app_info.rb +10 -0
- data/spaceship/lib/spaceship/connect_api/models/app_preview_set.rb +5 -0
- data/spaceship/lib/spaceship/connect_api/models/app_screenshot.rb +1 -1
- data/spaceship/lib/spaceship/connect_api/models/app_screenshot_set.rb +5 -0
- data/spaceship/lib/spaceship/connect_api/models/app_store_version.rb +2 -3
- data/spaceship/lib/spaceship/connect_api/models/app_store_version_localization.rb +6 -0
- data/spaceship/lib/spaceship/connect_api/models/beta_group.rb +8 -1
- data/spaceship/lib/spaceship/connect_api/models/beta_tester.rb +3 -1
- data/spaceship/lib/spaceship/connect_api/models/build.rb +14 -1
- data/spaceship/lib/spaceship/connect_api/models/build_beta_detail.rb +8 -0
- data/spaceship/lib/spaceship/connect_api/models/bundle_id.rb +32 -0
- data/spaceship/lib/spaceship/connect_api/models/bundle_id_capability.rb +84 -21
- data/spaceship/lib/spaceship/connect_api/models/capabilities.rb +27 -0
- data/spaceship/lib/spaceship/connect_api/models/profile.rb +6 -0
- data/spaceship/lib/spaceship/connect_api/models/user.rb +17 -3
- data/spaceship/lib/spaceship/connect_api/models/user_invitation.rb +37 -3
- data/spaceship/lib/spaceship/connect_api/provisioning/provisioning.rb +104 -2
- data/spaceship/lib/spaceship/connect_api/testflight/client.rb +3 -0
- data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +72 -5
- data/spaceship/lib/spaceship/connect_api/token.rb +19 -4
- data/spaceship/lib/spaceship/connect_api/tunes/client.rb +3 -0
- data/spaceship/lib/spaceship/connect_api/tunes/tunes.rb +19 -2
- data/spaceship/lib/spaceship/connect_api/users/client.rb +3 -0
- data/spaceship/lib/spaceship/connect_api/users/users.rb +58 -3
- data/spaceship/lib/spaceship/connect_api.rb +1 -0
- data/spaceship/lib/spaceship/playground.rb +2 -2
- data/spaceship/lib/spaceship/spaceauth_runner.rb +38 -15
- data/spaceship/lib/spaceship/tunes/members.rb +1 -1
- data/spaceship/lib/spaceship/tunes/tunes_client.rb +5 -2
- data/spaceship/lib/spaceship/two_step_or_factor_client.rb +42 -29
- data/spaceship/lib/spaceship/ui.rb +2 -2
- data/supply/lib/supply/client.rb +45 -4
- data/supply/lib/supply/commands_generator.rb +2 -1
- data/supply/lib/supply/options.rb +14 -2
- data/supply/lib/supply/uploader.rb +13 -9
- metadata +119 -98
- data/fastlane/lib/fastlane/.erb_template_helper.rb.swp +0 -0
- data/fastlane/lib/fastlane/actions/.git_commit.rb.swp +0 -0
- data/pilot/lib/pilot/features.rb +0 -0
- data/pilot/lib/pilot/tester_util.rb +0 -0
- data/spaceship/lib/spaceship/.DS_Store +0 -0
@@ -15,22 +15,24 @@ module Scan
|
|
15
15
|
|
16
16
|
prevalidate
|
17
17
|
|
18
|
-
# Detect the project
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
18
|
+
# Detect the project if not SPM package
|
19
|
+
if Scan.config[:package_path].nil?
|
20
|
+
FastlaneCore::Project.detect_projects(config)
|
21
|
+
Scan.project = FastlaneCore::Project.new(config)
|
22
|
+
|
23
|
+
# Go into the project's folder, as there might be a Snapfile there
|
24
|
+
imported_path = File.expand_path(Scan.scanfile_name)
|
25
|
+
Dir.chdir(File.expand_path("..", Scan.project.path)) do
|
26
|
+
config.load_configuration_file(Scan.scanfile_name) unless File.expand_path(Scan.scanfile_name) == imported_path
|
27
|
+
end
|
27
28
|
|
28
|
-
|
29
|
+
Scan.project.select_scheme
|
30
|
+
end
|
29
31
|
|
30
32
|
devices = Scan.config[:devices] || Array(Scan.config[:device]) # important to use Array(nil) for when the value is nil
|
31
33
|
if devices.count > 0
|
32
34
|
detect_simulator(devices, '', '', '', nil)
|
33
|
-
|
35
|
+
elsif Scan.project
|
34
36
|
if Scan.project.ios?
|
35
37
|
# An iPhone 5s is a reasonably small and useful default for tests
|
36
38
|
detect_simulator(devices, 'iOS', 'IPHONEOS_DEPLOYMENT_TARGET', 'iPhone 5s', nil)
|
@@ -38,6 +40,7 @@ module Scan
|
|
38
40
|
detect_simulator(devices, 'tvOS', 'TVOS_DEPLOYMENT_TARGET', 'Apple TV 1080p', 'TV')
|
39
41
|
end
|
40
42
|
end
|
43
|
+
|
41
44
|
detect_destination
|
42
45
|
|
43
46
|
default_derived_data
|
@@ -72,6 +75,8 @@ module Scan
|
|
72
75
|
end
|
73
76
|
|
74
77
|
def self.default_derived_data
|
78
|
+
return unless Scan.project
|
79
|
+
|
75
80
|
return unless Scan.config[:derived_data_path].to_s.empty?
|
76
81
|
default_path = Scan.project.build_settings(key: "BUILT_PRODUCTS_DIR")
|
77
82
|
# => /Users/.../Library/Developer/Xcode/DerivedData/app-bqrfaojicpsqnoglloisfftjhksc/Build/Products/Release-iphoneos
|
@@ -162,7 +167,10 @@ module Scan
|
|
162
167
|
filter_simulators(simulators, :equal, version).tap(&potential_emptiness_error).select(&selector)
|
163
168
|
end
|
164
169
|
).tap do |array|
|
165
|
-
|
170
|
+
if array.empty?
|
171
|
+
UI.test_failure!("No device found with name '#{device_string}'") if Scan.config[:ensure_devices_found]
|
172
|
+
UI.error("Ignoring '#{device_string}', couldn’t find matching simulator")
|
173
|
+
end
|
166
174
|
end
|
167
175
|
end
|
168
176
|
|
@@ -213,14 +221,18 @@ module Scan
|
|
213
221
|
Scan.config[:destination] = ["platform=macOS,variant=Mac Catalyst"]
|
214
222
|
elsif Scan.devices && Scan.devices.count > 0
|
215
223
|
Scan.config[:destination] = Scan.devices.map { |d| "platform=#{d.os_type} Simulator,id=#{d.udid}" }
|
216
|
-
elsif Scan.project.mac_app?
|
224
|
+
elsif Scan.project && Scan.project.mac_app?
|
217
225
|
Scan.config[:destination] = min_xcode8? ? ["platform=macOS"] : ["platform=OS X"]
|
218
226
|
end
|
219
227
|
end
|
220
228
|
|
221
229
|
# get deployment target version
|
222
230
|
def self.get_deployment_target_version(deployment_target_key)
|
223
|
-
Scan.config[:deployment_target_version]
|
231
|
+
version = Scan.config[:deployment_target_version]
|
232
|
+
version ||= Scan.project.build_settings(key: deployment_target_key) if Scan.project
|
233
|
+
version ||= 0
|
234
|
+
|
235
|
+
return version
|
224
236
|
end
|
225
237
|
end
|
226
238
|
end
|
data/scan/lib/scan/module.rb
CHANGED
data/scan/lib/scan/options.rb
CHANGED
@@ -24,19 +24,30 @@ module Scan
|
|
24
24
|
v = File.expand_path(value.to_s)
|
25
25
|
UI.user_error!("Workspace file not found at path '#{v}'") unless File.exist?(v)
|
26
26
|
UI.user_error!("Workspace file invalid") unless File.directory?(v)
|
27
|
-
UI.user_error!("Workspace file is not a workspace, must end with .xcworkspace") unless v.include?(".xcworkspace")
|
28
27
|
end),
|
29
28
|
FastlaneCore::ConfigItem.new(key: :project,
|
30
29
|
short_option: "-p",
|
31
30
|
optional: true,
|
32
31
|
env_name: "SCAN_PROJECT",
|
33
32
|
description: "Path to the project file",
|
33
|
+
conflicting_options: [:package_path],
|
34
34
|
verify_block: proc do |value|
|
35
35
|
v = File.expand_path(value.to_s)
|
36
36
|
UI.user_error!("Project file not found at path '#{v}'") unless File.exist?(v)
|
37
37
|
UI.user_error!("Project file invalid") unless File.directory?(v)
|
38
38
|
UI.user_error!("Project file is not a project file, must end with .xcodeproj") unless v.include?(".xcodeproj")
|
39
39
|
end),
|
40
|
+
FastlaneCore::ConfigItem.new(key: :package_path,
|
41
|
+
short_option: "-P",
|
42
|
+
optional: true,
|
43
|
+
env_name: "SCAN_PACKAGE_PATH",
|
44
|
+
description: "Path to the Swift Package",
|
45
|
+
conflicting_options: [:project],
|
46
|
+
verify_block: proc do |value|
|
47
|
+
v = File.expand_path(value.to_s)
|
48
|
+
UI.user_error!("Package path not found at path '#{v}'") unless File.exist?(v)
|
49
|
+
UI.user_error!("Package path invalid") unless File.directory?(v)
|
50
|
+
end),
|
40
51
|
FastlaneCore::ConfigItem.new(key: :scheme,
|
41
52
|
short_option: "-s",
|
42
53
|
optional: true,
|
@@ -69,6 +80,11 @@ module Scan
|
|
69
80
|
default_value: false,
|
70
81
|
type: Boolean,
|
71
82
|
optional: true),
|
83
|
+
FastlaneCore::ConfigItem.new(key: :ensure_devices_found,
|
84
|
+
description: "Should fail if devices not found",
|
85
|
+
default_value: false,
|
86
|
+
type: Boolean,
|
87
|
+
optional: true),
|
72
88
|
|
73
89
|
# simulator management
|
74
90
|
FastlaneCore::ConfigItem.new(key: :force_quit_simulator,
|
@@ -269,6 +285,11 @@ module Scan
|
|
269
285
|
optional: true,
|
270
286
|
is_string: false,
|
271
287
|
default_value: false),
|
288
|
+
FastlaneCore::ConfigItem.new(key: :output_xctestrun,
|
289
|
+
type: Boolean,
|
290
|
+
env_name: "SCAN_OUTPUT_XCTESTRUN",
|
291
|
+
description: "Should provide additional copy of .xctestrun file (settings.xctestrun) and place in output path?",
|
292
|
+
default_value: false),
|
272
293
|
FastlaneCore::ConfigItem.new(key: :result_bundle,
|
273
294
|
short_option: "-z",
|
274
295
|
env_name: "SCAN_RESULT_BUNDLE",
|
@@ -462,11 +483,16 @@ module Scan
|
|
462
483
|
type: Boolean,
|
463
484
|
default_value: false),
|
464
485
|
FastlaneCore::ConfigItem.new(key: :use_system_scm,
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
486
|
+
env_name: "SCAN_USE_SYSTEM_SCM",
|
487
|
+
description: "Lets xcodebuild use system's scm configuration",
|
488
|
+
optional: true,
|
489
|
+
type: Boolean,
|
490
|
+
default_value: false),
|
491
|
+
FastlaneCore::ConfigItem.new(key: :number_of_retries,
|
492
|
+
env_name: 'SCAN_NUMBER_OF_RETRIES',
|
493
|
+
description: "The number of times a test can fail before scan should stop retrying",
|
494
|
+
type: Integer,
|
495
|
+
default_value: 0)
|
470
496
|
|
471
497
|
]
|
472
498
|
end
|
data/scan/lib/scan/runner.rb
CHANGED
@@ -51,7 +51,14 @@ module Scan
|
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
54
|
+
execute(retries: Scan.config[:number_of_retries])
|
55
|
+
end
|
56
|
+
|
57
|
+
def execute(retries: 0)
|
58
|
+
Scan.cache[:retry_attempt] = Scan.config[:number_of_retries] - retries
|
59
|
+
|
54
60
|
command = @test_command_generator.generate
|
61
|
+
|
55
62
|
prefix_hash = [
|
56
63
|
{
|
57
64
|
prefix: "Running Tests: ",
|
@@ -71,7 +78,12 @@ module Scan
|
|
71
78
|
error: proc do |error_output|
|
72
79
|
begin
|
73
80
|
exit_status = $?.exitstatus
|
74
|
-
|
81
|
+
if retries > 0
|
82
|
+
# If there are retries remaining, run the tests again
|
83
|
+
return retry_execute(retries: retries, error_output: error_output)
|
84
|
+
else
|
85
|
+
ErrorHandler.handle_build_error(error_output, @test_command_generator.xcodebuild_log_path)
|
86
|
+
end
|
75
87
|
rescue => ex
|
76
88
|
SlackPoster.new.run({
|
77
89
|
build_errors: 1
|
@@ -79,9 +91,50 @@ module Scan
|
|
79
91
|
raise ex
|
80
92
|
end
|
81
93
|
end)
|
94
|
+
|
82
95
|
exit_status
|
83
96
|
end
|
84
97
|
|
98
|
+
def retry_execute(retries:, error_output: "")
|
99
|
+
tests = retryable_tests(error_output)
|
100
|
+
|
101
|
+
if tests.empty?
|
102
|
+
UI.crash!("Failed to find failed tests to retry (could not parse error output)")
|
103
|
+
end
|
104
|
+
|
105
|
+
Scan.config[:only_testing] = tests
|
106
|
+
UI.important("Retrying tests: #{Scan.config[:only_testing].join(', ')}")
|
107
|
+
|
108
|
+
retries -= 1
|
109
|
+
UI.important("Number of retries remaining: #{retries}")
|
110
|
+
|
111
|
+
return execute(retries: retries)
|
112
|
+
end
|
113
|
+
|
114
|
+
def retryable_tests(input)
|
115
|
+
input = Helper.strip_ansi_colors(input)
|
116
|
+
|
117
|
+
retryable_tests = []
|
118
|
+
|
119
|
+
failing_tests = input.split("Failing tests:\n").fetch(1, [])
|
120
|
+
.split("\n\n").first
|
121
|
+
|
122
|
+
suites = failing_tests.split(/(?=\n\s+[\w\s]+:\n)/)
|
123
|
+
|
124
|
+
suites.each do |suite|
|
125
|
+
suite_name = suite.match(/\s*([\w\s\S]+):/).captures.first
|
126
|
+
|
127
|
+
test_cases = suite.split(":\n").fetch(1, []).split("\n").each
|
128
|
+
.select { |line| line.match?(/^\s+/) }
|
129
|
+
.map { |line| line.strip.gsub(".", "/").gsub("()", "") }
|
130
|
+
.map { |line| suite_name + "/" + line }
|
131
|
+
|
132
|
+
retryable_tests += test_cases
|
133
|
+
end
|
134
|
+
|
135
|
+
return retryable_tests.uniq
|
136
|
+
end
|
137
|
+
|
85
138
|
def handle_results(tests_exit_status)
|
86
139
|
if Scan.config[:disable_xcpretty]
|
87
140
|
unless tests_exit_status == 0
|
@@ -110,6 +163,7 @@ module Scan
|
|
110
163
|
|
111
164
|
copy_simulator_logs
|
112
165
|
zip_build_products
|
166
|
+
copy_xctestrun
|
113
167
|
|
114
168
|
if result[:failures] > 0
|
115
169
|
open_report
|
@@ -150,6 +204,32 @@ module Scan
|
|
150
204
|
UI.message("Successfully zipped build products: #{output_path}")
|
151
205
|
end
|
152
206
|
|
207
|
+
def copy_xctestrun
|
208
|
+
return unless Scan.config[:output_xctestrun]
|
209
|
+
|
210
|
+
# Gets :derived_data_path/Build/Products directory for coping .xctestrun file
|
211
|
+
derived_data_path = Scan.config[:derived_data_path]
|
212
|
+
path = File.join(derived_data_path, "Build", "Products")
|
213
|
+
|
214
|
+
# Gets absolute path of output directory
|
215
|
+
output_directory = File.absolute_path(Scan.config[:output_directory])
|
216
|
+
output_path = File.join(output_directory, "settings.xctestrun")
|
217
|
+
|
218
|
+
# Caching path for action to put into lane_context
|
219
|
+
Scan.cache[:output_xctestrun] = output_path
|
220
|
+
|
221
|
+
# Copy .xctestrun file and moves it to output directory
|
222
|
+
UI.message("Copying .xctestrun file")
|
223
|
+
xctestrun_file = Dir.glob("#{path}/*.xctestrun").first
|
224
|
+
|
225
|
+
if xctestrun_file
|
226
|
+
FileUtils.cp(xctestrun_file, output_path)
|
227
|
+
UI.message("Successfully copied xctestrun file: #{output_path}")
|
228
|
+
else
|
229
|
+
UI.user_error!("Could not find .xctextrun file to copy")
|
230
|
+
end
|
231
|
+
end
|
232
|
+
|
153
233
|
def test_results
|
154
234
|
temp_junit_report = Scan.cache[:temp_junit_report]
|
155
235
|
return File.read(temp_junit_report) if temp_junit_report && File.file?(temp_junit_report)
|
@@ -15,13 +15,25 @@ module Scan
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def prefix
|
18
|
-
["set -o pipefail &&"]
|
18
|
+
prefixes = ["set -o pipefail &&"]
|
19
|
+
|
20
|
+
package_path = Scan.config[:package_path]
|
21
|
+
prefixes << "cd #{package_path} &&" if package_path.to_s != ""
|
22
|
+
|
23
|
+
prefixes
|
19
24
|
end
|
20
25
|
|
21
26
|
# Path to the project or workspace as parameter
|
22
27
|
# This will also include the scheme (if given)
|
23
28
|
# @return [Array] The array with all the components to join
|
24
29
|
def project_path_array
|
30
|
+
unless Scan.config[:package_path].nil?
|
31
|
+
params = []
|
32
|
+
params << "-scheme #{Scan.config[:scheme].shellescape}" if Scan.config[:scheme]
|
33
|
+
params << "-workspace #{Scan.config[:workspace].shellescape}" if Scan.config[:workspace]
|
34
|
+
return params
|
35
|
+
end
|
36
|
+
|
25
37
|
proj = Scan.project.xcodebuild_parameters
|
26
38
|
return proj if proj.count > 0
|
27
39
|
UI.user_error!("No project/workspace found")
|
@@ -33,7 +45,7 @@ module Scan
|
|
33
45
|
options = []
|
34
46
|
options += project_path_array unless config[:xctestrun]
|
35
47
|
options << "-sdk '#{config[:sdk]}'" if config[:sdk]
|
36
|
-
options << destination # generated in `detect_values`
|
48
|
+
options << destination if destination # generated in `detect_values`
|
37
49
|
options << "-toolchain '#{config[:toolchain]}'" if config[:toolchain]
|
38
50
|
if config[:derived_data_path] && !options.include?("-derivedDataPath #{config[:derived_data_path].shellescape}")
|
39
51
|
options << "-derivedDataPath #{config[:derived_data_path].shellescape}"
|
@@ -136,7 +148,15 @@ module Scan
|
|
136
148
|
|
137
149
|
# Store the raw file
|
138
150
|
def xcodebuild_log_path
|
139
|
-
|
151
|
+
parts = []
|
152
|
+
if Scan.config[:app_name]
|
153
|
+
parts << Scan.config[:app_name]
|
154
|
+
elsif Scan.project
|
155
|
+
parts << Scan.project.app_name
|
156
|
+
end
|
157
|
+
parts << Scan.config[:scheme] if Scan.config[:scheme]
|
158
|
+
|
159
|
+
file_name = "#{parts.join('-')}.log"
|
140
160
|
containing = File.expand_path(Scan.config[:buildlog_path])
|
141
161
|
FileUtils.mkdir_p(containing)
|
142
162
|
|
@@ -162,16 +182,21 @@ module Scan
|
|
162
182
|
Scan.cache[:build_path]
|
163
183
|
end
|
164
184
|
|
185
|
+
# The path to the result bundle
|
165
186
|
def result_bundle_path
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
187
|
+
retry_count = Scan.cache[:retry_attempt] || 0
|
188
|
+
attempt = retry_count > 0 ? "-#{retry_count}" : ""
|
189
|
+
ext = FastlaneCore::Helper.xcode_version.to_i >= 11 ? '.xcresult' : '.test_result'
|
190
|
+
path = File.join(Scan.config[:output_directory], Scan.config[:scheme]) + attempt + ext
|
191
|
+
|
192
|
+
Scan.cache[:result_bundle_path] = path
|
193
|
+
|
194
|
+
# The result bundle path will be in the package path directory if specified
|
195
|
+
delete_path = path
|
196
|
+
delete_path = File.join(Scan.config[:package_path], path) if Scan.config[:package_path].to_s != ""
|
197
|
+
FileUtils.remove_dir(delete_path) if File.directory?(delete_path)
|
198
|
+
|
199
|
+
return path
|
175
200
|
end
|
176
201
|
end
|
177
202
|
end
|
@@ -13,7 +13,7 @@ module Scan
|
|
13
13
|
Scan.config[:xcpretty_args])
|
14
14
|
end
|
15
15
|
|
16
|
-
#
|
16
|
+
# Initialize with values from Scan.config matching these param names
|
17
17
|
def initialize(open_report, output_types, output_files, output_directory, use_clang_report_name, xcpretty_args)
|
18
18
|
@open_report = open_report
|
19
19
|
@output_types = output_types
|
@@ -4,86 +4,38 @@ require 'fastlane_core/command_executor'
|
|
4
4
|
module Screengrab
|
5
5
|
class AndroidEnvironment
|
6
6
|
attr_reader :android_home
|
7
|
-
attr_reader :build_tools_version
|
8
7
|
|
9
8
|
# android_home - the String path to the install location of the Android SDK
|
10
|
-
# build_tools_version - the String version of the Android build tools that should be used
|
11
|
-
def initialize(android_home, build_tools_version)
|
9
|
+
# build_tools_version - the String version of the Android build tools that should be used, ignored
|
10
|
+
def initialize(android_home, build_tools_version = nil)
|
12
11
|
@android_home = android_home
|
13
|
-
@build_tools_version = build_tools_version
|
14
12
|
end
|
15
13
|
|
16
14
|
def platform_tools_path
|
17
15
|
@platform_tools_path ||= find_platform_tools(android_home)
|
18
16
|
end
|
19
17
|
|
20
|
-
def build_tools_path
|
21
|
-
@build_tools_path ||= find_build_tools(android_home, build_tools_version)
|
22
|
-
end
|
23
|
-
|
24
18
|
def adb_path
|
25
19
|
@adb_path ||= find_adb(platform_tools_path)
|
26
20
|
end
|
27
21
|
|
28
|
-
def aapt_path
|
29
|
-
@aapt_path ||= find_aapt(build_tools_path)
|
30
|
-
end
|
31
|
-
|
32
22
|
private
|
33
23
|
|
34
24
|
def find_platform_tools(android_home)
|
35
25
|
return nil unless android_home
|
36
26
|
|
37
|
-
platform_tools_path = File.join(android_home, 'platform-tools')
|
27
|
+
platform_tools_path = Helper.localize_file_path(File.join(android_home, 'platform-tools'))
|
38
28
|
File.directory?(platform_tools_path) ? platform_tools_path : nil
|
39
29
|
end
|
40
30
|
|
41
|
-
def find_build_tools(android_home, build_tools_version)
|
42
|
-
return nil unless android_home
|
43
|
-
|
44
|
-
build_tools_dir = File.join(android_home, 'build-tools')
|
45
|
-
|
46
|
-
return nil unless build_tools_dir && File.directory?(build_tools_dir)
|
47
|
-
|
48
|
-
return File.join(build_tools_dir, build_tools_version) if build_tools_version
|
49
|
-
|
50
|
-
version = select_build_tools_version(build_tools_dir)
|
51
|
-
|
52
|
-
return version ? File.join(build_tools_dir, version) : nil
|
53
|
-
end
|
54
|
-
|
55
|
-
def select_build_tools_version(build_tools_dir)
|
56
|
-
# Collect the sub-directories of the build_tools_dir, rejecting any that start with '.' to remove . and ..
|
57
|
-
dir_names = Dir.entries(build_tools_dir).select { |e| !e.start_with?('.') && File.directory?(File.join(build_tools_dir, e)) }
|
58
|
-
|
59
|
-
# Collect a sorted array of Version objects from the directory names, handling the possibility that some
|
60
|
-
# entries may not be valid version names
|
61
|
-
versions = dir_names.map do |d|
|
62
|
-
begin
|
63
|
-
Gem::Version.new(d)
|
64
|
-
rescue
|
65
|
-
nil
|
66
|
-
end
|
67
|
-
end.reject(&:nil?).sort
|
68
|
-
|
69
|
-
# We'll take the last entry (highest version number) as the directory name we want
|
70
|
-
versions.last.to_s
|
71
|
-
end
|
72
|
-
|
73
31
|
def find_adb(platform_tools_path)
|
74
32
|
return FastlaneCore::CommandExecutor.which('adb') unless platform_tools_path
|
75
33
|
|
76
|
-
adb_path = File.join(platform_tools_path, 'adb')
|
34
|
+
adb_path = Helper.get_executable_path(File.join(platform_tools_path, 'adb'))
|
35
|
+
adb_path = Helper.localize_file_path(adb_path)
|
77
36
|
return executable_command?(adb_path) ? adb_path : nil
|
78
37
|
end
|
79
38
|
|
80
|
-
def find_aapt(build_tools_path)
|
81
|
-
return FastlaneCore::CommandExecutor.which('aapt') unless build_tools_path
|
82
|
-
|
83
|
-
aapt_path = File.join(build_tools_path, 'aapt')
|
84
|
-
return executable_command?(aapt_path) ? aapt_path : nil
|
85
|
-
end
|
86
|
-
|
87
39
|
def executable_command?(cmd_path)
|
88
40
|
Helper.executable?(cmd_path)
|
89
41
|
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'commander'
|
2
2
|
|
3
3
|
require 'fastlane/version'
|
4
|
+
require 'fastlane_core/ui/help_formatter'
|
4
5
|
require 'fastlane_core/fastlane_folder'
|
5
6
|
require 'fastlane_core/configuration/configuration'
|
6
7
|
require_relative 'android_environment'
|
@@ -26,7 +27,7 @@ module Screengrab
|
|
26
27
|
program :help, 'Authors', 'Andrea Falcone <asfalcone@google.com>, Michael Furtak <mfurtak@google.com>'
|
27
28
|
program :help, 'Website', 'https://fastlane.tools'
|
28
29
|
program :help, 'Documentation', 'https://docs.fastlane.tools/actions/screengrab/'
|
29
|
-
program :help_formatter,
|
30
|
+
program :help_formatter, FastlaneCore::HelpFormatter
|
30
31
|
|
31
32
|
global_option('--verbose', 'Shows a more verbose output') { FastlaneCore::Globals.verbose = true }
|
32
33
|
|
@@ -6,7 +6,6 @@ module Screengrab
|
|
6
6
|
return if Helper.test?
|
7
7
|
|
8
8
|
check_adb(android_env)
|
9
|
-
check_aapt(android_env)
|
10
9
|
end
|
11
10
|
|
12
11
|
def self.check_adb(android_env)
|
@@ -30,25 +29,6 @@ module Screengrab
|
|
30
29
|
UI.user_error!('adb command not found')
|
31
30
|
end
|
32
31
|
|
33
|
-
def self.check_aapt(android_env)
|
34
|
-
android_home = android_env.android_home
|
35
|
-
aapt_path = android_env.aapt_path
|
36
|
-
|
37
|
-
warn_if_command_path_not_relative_to_android_home('aapt', android_home, aapt_path)
|
38
|
-
# aapt is not required in order to function, so we'll only warn if we can't find it.
|
39
|
-
warn_missing_aapt(android_home) unless aapt_path
|
40
|
-
end
|
41
|
-
|
42
|
-
def self.warn_missing_aapt(android_home)
|
43
|
-
if android_home
|
44
|
-
UI.important("The `aapt` command could not be found relative to your provided ANDROID_HOME at #{android_home}")
|
45
|
-
UI.important("Please ensure that the Android SDK is installed and you have the build tools downloaded")
|
46
|
-
else
|
47
|
-
UI.important("The `aapt` command could not be found on your PATH")
|
48
|
-
UI.important("Please ensure that the Android SDK is installed and you have the build tools downloaded and present on your PATH")
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
32
|
def self.warn_if_command_path_not_relative_to_android_home(cmd_name, android_home, cmd_path)
|
53
33
|
if android_home && cmd_path && !cmd_path.start_with?(android_home)
|
54
34
|
UI.important("Using `#{cmd_name}` found at #{cmd_path} which is not within the specified ANDROID_HOME at #{android_home}")
|
@@ -22,7 +22,8 @@ module Screengrab
|
|
22
22
|
FastlaneCore::ConfigItem.new(key: :build_tools_version,
|
23
23
|
short_option: "-i",
|
24
24
|
optional: true,
|
25
|
-
description: "The Android build tools version to use, e.g. '23.0.2'"
|
25
|
+
description: "The Android build tools version to use, e.g. '23.0.2'",
|
26
|
+
deprecated: true),
|
26
27
|
FastlaneCore::ConfigItem.new(key: :locales,
|
27
28
|
description: "A list of locales which should be used",
|
28
29
|
short_option: "-q",
|
@@ -82,10 +83,12 @@ module Screengrab
|
|
82
83
|
env_name: 'SCREENGRAB_ENDING_LOCALE',
|
83
84
|
optional: true,
|
84
85
|
default_value: 'en-US',
|
85
|
-
description: "Return the device to this locale after running tests"
|
86
|
+
description: "Return the device to this locale after running tests",
|
87
|
+
deprecated: true),
|
86
88
|
FastlaneCore::ConfigItem.new(key: :use_adb_root,
|
87
89
|
env_name: 'SCREENGRAB_USE_ADB_ROOT',
|
88
90
|
description: "Restarts the adb daemon using `adb root` to allow access to screenshots directories on device. Use if getting 'Permission denied' errors",
|
91
|
+
deprecated: true,
|
89
92
|
default_value: false,
|
90
93
|
type: Boolean),
|
91
94
|
FastlaneCore::ConfigItem.new(key: :app_apk_path,
|