api / org.gradle.process / BaseExecSpec

BaseExecSpec

interface BaseExecSpec : ProcessForkOptions

Specifies options for launching a child process.

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.

Inherited Functions

copyTo

abstract fun copyTo(options: ProcessForkOptions): ProcessForkOptions

Copies these options to the given target options.

environment

abstract fun environment(environmentVariables: MutableMap<String, *>): ProcessForkOptions

Adds some environment variables to the environment for this process.

abstract fun environment(name: String, value: Any): ProcessForkOptions

Adds an environment variable to the environment for this process.

executable

abstract fun executable(executable: Any): ProcessForkOptions

Sets the name of the executable to use.

getEnvironment

abstract fun getEnvironment(): MutableMap<String, Any>

The environment variables to use for the process. Defaults to the environment of this process.

getExecutable

abstract fun getExecutable(): String

Returns the name of the executable to use.

getWorkingDir

abstract fun getWorkingDir(): File

Returns the working directory for the process. Defaults to the project directory.

setEnvironment

abstract fun setEnvironment(environmentVariables: MutableMap<String, *>): Unit

Sets the environment variable to use for the process.

setExecutable

abstract fun setExecutable(executable: String): Unit
abstract fun setExecutable(executable: Any): Unit

Sets the name of the executable to use.

setWorkingDir

abstract fun setWorkingDir(dir: File): Unit

Sets the working directory for the process.

abstract fun setWorkingDir(dir: Any): Unit

Sets the working directory for the process. The supplied argument is evaluated as per .

workingDir

abstract fun workingDir(dir: Any): ProcessForkOptions

Sets the working directory for the process. The supplied argument is evaluated as per .

Inheritors

ExecSpec

interface ExecSpec : BaseExecSpec

Specified the options for executing some command.

JavaExecSpec

interface JavaExecSpec : JavaForkOptions, BaseExecSpec

Specifies the options for executing a Java application.