BuildActionExecuter.Builder (Gradle API 8.13)
Description: declaration: package: org.gradle.tooling, interface: BuildActionExecuter, interface: Builder

Package org.gradle.tooling

# Interface BuildActionExecuter.Builder

Enclosing interface:
  BuildActionExecuter<T>

public static interface BuildActionExecuter.Builder
Builder for a build action that hooks into different phases of the build.

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

Since:
  4.8

- ## Method Summary

  Modifier and Type
  Method
  Description
  `BuildActionExecuter<Void>`
  `build()`
  Builds the executer from the added actions.
  `<T> BuildActionExecuter.Builder`
  `buildFinished(BuildAction<T> buildAction, IntermediateResultHandler<? super T> handler)`
  Executes the given action after tasks are run and sends its result to the given result handler.
  `<T> BuildActionExecuter.Builder`
  `projectsLoaded(BuildAction<T> buildAction, IntermediateResultHandler<? super T> handler)`
  Executes the given action after projects are loaded and sends its result to the given result handler.

- ## Method Details

  - ### projectsLoaded

    <T> BuildActionExecuter.Builder projectsLoaded(BuildAction<T> buildAction, IntermediateResultHandler<? super T> handler) throws IllegalArgumentException
    Executes the given action after projects are loaded and sends its result to the given result handler.

    Action will be executed after projects are loaded and Gradle will configure projects as necessary for the models requested.

    If the operation fails, build will fail with the appropriate exception. The handler won't be notified in case of failure.

    Type Parameters:
      `T` - The returning type of the action.
    Parameters:
      `buildAction` - The action to run in the specified build phase.
      `handler` - The handler to supply the result of the given action to.
    Returns:
      The builder.
    Throws:
      `IllegalArgumentException` - If an action has already been added to this build phase. Multiple actions per phase are not supported yet.

  - ### buildFinished

    <T> BuildActionExecuter.Builder buildFinished(BuildAction<T> buildAction, IntermediateResultHandler<? super T> handler) throws IllegalArgumentException
    Executes the given action after tasks are run and sends its result to the given result handler.

    If the operation fails, build will fail with the appropriate exception. The handler won't be notified in case of failure.

    Type Parameters:
      `T` - The returning type of the action.
    Parameters:
      `buildAction` - The action to run in the specified build phase.
      `handler` - The handler to supply the result of the given action to.
    Returns:
      The builder.
    Throws:
      `IllegalArgumentException` - If an action has already been added to this build phase. Multiple actions per phase are not supported yet.

  - ### build

    BuildActionExecuter<Void> build()
    Builds the executer from the added actions.
    Returns:
      The executer.