fastlane/lib/fastlane/actions/slather.rb in fastlane-2.34.0 vs fastlane/lib/fastlane/actions/slather.rb in fastlane-2.35.0

- old
+ new

@@ -26,10 +26,11 @@ ignore: '--ignore', verbose: '--verbose', input_format: '--input-format', scheme: '--scheme', + configuration: '--configuration', workspace: '--workspace', binary_file: '--binary-file', binary_basename: '--binary-basename', source_files: '--source-files', decimals: '--decimals' @@ -50,11 +51,24 @@ def self.has_config_file File.file?('.slather.yml') end + def self.slather_version + require 'slather' + Slather::VERSION + end + + def self.configuration_available? + Gem::Version.new('2.4.1') <= Gem::Version.new(slather_version) + end + def self.validate_params!(params) + if params[:configuration] + UI.user_error!('configuration option is available since version 2.4.1') unless configuration_available? + end + if params[:proj] || has_config_file true else UI.user_error!("You have to provide a project with `:proj` or use a .slather.yml") end @@ -118,9 +132,13 @@ description: "The workspace that slather looks at", optional: true), FastlaneCore::ConfigItem.new(key: :scheme, env_name: "FL_SLATHER_SCHEME", # The name of the environment variable description: "Scheme to use when calling slather", + optional: true), + FastlaneCore::ConfigItem.new(key: :configuration, + env_name: "FL_SLATHER_CONFIGURATION", # The name of the environment variable + description: "Configuration to use when calling slather (since slather-2.4.1)", optional: true), FastlaneCore::ConfigItem.new(key: :input_format, env_name: "FL_SLATHER_INPUT_FORMAT", # The name of the environment variable description: "The input format that slather should look for", optional: true),