api / org.gradle.process / ExecSpec

ExecSpec

interface ExecSpec : BaseExecSpec

Specified the options for executing some command.

Functions

args

abstract fun args(vararg args: Any): ExecSpec
abstract fun args(args: MutableIterable<*>): ExecSpec

Adds arguments for the command to be executed.

commandLine

abstract fun commandLine(vararg args: Any): ExecSpec
abstract fun commandLine(args: MutableIterable<*>): ExecSpec

Sets the full command line, including the executable to be executed plus its arguments.

getArgs

abstract fun getArgs(): MutableList<String>

Returns the arguments for the command to be executed. Defaults to an empty list.

getArgumentProviders

abstract fun getArgumentProviders(): MutableList<CommandLineArgumentProvider>

Argument providers for the application.

setArgs

abstract fun setArgs(args: MutableList<String>): ExecSpec
abstract fun setArgs(args: MutableIterable<*>): ExecSpec

Sets the arguments for the command to be executed.

setCommandLine

abstract fun setCommandLine(args: MutableList<String>): Unit
abstract fun setCommandLine(vararg args: Any): Unit
abstract fun setCommandLine(args: MutableIterable<*>): Unit

Sets the full command line, including the executable to be executed plus its arguments.

Inherited Functions

getCommandLine

abstract fun getCommandLine(): MutableList<String>

Returns the full command line, including the executable plus its arguments.

getErrorOutput

abstract fun getErrorOutput(): OutputStream

Returns the output stream to consume standard error from the process executing the command. Default to System.err.

getStandardInput

abstract fun getStandardInput(): InputStream

Returns the standard input stream for the process executing the command. The stream is closed after the process completes. Defaults to an empty stream.

getStandardOutput

abstract fun getStandardOutput(): OutputStream

Returns the output stream to consume standard output from the process executing the command. Defaults to System.out.

isIgnoreExitValue

abstract fun isIgnoreExitValue(): Boolean

Tells whether a non-zero exit value is ignored, or an exception thrown. Defaults to false.

setErrorOutput

abstract fun setErrorOutput(outputStream: OutputStream): BaseExecSpec

Sets the output stream to consume standard error from the process executing the command. The stream is closed after the process completes.

setIgnoreExitValue

abstract fun setIgnoreExitValue(ignoreExitValue: Boolean): BaseExecSpec

Sets whether a non-zero exit value is ignored, or an exception thrown.

setStandardInput

abstract fun setStandardInput(inputStream: InputStream): BaseExecSpec

Sets the standard input stream for the process executing the command. The stream is closed after the process completes.

setStandardOutput

abstract fun setStandardOutput(outputStream: OutputStream): BaseExecSpec

Sets the output stream to consume standard output from the process executing the command. The stream is closed after the process completes.

Inheritors

AbstractExecTask

abstract class AbstractExecTask<T : AbstractExecTask<AbstractExecTask<*>>> : ConventionTask, ExecSpec

AbstractExecTask is the base class for all exec tasks.