Search in sources :

Example 1 with TaskOperationDescriptor

use of org.gradle.api.execution.internal.TaskOperationDescriptor in project gradle by gradle.

the class ClientForwardingTaskOperationListener method finished.

@Override
public void finished(BuildOperationInternal buildOperation, OperationResult finishEvent) {
    if (skipEvents.remove(buildOperation.getId())) {
        return;
    }
    if (buildOperation.getOperationDescriptor() instanceof TaskOperationDescriptor) {
        TaskInternal task = ((TaskOperationDescriptor) buildOperation.getOperationDescriptor()).getTask();
        eventConsumer.dispatch(new DefaultTaskFinishedProgressEvent(finishEvent.getEndTime(), toTaskDescriptor(buildOperation, task), toTaskResult(task, finishEvent)));
    } else {
        delegate.finished(buildOperation, finishEvent);
    }
}
Also used : DefaultTaskFinishedProgressEvent(org.gradle.tooling.internal.provider.events.DefaultTaskFinishedProgressEvent) TaskInternal(org.gradle.api.internal.TaskInternal) TaskOperationDescriptor(org.gradle.api.execution.internal.TaskOperationDescriptor)

Example 2 with TaskOperationDescriptor

use of org.gradle.api.execution.internal.TaskOperationDescriptor 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 3 with TaskOperationDescriptor

use of org.gradle.api.execution.internal.TaskOperationDescriptor in project gradle by gradle.

the class ClientForwardingTestOperationListener method started.

@Override
public void started(BuildOperationInternal buildOperation, OperationStartEvent startEvent) {
    if (!(buildOperation.getOperationDescriptor() instanceof TaskOperationDescriptor)) {
        return;
    }
    TaskInternal task = ((TaskOperationDescriptor) buildOperation.getOperationDescriptor()).getTask();
    if (!(task instanceof Test)) {
        return;
    }
    runningTasks.put(buildOperation.getId(), task.getPath());
}
Also used : Test(org.gradle.api.tasks.testing.Test) TaskInternal(org.gradle.api.internal.TaskInternal) TaskOperationDescriptor(org.gradle.api.execution.internal.TaskOperationDescriptor)

Example 4 with TaskOperationDescriptor

use of org.gradle.api.execution.internal.TaskOperationDescriptor in project gradle by gradle.

the class TestExecutionResultEvaluator method started.

@Override
public void started(BuildOperationInternal buildOperation, OperationStartEvent startEvent) {
    if (!(buildOperation.getOperationDescriptor() instanceof TaskOperationDescriptor)) {
        return;
    }
    TaskInternal task = ((TaskOperationDescriptor) buildOperation.getOperationDescriptor()).getTask();
    runningTasks.put(buildOperation.getId(), task.getPath());
}
Also used : TaskInternal(org.gradle.api.internal.TaskInternal) TaskOperationDescriptor(org.gradle.api.execution.internal.TaskOperationDescriptor)

Aggregations

TaskOperationDescriptor (org.gradle.api.execution.internal.TaskOperationDescriptor)4 TaskInternal (org.gradle.api.internal.TaskInternal)4 Test (org.gradle.api.tasks.testing.Test)1 DefaultTaskFinishedProgressEvent (org.gradle.tooling.internal.provider.events.DefaultTaskFinishedProgressEvent)1 DefaultTaskStartedProgressEvent (org.gradle.tooling.internal.provider.events.DefaultTaskStartedProgressEvent)1