Search in sources :

Example 1 with SubscribableBuildAction

use of org.gradle.tooling.internal.provider.SubscribableBuildAction in project gradle by gradle.

the class SubscribableBuildActionRunner method run.

@Override
public void run(BuildAction action, BuildController buildController) {
    if (!(action instanceof SubscribableBuildAction)) {
        return;
    }
    GradleInternal gradle = buildController.getGradle();
    SubscribableBuildAction subscribableBuildAction = (SubscribableBuildAction) action;
    // register listeners that dispatch all progress via the registered BuildEventConsumer instance,
    // this allows to send progress events back to the DaemonClient (via short-cut)
    registerListenersForClientSubscriptions(subscribableBuildAction.getClientSubscriptions(), gradle);
    try {
        delegate.run(action, buildController);
    } finally {
        for (BuildOperationListener listener : listeners) {
            buildOperationService.removeListener(listener);
        }
    }
}
Also used : GradleInternal(org.gradle.api.internal.GradleInternal) BuildOperationListener(org.gradle.internal.progress.BuildOperationListener) SubscribableBuildAction(org.gradle.tooling.internal.provider.SubscribableBuildAction)

Aggregations

GradleInternal (org.gradle.api.internal.GradleInternal)1 BuildOperationListener (org.gradle.internal.progress.BuildOperationListener)1 SubscribableBuildAction (org.gradle.tooling.internal.provider.SubscribableBuildAction)1