Search in sources :

Example 1 with DefaultTaskStartedProgressEvent

use of org.gradle.tooling.internal.provider.events.DefaultTaskStartedProgressEvent in project gradle by gradle.

the class ClientForwardingTaskOperationListener method started.

@Override
public void started(BuildOperationInternal buildOperation, OperationStartEvent startEvent) {
    if (skipEvents.contains(buildOperation.getParentId())) {
        skipEvents.add(buildOperation.getId());
        return;
    }
    if (buildOperation.getOperationDescriptor() instanceof TaskOperationDescriptor) {
        if (clientSubscriptions.isSendTaskProgressEvents()) {
            TaskInternal task = ((TaskOperationDescriptor) buildOperation.getOperationDescriptor()).getTask();
            eventConsumer.dispatch(new DefaultTaskStartedProgressEvent(startEvent.getStartTime(), toTaskDescriptor(buildOperation, task)));
        } else {
            // Discard this operation and all children
            skipEvents.add(buildOperation.getId());
        }
    } else {
        delegate.started(buildOperation, startEvent);
    }
}
Also used : DefaultTaskStartedProgressEvent(org.gradle.tooling.internal.provider.events.DefaultTaskStartedProgressEvent) TaskInternal(org.gradle.api.internal.TaskInternal) TaskOperationDescriptor(org.gradle.api.execution.internal.TaskOperationDescriptor)

Example 2 with DefaultTaskStartedProgressEvent

use of org.gradle.tooling.internal.provider.events.DefaultTaskStartedProgressEvent in project gradle by gradle.

the class ClientForwardingTaskOperationListener method started.

@Override
public void started(BuildOperationDescriptor buildOperation, OperationStartEvent startEvent) {
    OperationIdentifier parentId = buildOperation.getParentId();
    if (parentId != null && skipEvents.contains(parentId)) {
        skipEvents.add(buildOperation.getId());
        return;
    }
    if (buildOperation.getDetails() instanceof ExecuteTaskBuildOperationDetails) {
        if (clientSubscriptions.isSendTaskProgressEvents()) {
            Task task = ((ExecuteTaskBuildOperationDetails) buildOperation.getDetails()).getTask();
            eventConsumer.dispatch(new DefaultTaskStartedProgressEvent(startEvent.getStartTime(), toTaskDescriptor(buildOperation, (TaskInternal) task)));
        } else {
            // Discard this operation and all children
            skipEvents.add(buildOperation.getId());
        }
    } else {
        delegate.started(buildOperation, startEvent);
    }
}
Also used : Task(org.gradle.api.Task) ExecuteTaskBuildOperationDetails(org.gradle.api.execution.internal.ExecuteTaskBuildOperationDetails) DefaultTaskStartedProgressEvent(org.gradle.tooling.internal.provider.events.DefaultTaskStartedProgressEvent) OperationIdentifier(org.gradle.internal.operations.OperationIdentifier)

Aggregations

DefaultTaskStartedProgressEvent (org.gradle.tooling.internal.provider.events.DefaultTaskStartedProgressEvent)2 Task (org.gradle.api.Task)1 ExecuteTaskBuildOperationDetails (org.gradle.api.execution.internal.ExecuteTaskBuildOperationDetails)1 TaskOperationDescriptor (org.gradle.api.execution.internal.TaskOperationDescriptor)1 TaskInternal (org.gradle.api.internal.TaskInternal)1 OperationIdentifier (org.gradle.internal.operations.OperationIdentifier)1