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

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `BuildActionExecuter<java.lang.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 Detail

    - #### projectsLoaded

          <T> BuildActionExecuter.Builder projectsLoaded​(BuildAction<T> buildAction,
                                                         IntermediateResultHandler<? super T> handler)
                                                  throws java.lang.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:
        `java.lang.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 java.lang.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:
        `java.lang.IllegalArgumentException` - If an action has already been added to this build phase. Multiple actions per phase are not supported yet.

    - #### build

          BuildActionExecuter<java.lang.Void> build()

      Builds the executer from the added actions.
      Returns:
        The executer.