use of org.gradle.internal.progress.BuildOperationListener in project gradle by gradle.
the class SubscribableBuildActionRunner method registerListenersForClientSubscriptions.
private void registerListenersForClientSubscriptions(BuildClientSubscriptions clientSubscriptions, GradleInternal gradle) {
BuildEventConsumer eventConsumer = gradle.getServices().get(BuildEventConsumer.class);
if (clientSubscriptions.isSendTestProgressEvents()) {
registerListener(new ClientForwardingTestOperationListener(eventConsumer, clientSubscriptions));
}
if (!clientSubscriptions.isSendBuildProgressEvents() && !clientSubscriptions.isSendTaskProgressEvents()) {
return;
}
BuildOperationListener buildListener = NO_OP;
if (clientSubscriptions.isSendBuildProgressEvents()) {
buildListener = new ClientForwardingBuildOperationListener(eventConsumer);
}
buildListener = new ClientForwardingTaskOperationListener(eventConsumer, clientSubscriptions, buildListener);
registerListener(buildListener);
}
use of org.gradle.internal.progress.BuildOperationListener 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);
}
}
}
Aggregations