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
@@ -36,22 +36,21 @@ module Fastlane
|
|
36
36
|
FastlaneCore::ConfigItem.new(key: :use_bundle_exec,
|
37
37
|
env_name: "FL_SET_POD_KEY_USE_BUNDLE_EXEC",
|
38
38
|
description: "Use bundle exec when there is a Gemfile presented",
|
39
|
-
|
39
|
+
type: Boolean,
|
40
40
|
default_value: true),
|
41
41
|
FastlaneCore::ConfigItem.new(key: :key,
|
42
42
|
env_name: "FL_SET_POD_KEY_ITEM_KEY",
|
43
43
|
description: "The key to be saved with cocoapods-keys",
|
44
|
-
is_string: true,
|
45
44
|
optional: false),
|
46
45
|
FastlaneCore::ConfigItem.new(key: :value,
|
47
46
|
env_name: "FL_SET_POD_KEY_ITEM_VALUE",
|
48
47
|
description: "The value to be saved with cocoapods-keys",
|
49
|
-
|
48
|
+
sensitive: true,
|
49
|
+
code_gen_sensitive: true,
|
50
50
|
optional: false),
|
51
51
|
FastlaneCore::ConfigItem.new(key: :project,
|
52
52
|
env_name: "FL_SET_POD_KEY_PROJECT",
|
53
53
|
description: "The project name",
|
54
|
-
is_string: true,
|
55
54
|
optional: true)
|
56
55
|
]
|
57
56
|
end
|
@@ -92,12 +92,11 @@ module Fastlane
|
|
92
92
|
FastlaneCore::ConfigItem.new(key: :force,
|
93
93
|
env_name: "FL_SETUP_CI_FORCE",
|
94
94
|
description: "Force setup, even if not executed by CI",
|
95
|
-
|
95
|
+
type: Boolean,
|
96
96
|
default_value: false),
|
97
97
|
FastlaneCore::ConfigItem.new(key: :provider,
|
98
98
|
env_name: "FL_SETUP_CI_PROVIDER",
|
99
99
|
description: "CI provider. If none is set, the provider is detected automatically",
|
100
|
-
is_string: true,
|
101
100
|
optional: true,
|
102
101
|
verify_block: proc do |value|
|
103
102
|
value = value.to_s
|
@@ -118,34 +118,32 @@ module Fastlane
|
|
118
118
|
FastlaneCore::ConfigItem.new(key: :force,
|
119
119
|
env_name: "FL_SETUP_JENKINS_FORCE",
|
120
120
|
description: "Force setup, even if not executed by Jenkins",
|
121
|
-
|
121
|
+
type: Boolean,
|
122
122
|
default_value: false),
|
123
123
|
|
124
124
|
# Keychain
|
125
125
|
FastlaneCore::ConfigItem.new(key: :unlock_keychain,
|
126
126
|
env_name: "FL_SETUP_JENKINS_UNLOCK_KEYCHAIN",
|
127
127
|
description: "Unlocks keychain",
|
128
|
-
|
128
|
+
type: Boolean,
|
129
129
|
default_value: true),
|
130
130
|
FastlaneCore::ConfigItem.new(key: :add_keychain_to_search_list,
|
131
131
|
env_name: "FL_SETUP_JENKINS_ADD_KEYCHAIN_TO_SEARCH_LIST",
|
132
|
-
description: "Add to keychain search list",
|
133
|
-
|
132
|
+
description: "Add to keychain search list, valid values are true, false, :add, and :replace",
|
133
|
+
skip_type_validation: true, # allow Boolean, Symbol
|
134
134
|
default_value: :replace),
|
135
135
|
FastlaneCore::ConfigItem.new(key: :set_default_keychain,
|
136
136
|
env_name: "FL_SETUP_JENKINS_SET_DEFAULT_KEYCHAIN",
|
137
137
|
description: "Set keychain as default",
|
138
|
-
|
138
|
+
type: Boolean,
|
139
139
|
default_value: true),
|
140
140
|
FastlaneCore::ConfigItem.new(key: :keychain_path,
|
141
141
|
env_name: "KEYCHAIN_PATH",
|
142
142
|
description: "Path to keychain",
|
143
|
-
is_string: true,
|
144
143
|
optional: true),
|
145
144
|
FastlaneCore::ConfigItem.new(key: :keychain_password,
|
146
145
|
env_name: "KEYCHAIN_PASSWORD",
|
147
146
|
description: "Keychain password",
|
148
|
-
is_string: true,
|
149
147
|
sensitive: true,
|
150
148
|
default_value: ""),
|
151
149
|
|
@@ -153,29 +151,26 @@ module Fastlane
|
|
153
151
|
FastlaneCore::ConfigItem.new(key: :set_code_signing_identity,
|
154
152
|
env_name: "FL_SETUP_JENKINS_SET_CODE_SIGNING_IDENTITY",
|
155
153
|
description: "Set code signing identity from CODE_SIGNING_IDENTITY environment",
|
156
|
-
|
154
|
+
type: Boolean,
|
157
155
|
default_value: true),
|
158
156
|
FastlaneCore::ConfigItem.new(key: :code_signing_identity,
|
159
157
|
env_name: "CODE_SIGNING_IDENTITY",
|
160
158
|
description: "Code signing identity",
|
161
|
-
is_string: true,
|
162
159
|
optional: true),
|
163
160
|
|
164
161
|
# Xcode parameters
|
165
162
|
FastlaneCore::ConfigItem.new(key: :output_directory,
|
166
163
|
env_name: "FL_SETUP_JENKINS_OUTPUT_DIRECTORY",
|
167
164
|
description: "The directory in which the ipa file should be stored in",
|
168
|
-
is_string: true,
|
169
165
|
default_value: "./output"),
|
170
166
|
FastlaneCore::ConfigItem.new(key: :derived_data_path,
|
171
167
|
env_name: "FL_SETUP_JENKINS_DERIVED_DATA_PATH",
|
172
168
|
description: "The directory where built products and other derived data will go",
|
173
|
-
is_string: true,
|
174
169
|
default_value: "./derivedData"),
|
175
170
|
FastlaneCore::ConfigItem.new(key: :result_bundle,
|
176
171
|
env_name: "FL_SETUP_JENKINS_RESULT_BUNDLE",
|
177
172
|
description: "Produce the result bundle describing what occurred will be placed",
|
178
|
-
|
173
|
+
type: Boolean,
|
179
174
|
default_value: true)
|
180
175
|
]
|
181
176
|
end
|
@@ -24,17 +24,15 @@ module Fastlane
|
|
24
24
|
[
|
25
25
|
FastlaneCore::ConfigItem.new(key: :command,
|
26
26
|
description: 'Shell command to be executed',
|
27
|
-
optional: false,
|
28
|
-
is_string: true),
|
27
|
+
optional: false),
|
29
28
|
FastlaneCore::ConfigItem.new(key: :log,
|
30
29
|
description: 'Determines whether fastlane should print out the executed command itself and output of the executed command. If command line option --troubleshoot is used, then it overrides this option to true',
|
31
30
|
optional: true,
|
32
|
-
|
31
|
+
type: Boolean,
|
33
32
|
default_value: true),
|
34
33
|
FastlaneCore::ConfigItem.new(key: :error_callback,
|
35
34
|
description: 'A callback invoked with the command output if there is a non-zero exit status',
|
36
35
|
optional: true,
|
37
|
-
is_string: false,
|
38
36
|
type: :string_callback,
|
39
37
|
default_value: nil)
|
40
38
|
]
|
@@ -1,70 +1,178 @@
|
|
1
|
+
require 'fastlane/notification/slack'
|
2
|
+
|
1
3
|
# rubocop:disable Style/CaseEquality
|
2
4
|
# rubocop:disable Style/MultilineTernaryOperator
|
3
5
|
# rubocop:disable Style/NestedTernaryOperator
|
4
6
|
module Fastlane
|
5
7
|
module Actions
|
6
8
|
class SlackAction < Action
|
7
|
-
|
8
|
-
|
9
|
-
|
9
|
+
class Runner
|
10
|
+
def initialize(slack_url)
|
11
|
+
@notifier = Fastlane::Notification::Slack.new(slack_url)
|
12
|
+
end
|
10
13
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
def self.trim_message(message)
|
15
|
-
# We want the last 7000 characters, instead of the first 7000, as the error is at the bottom
|
16
|
-
start_index = [message.length - 7000, 0].max
|
17
|
-
message = message[start_index..-1]
|
18
|
-
# We want line breaks to be shown on slack output so we replace
|
19
|
-
# input non-interpreted line break with interpreted line break
|
20
|
-
message.gsub('\n', "\n")
|
21
|
-
end
|
14
|
+
def run(options)
|
15
|
+
options[:message] = self.class.trim_message(options[:message].to_s || '')
|
16
|
+
options[:message] = Fastlane::Notification::Slack::LinkConverter.convert(options[:message])
|
22
17
|
|
23
|
-
|
24
|
-
require 'slack-notifier'
|
18
|
+
options[:pretext] = options[:pretext].gsub('\n', "\n") unless options[:pretext].nil?
|
25
19
|
|
26
|
-
|
27
|
-
|
20
|
+
if options[:channel].to_s.length > 0
|
21
|
+
channel = options[:channel]
|
22
|
+
channel = ('#' + options[:channel]) unless ['#', '@'].include?(channel[0]) # send message to channel by default
|
23
|
+
end
|
28
24
|
|
29
|
-
|
25
|
+
username = options[:use_webhook_configured_username_and_icon] ? nil : options[:username]
|
30
26
|
|
31
|
-
|
32
|
-
|
33
|
-
|
27
|
+
slack_attachment = self.class.generate_slack_attachments(options)
|
28
|
+
link_names = options[:link_names]
|
29
|
+
icon_url = options[:use_webhook_configured_username_and_icon] ? nil : options[:icon_url]
|
30
|
+
|
31
|
+
post_message(
|
32
|
+
channel: channel,
|
33
|
+
username: username,
|
34
|
+
attachments: [slack_attachment],
|
35
|
+
link_names: link_names,
|
36
|
+
icon_url: icon_url,
|
37
|
+
fail_on_error: options[:fail_on_error]
|
38
|
+
)
|
34
39
|
end
|
35
40
|
|
36
|
-
|
41
|
+
def post_message(channel:, username:, attachments:, link_names:, icon_url:, fail_on_error:)
|
42
|
+
@notifier.post_to_legacy_incoming_webhook(
|
43
|
+
channel: channel,
|
44
|
+
username: username,
|
45
|
+
link_names: link_names,
|
46
|
+
icon_url: icon_url,
|
47
|
+
attachments: attachments
|
48
|
+
)
|
49
|
+
UI.success('Successfully sent Slack notification')
|
50
|
+
rescue => error
|
51
|
+
UI.error("Exception: #{error}")
|
52
|
+
message = "Error pushing Slack message, maybe the integration has no permission to post on this channel? Try removing the channel parameter in your Fastfile, this is usually caused by a misspelled or changed group/channel name or an expired SLACK_URL"
|
53
|
+
if fail_on_error
|
54
|
+
UI.user_error!(message)
|
55
|
+
else
|
56
|
+
UI.error(message)
|
57
|
+
end
|
58
|
+
end
|
37
59
|
|
38
|
-
|
60
|
+
# As there is a text limit in the notifications, we are
|
61
|
+
# usually interested in the last part of the message
|
62
|
+
# e.g. for tests
|
63
|
+
def self.trim_message(message)
|
64
|
+
# We want the last 7000 characters, instead of the first 7000, as the error is at the bottom
|
65
|
+
start_index = [message.length - 7000, 0].max
|
66
|
+
message = message[start_index..-1]
|
67
|
+
# We want line breaks to be shown on slack output so we replace
|
68
|
+
# input non-interpreted line break with interpreted line break
|
69
|
+
message.gsub('\n', "\n")
|
70
|
+
end
|
39
71
|
|
40
|
-
|
72
|
+
def self.generate_slack_attachments(options)
|
73
|
+
color = (options[:success] ? 'good' : 'danger')
|
74
|
+
should_add_payload = ->(payload_name) { options[:default_payloads].map(&:to_sym).include?(payload_name.to_sym) }
|
41
75
|
|
42
|
-
|
76
|
+
slack_attachment = {
|
77
|
+
fallback: options[:message],
|
78
|
+
text: options[:message],
|
79
|
+
pretext: options[:pretext],
|
80
|
+
color: color,
|
81
|
+
mrkdwn_in: ["pretext", "text", "fields", "message"],
|
82
|
+
fields: []
|
83
|
+
}
|
43
84
|
|
44
|
-
|
85
|
+
# custom user payloads
|
86
|
+
slack_attachment[:fields] += options[:payload].map do |k, v|
|
87
|
+
{
|
88
|
+
title: k.to_s,
|
89
|
+
value: Fastlane::Notification::Slack::LinkConverter.convert(v.to_s),
|
90
|
+
short: false
|
91
|
+
}
|
92
|
+
end
|
45
93
|
|
46
|
-
|
94
|
+
# Add the lane to the Slack message
|
95
|
+
# This might be nil, if slack is called as "one-off" action
|
96
|
+
if should_add_payload[:lane] && Actions.lane_context[Actions::SharedValues::LANE_NAME]
|
97
|
+
slack_attachment[:fields] << {
|
98
|
+
title: 'Lane',
|
99
|
+
value: Actions.lane_context[Actions::SharedValues::LANE_NAME],
|
100
|
+
short: true
|
101
|
+
}
|
102
|
+
end
|
47
103
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
104
|
+
# test_result
|
105
|
+
if should_add_payload[:test_result]
|
106
|
+
slack_attachment[:fields] << {
|
107
|
+
title: 'Result',
|
108
|
+
value: (options[:success] ? 'Success' : 'Error'),
|
109
|
+
short: true
|
110
|
+
}
|
111
|
+
end
|
112
|
+
|
113
|
+
# git branch
|
114
|
+
if Actions.git_branch && should_add_payload[:git_branch]
|
115
|
+
slack_attachment[:fields] << {
|
116
|
+
title: 'Git Branch',
|
117
|
+
value: Actions.git_branch,
|
118
|
+
short: true
|
119
|
+
}
|
120
|
+
end
|
121
|
+
|
122
|
+
# git_author
|
123
|
+
if Actions.git_author_email && should_add_payload[:git_author]
|
124
|
+
if FastlaneCore::Env.truthy?('FASTLANE_SLACK_HIDE_AUTHOR_ON_SUCCESS') && options[:success]
|
125
|
+
# We only show the git author if the build failed
|
61
126
|
else
|
62
|
-
|
127
|
+
slack_attachment[:fields] << {
|
128
|
+
title: 'Git Author',
|
129
|
+
value: Actions.git_author_email,
|
130
|
+
short: true
|
131
|
+
}
|
63
132
|
end
|
64
133
|
end
|
134
|
+
|
135
|
+
# last_git_commit
|
136
|
+
if Actions.last_git_commit_message && should_add_payload[:last_git_commit]
|
137
|
+
slack_attachment[:fields] << {
|
138
|
+
title: 'Git Commit',
|
139
|
+
value: Actions.last_git_commit_message,
|
140
|
+
short: false
|
141
|
+
}
|
142
|
+
end
|
143
|
+
|
144
|
+
# last_git_commit_hash
|
145
|
+
if Actions.last_git_commit_hash(true) && should_add_payload[:last_git_commit_hash]
|
146
|
+
slack_attachment[:fields] << {
|
147
|
+
title: 'Git Commit Hash',
|
148
|
+
value: Actions.last_git_commit_hash(short: true),
|
149
|
+
short: false
|
150
|
+
}
|
151
|
+
end
|
152
|
+
|
153
|
+
# merge additional properties
|
154
|
+
deep_merge(slack_attachment, options[:attachment_properties])
|
155
|
+
end
|
156
|
+
|
157
|
+
# Adapted from https://stackoverflow.com/a/30225093/158525
|
158
|
+
def self.deep_merge(a, b)
|
159
|
+
merger = proc do |key, v1, v2|
|
160
|
+
Hash === v1 && Hash === v2 ?
|
161
|
+
v1.merge(v2, &merger) : Array === v1 && Array === v2 ?
|
162
|
+
v1 | v2 : [:undefined, nil, :nil].include?(v2) ? v1 : v2
|
163
|
+
end
|
164
|
+
a.merge(b, &merger)
|
65
165
|
end
|
66
166
|
end
|
67
167
|
|
168
|
+
def self.is_supported?(platform)
|
169
|
+
true
|
170
|
+
end
|
171
|
+
|
172
|
+
def self.run(options)
|
173
|
+
Runner.new(options[:slack_url]).run(options)
|
174
|
+
end
|
175
|
+
|
68
176
|
def self.description
|
69
177
|
"Send a success/error message to your [Slack](https://slack.com) group"
|
70
178
|
end
|
@@ -87,7 +195,7 @@ module Fastlane
|
|
87
195
|
env_name: "FL_SLACK_USE_WEBHOOK_CONFIGURED_USERNAME_AND_ICON",
|
88
196
|
description: "Use webhook's default username and icon settings? (true/false)",
|
89
197
|
default_value: false,
|
90
|
-
|
198
|
+
type: Boolean,
|
91
199
|
optional: true),
|
92
200
|
FastlaneCore::ConfigItem.new(key: :slack_url,
|
93
201
|
env_name: "SLACK_URL",
|
@@ -100,47 +208,45 @@ module Fastlane
|
|
100
208
|
env_name: "FL_SLACK_USERNAME",
|
101
209
|
description: "Overrides the webhook's username property if use_webhook_configured_username_and_icon is false",
|
102
210
|
default_value: "fastlane",
|
103
|
-
is_string: true,
|
104
211
|
optional: true),
|
105
212
|
FastlaneCore::ConfigItem.new(key: :icon_url,
|
106
213
|
env_name: "FL_SLACK_ICON_URL",
|
107
214
|
description: "Overrides the webhook's image property if use_webhook_configured_username_and_icon is false",
|
108
215
|
default_value: "https://fastlane.tools/assets/img/fastlane_icon.png",
|
109
|
-
is_string: true,
|
110
216
|
optional: true),
|
111
217
|
FastlaneCore::ConfigItem.new(key: :payload,
|
112
218
|
env_name: "FL_SLACK_PAYLOAD",
|
113
219
|
description: "Add additional information to this post. payload must be a hash containing any key with any value",
|
114
220
|
default_value: {},
|
115
|
-
|
221
|
+
type: Hash),
|
116
222
|
FastlaneCore::ConfigItem.new(key: :default_payloads,
|
117
223
|
env_name: "FL_SLACK_DEFAULT_PAYLOADS",
|
118
|
-
description: "
|
119
|
-
|
224
|
+
description: "Specifies default payloads to include. Pass an empty array to suppress all the default payloads",
|
225
|
+
default_value: ['lane', 'test_result', 'git_branch', 'git_author', 'last_git_commit', 'last_git_commit_hash'],
|
120
226
|
type: Array),
|
121
227
|
FastlaneCore::ConfigItem.new(key: :attachment_properties,
|
122
228
|
env_name: "FL_SLACK_ATTACHMENT_PROPERTIES",
|
123
229
|
description: "Merge additional properties in the slack attachment, see https://api.slack.com/docs/attachments",
|
124
230
|
default_value: {},
|
125
|
-
|
231
|
+
type: Hash),
|
126
232
|
FastlaneCore::ConfigItem.new(key: :success,
|
127
233
|
env_name: "FL_SLACK_SUCCESS",
|
128
234
|
description: "Was this build successful? (true/false)",
|
129
235
|
optional: true,
|
130
236
|
default_value: true,
|
131
|
-
|
237
|
+
type: Boolean),
|
132
238
|
FastlaneCore::ConfigItem.new(key: :fail_on_error,
|
133
239
|
env_name: "FL_SLACK_FAIL_ON_ERROR",
|
134
240
|
description: "Should an error sending the slack notification cause a failure? (true/false)",
|
135
241
|
optional: true,
|
136
242
|
default_value: true,
|
137
|
-
|
243
|
+
type: Boolean),
|
138
244
|
FastlaneCore::ConfigItem.new(key: :link_names,
|
139
245
|
env_name: "FL_SLACK_LINK_NAMES",
|
140
246
|
description: "Find and link channel names and usernames (true/false)",
|
141
247
|
optional: true,
|
142
248
|
default_value: false,
|
143
|
-
|
249
|
+
type: Boolean)
|
144
250
|
]
|
145
251
|
end
|
146
252
|
|
@@ -159,8 +265,7 @@ module Fastlane
|
|
159
265
|
"Build Date" => Time.new.to_s,
|
160
266
|
"Built by" => "Jenkins",
|
161
267
|
},
|
162
|
-
default_payloads: [:git_branch, :git_author], # Optional, lets you specify
|
163
|
-
# Don\'t add this key, or pass nil, if you want all the default payloads. The available default payloads are: `lane`, `test_result`, `git_branch`, `git_author`, `last_git_commit`, `last_git_commit_hash`.
|
268
|
+
default_payloads: [:git_branch, :git_author], # Optional, lets you specify default payloads to include. Pass an empty array to suppress all the default payloads.
|
164
269
|
attachment_properties: { # Optional, lets you specify any other properties available for attachments in the slack API (see https://api.slack.com/docs/attachments).
|
165
270
|
# This hash is deep merged with the existing properties set using the other properties above. This allows your own fields properties to be appended to the existing fields that were created using the `payload` property for instance.
|
166
271
|
thumb_url: "http://example.com/path/to/thumb.png",
|
@@ -186,99 +291,13 @@ module Fastlane
|
|
186
291
|
# @!group Helper
|
187
292
|
#####################################################
|
188
293
|
|
189
|
-
def self.
|
190
|
-
|
191
|
-
should_add_payload = ->(payload_name) { options[:default_payloads].nil? || options[:default_payloads].map(&:to_sym).include?(payload_name.to_sym) }
|
192
|
-
|
193
|
-
slack_attachment = {
|
194
|
-
fallback: options[:message],
|
195
|
-
text: options[:message],
|
196
|
-
pretext: options[:pretext],
|
197
|
-
color: color,
|
198
|
-
mrkdwn_in: ["pretext", "text", "fields", "message"],
|
199
|
-
fields: []
|
200
|
-
}
|
201
|
-
|
202
|
-
# custom user payloads
|
203
|
-
slack_attachment[:fields] += options[:payload].map do |k, v|
|
204
|
-
{
|
205
|
-
title: k.to_s,
|
206
|
-
value: Slack::Notifier::Util::LinkFormatter.format(v.to_s),
|
207
|
-
short: false
|
208
|
-
}
|
209
|
-
end
|
210
|
-
|
211
|
-
# Add the lane to the Slack message
|
212
|
-
# This might be nil, if slack is called as "one-off" action
|
213
|
-
if should_add_payload[:lane] && Actions.lane_context[Actions::SharedValues::LANE_NAME]
|
214
|
-
slack_attachment[:fields] << {
|
215
|
-
title: 'Lane',
|
216
|
-
value: Actions.lane_context[Actions::SharedValues::LANE_NAME],
|
217
|
-
short: true
|
218
|
-
}
|
219
|
-
end
|
220
|
-
|
221
|
-
# test_result
|
222
|
-
if should_add_payload[:test_result]
|
223
|
-
slack_attachment[:fields] << {
|
224
|
-
title: 'Result',
|
225
|
-
value: (options[:success] ? 'Success' : 'Error'),
|
226
|
-
short: true
|
227
|
-
}
|
228
|
-
end
|
229
|
-
|
230
|
-
# git branch
|
231
|
-
if Actions.git_branch && should_add_payload[:git_branch]
|
232
|
-
slack_attachment[:fields] << {
|
233
|
-
title: 'Git Branch',
|
234
|
-
value: Actions.git_branch,
|
235
|
-
short: true
|
236
|
-
}
|
237
|
-
end
|
238
|
-
|
239
|
-
# git_author
|
240
|
-
if Actions.git_author_email && should_add_payload[:git_author]
|
241
|
-
if FastlaneCore::Env.truthy?('FASTLANE_SLACK_HIDE_AUTHOR_ON_SUCCESS') && options[:success]
|
242
|
-
# We only show the git author if the build failed
|
243
|
-
else
|
244
|
-
slack_attachment[:fields] << {
|
245
|
-
title: 'Git Author',
|
246
|
-
value: Actions.git_author_email,
|
247
|
-
short: true
|
248
|
-
}
|
249
|
-
end
|
250
|
-
end
|
251
|
-
|
252
|
-
# last_git_commit
|
253
|
-
if Actions.last_git_commit_message && should_add_payload[:last_git_commit]
|
254
|
-
slack_attachment[:fields] << {
|
255
|
-
title: 'Git Commit',
|
256
|
-
value: Actions.last_git_commit_message,
|
257
|
-
short: false
|
258
|
-
}
|
259
|
-
end
|
260
|
-
|
261
|
-
# last_git_commit_hash
|
262
|
-
if Actions.last_git_commit_hash(true) && should_add_payload[:last_git_commit_hash]
|
263
|
-
slack_attachment[:fields] << {
|
264
|
-
title: 'Git Commit Hash',
|
265
|
-
value: Actions.last_git_commit_hash(short: true),
|
266
|
-
short: false
|
267
|
-
}
|
268
|
-
end
|
269
|
-
|
270
|
-
# merge additional properties
|
271
|
-
deep_merge(slack_attachment, options[:attachment_properties])
|
294
|
+
def self.trim_message(message)
|
295
|
+
Runner.trim_message(message)
|
272
296
|
end
|
273
297
|
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
Hash === v1 && Hash === v2 ?
|
278
|
-
v1.merge(v2, &merger) : Array === v1 && Array === v2 ?
|
279
|
-
v1 | v2 : [:undefined, nil, :nil].include?(v2) ? v1 : v2
|
280
|
-
end
|
281
|
-
a.merge(b, &merger)
|
298
|
+
def self.generate_slack_attachments(options)
|
299
|
+
UI.deprecated('`Fastlane::Actions::Slack.generate_slack_attachments` is subject to be removed as Slack recommends migrating `attachments` to Block Kit. fastlane will also follow the same direction.')
|
300
|
+
Runner.generate_slack_attachments(options)
|
282
301
|
end
|
283
302
|
end
|
284
303
|
end
|