api / org.gradle.tooling / BuildActionExecuter

BuildActionExecuter

interface BuildActionExecuter<T : Any> : ConfigurableLauncher<BuildActionExecuter<T>>

Used to execute a BuildAction in the build process.

Parameters

- The type of result produced by this executer.

Since
1.8

Types

Builder

interface Builder

Builder for a a build action that hooks into different phases of the build.

A single BuildAction is allowed per build phase. Use composite actions if needed.

Functions

forTasks

abstract fun forTasks(vararg tasks: String): BuildActionExecuter<T>
abstract fun forTasks(tasks: MutableIterable<String>): BuildActionExecuter<T>

Specifies the tasks to execute before executing the BuildAction. If not configured, null, or an empty array is passed, then no tasks will be executed.

run

abstract fun run(): T

Runs the action, blocking until its result is available.

abstract fun run(handler: ResultHandler<in T>): Unit

Starts executing the action, passing the result to the given handler when complete. This method returns immediately, and the result is later passed to the given handler's method.

If the operation fails, the handler's ResultHandler#onFailure(GradleConnectionException) method is called with the appropriate exception. See #run() for a description of the various exceptions that the operation may fail with.

Inherited Functions

addProgressListener

abstract fun addProgressListener(listener: ProgressListener): T
abstract fun addProgressListener(listener: ProgressListener): T
abstract fun addProgressListener(listener: ProgressListener, eventTypes: MutableSet<OperationType>): T
abstract fun addProgressListener(listener: ProgressListener, vararg operationTypes: OperationType): T

{@inheritDoc}

setColorOutput

abstract fun setColorOutput(colorOutput: Boolean): T

{@inheritDoc}

setEnvironmentVariables

abstract fun setEnvironmentVariables(envVariables: MutableMap<String, String>): T

{@inheritDoc}

setJavaHome

abstract fun setJavaHome(javaHome: File): T

{@inheritDoc}

setJvmArguments

abstract fun setJvmArguments(vararg jvmArguments: String): T
abstract fun setJvmArguments(jvmArguments: MutableIterable<String>): T

{@inheritDoc}

setStandardError

abstract fun setStandardError(outputStream: OutputStream): T

{@inheritDoc}

setStandardInput

abstract fun setStandardInput(inputStream: InputStream): T

{@inheritDoc}

setStandardOutput

abstract fun setStandardOutput(outputStream: OutputStream): T

{@inheritDoc}

withArguments

abstract fun withArguments(vararg arguments: String): T
abstract fun withArguments(arguments: MutableIterable<String>): T

{@inheritDoc}

withCancellationToken

abstract fun withCancellationToken(cancellationToken: CancellationToken): T

{@inheritDoc}