Search in sources :

Example 1 with ExecuteTaskBuildOperationDetails

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

the class ClientForwardingTaskOperationListener method finished.

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

Example 2 with ExecuteTaskBuildOperationDetails

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

the class ClientForwardingTestOperationListener method started.

@Override
public void started(BuildOperationDescriptor buildOperation, OperationStartEvent startEvent) {
    Object details = buildOperation.getDetails();
    if (details instanceof ExecuteTaskBuildOperationDetails) {
        Task task = ((ExecuteTaskBuildOperationDetails) details).getTask();
        if (!(task instanceof Test)) {
            return;
        }
        runningTasks.put(buildOperation.getId(), task.getPath());
    } else if (details instanceof ExecuteTestBuildOperationType.Details) {
        ExecuteTestBuildOperationType.Details testOperationDetails = (ExecuteTestBuildOperationType.Details) details;
        TestDescriptorInternal testDescriptor = (TestDescriptorInternal) testOperationDetails.getTestDescriptor();
        eventConsumer.dispatch(new DefaultTestStartedProgressEvent(testOperationDetails.getStartTime(), adapt(testDescriptor)));
    }
}
Also used : Task(org.gradle.api.Task) ExecuteTaskBuildOperationDetails(org.gradle.api.execution.internal.ExecuteTaskBuildOperationDetails) ExecuteTaskBuildOperationDetails(org.gradle.api.execution.internal.ExecuteTaskBuildOperationDetails) TestDescriptorInternal(org.gradle.api.internal.tasks.testing.TestDescriptorInternal) Test(org.gradle.api.tasks.testing.Test) DefaultTestStartedProgressEvent(org.gradle.tooling.internal.provider.events.DefaultTestStartedProgressEvent) ExecuteTestBuildOperationType(org.gradle.api.internal.tasks.testing.operations.ExecuteTestBuildOperationType)

Example 3 with ExecuteTaskBuildOperationDetails

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

the class TestExecutionResultEvaluator method started.

@Override
public void started(BuildOperationDescriptor buildOperation, OperationStartEvent startEvent) {
    if (buildOperation.getDetails() instanceof ExecuteTaskBuildOperationDetails) {
        Task task = ((ExecuteTaskBuildOperationDetails) buildOperation.getDetails()).getTask();
        runningTasks.put(buildOperation.getId(), task.getPath());
    }
}
Also used : Task(org.gradle.api.Task) ExecuteTaskBuildOperationDetails(org.gradle.api.execution.internal.ExecuteTaskBuildOperationDetails)

Example 4 with ExecuteTaskBuildOperationDetails

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

Task (org.gradle.api.Task)4 ExecuteTaskBuildOperationDetails (org.gradle.api.execution.internal.ExecuteTaskBuildOperationDetails)4 TaskInternal (org.gradle.api.internal.TaskInternal)1 TestDescriptorInternal (org.gradle.api.internal.tasks.testing.TestDescriptorInternal)1 ExecuteTestBuildOperationType (org.gradle.api.internal.tasks.testing.operations.ExecuteTestBuildOperationType)1 Test (org.gradle.api.tasks.testing.Test)1 OperationIdentifier (org.gradle.internal.operations.OperationIdentifier)1 DefaultTaskFinishedProgressEvent (org.gradle.tooling.internal.provider.events.DefaultTaskFinishedProgressEvent)1 DefaultTaskStartedProgressEvent (org.gradle.tooling.internal.provider.events.DefaultTaskStartedProgressEvent)1 DefaultTestStartedProgressEvent (org.gradle.tooling.internal.provider.events.DefaultTestStartedProgressEvent)1