fastlane/lib/fastlane/actions/spm.rb in fastlane-2.95.0.beta.20180504050050 vs fastlane/lib/fastlane/actions/spm.rb in fastlane-2.95.0.beta.20180505050019

- old
+ new

@@ -7,13 +7,19 @@ cmd << (package_commands.include?(params[:command]) ? "package" : params[:command]) cmd << "--build-path #{params[:build_path]}" if params[:build_path] cmd << "--package-path #{params[:package_path]}" if params[:package_path] cmd << "--configuration #{params[:configuration]}" if params[:configuration] cmd << "--verbose" if params[:verbose] + if params[:xcpretty_output] + cmd += ["2>&1", "|", "xcpretty", "--#{params[:xcpretty_output]}"] + cmd = %w(set -o pipefail &&) + cmd + end cmd << params[:command] if package_commands.include?(params[:command]) - sh(cmd.join(" ")) + FastlaneCore::CommandExecutor.execute(command: cmd.join(" "), + print_all: true, + print_command: true) end ##################################################### # @!group Documentation ##################################################### @@ -45,10 +51,17 @@ description: "Build with configuration (debug|release) [default: debug]", optional: true, verify_block: proc do |value| UI.user_error!("Please pass a valid configuration: (debug|release)") unless valid_configurations.include?(value) end), + FastlaneCore::ConfigItem.new(key: :xcpretty_output, + env_name: "FL_SPM_XCPRETTY_OUTPUT", + description: "Specifies the output type for xcpretty. eg. 'test', or 'simple'", + optional: true, + verify_block: proc do |value| + UI.user_error!("Please pass a valid xcpretty output type: (#{xcpretty_output_types.join('|')})") unless xcpretty_output_types.include?(value) + end), FastlaneCore::ConfigItem.new(key: :verbose, short_option: "-v", env_name: "FL_SPM_VERBOSE", description: "Increase verbosity of informational output", is_string: false, @@ -87,9 +100,13 @@ %w(clean reset update) end def self.valid_configurations %w(debug release) + end + + def self.xcpretty_output_types + %w(simple test knock tap) end end end end