api / org.gradle.testkit.runner / GradleRunner / forwardStdOutput

forwardStdOutput

abstract fun forwardStdOutput(writer: Writer): GradleRunner

Configures the runner to forward standard output from builds to the given writer.

The output of the build is always available via BuildResult#getOutput(). This method can be used to additionally capture the output.

Calling this method will negate the effect of previously calling #forwardOutput().

The given writer will not be closed by the runner.

When executing builds with Gradle versions earlier than 2.9 in debug mode, any output produced by the build that was written directly to System.out or System.err will not be represented in BuildResult#getOutput(). This is due to a defect that was fixed in Gradle 2.9.

Parameters

writer - the writer that build standard output should be forwarded to

Return
this

Since
2.9

See Also
#forwardOutput()#forwardStdError(Writer)