use of org.gradle.internal.operations.BuildOperationListener in project gradle by gradle.
the class SubscribableBuildActionRunner method run.
@Override
public void run(BuildAction action, BuildController buildController) {
boolean subscribable = action instanceof SubscribableBuildAction;
if (subscribable) {
GradleInternal gradle = buildController.getGradle();
SubscribableBuildAction subscribableBuildAction = (SubscribableBuildAction) action;
registerListenersForClientSubscriptions(subscribableBuildAction.getClientSubscriptions(), gradle);
}
try {
delegate.run(action, buildController);
} finally {
for (BuildOperationListener listener : listeners) {
buildOperationListenerManager.removeListener(listener);
}
listeners.clear();
}
}
use of org.gradle.internal.operations.BuildOperationListener in project gradle by gradle.
the class ToolingApiSubscribableBuildActionRunnerRegistration method createListeners.
@Override
public Iterable<BuildOperationListener> createListeners(BuildClientSubscriptions clientSubscriptions, BuildEventConsumer consumer) {
List<BuildOperationListener> listeners = new ArrayList<BuildOperationListener>();
if (clientSubscriptions.isSendTestProgressEvents()) {
listeners.add(new ClientForwardingTestOperationListener(consumer, clientSubscriptions));
}
if (clientSubscriptions.isSendBuildProgressEvents() || clientSubscriptions.isSendTaskProgressEvents()) {
BuildOperationListener buildListener = NO_OP;
if (clientSubscriptions.isSendBuildProgressEvents()) {
buildListener = new TestIgnoringBuildOperationListener(new ClientForwardingBuildOperationListener(consumer));
}
listeners.add(new ClientForwardingTaskOperationListener(consumer, clientSubscriptions, buildListener));
}
return listeners;
}
Aggregations