use of org.gradle.internal.operations.OperationIdentifier in project gradle by gradle.
the class WorkInProgressRenderer method renderNow.
private void renderNow() {
if (queue.isEmpty()) {
return;
}
// Skip processing of any operations that both start and complete in the queue
Set<OperationIdentifier> completeEventOperationIds = toOperationIdSet(Iterables.filter(queue, ProgressCompleteEvent.class));
Set<OperationIdentifier> operationIdsToSkip = new HashSet<OperationIdentifier>();
for (OutputEvent event : queue) {
if (event instanceof ProgressStartEvent) {
progressArea.setVisible(true);
ProgressStartEvent startEvent = (ProgressStartEvent) event;
if (completeEventOperationIds.contains(startEvent.getProgressOperationId())) {
operationIdsToSkip.add(startEvent.getProgressOperationId());
// Don't attach to any labels
} else {
attach(operations.start(startEvent.getShortDescription(), startEvent.getStatus(), startEvent.getCategory(), startEvent.getProgressOperationId(), startEvent.getParentProgressOperationId()));
}
} else if (event instanceof ProgressCompleteEvent) {
ProgressCompleteEvent completeEvent = (ProgressCompleteEvent) event;
if (!operationIdsToSkip.contains(completeEvent.getProgressOperationId())) {
detach(operations.complete(completeEvent.getProgressOperationId()));
}
} else if (event instanceof ProgressEvent) {
ProgressEvent progressEvent = (ProgressEvent) event;
if (!operationIdsToSkip.contains(progressEvent.getProgressOperationId())) {
operations.progress(progressEvent.getStatus(), progressEvent.getProgressOperationId());
}
}
}
queue.clear();
for (AssociationLabel associatedLabel : operationIdToAssignedLabels.values()) {
associatedLabel.renderNow();
}
for (StyledLabel emptyLabel : unusedProgressLabels) {
emptyLabel.setText(labelFormatter.format());
}
}
use of org.gradle.internal.operations.OperationIdentifier in project gradle by gradle.
the class ProgressCompleteEventSerializer method read.
@Override
public ProgressCompleteEvent read(Decoder decoder) throws Exception {
OperationIdentifier id = new OperationIdentifier(decoder.readSmallLong());
long timestamp = decoder.readLong();
String status = decoder.readString();
boolean failed = decoder.readBoolean();
return new ProgressCompleteEvent(id, timestamp, status, failed);
}
use of org.gradle.internal.operations.OperationIdentifier in project gradle by gradle.
the class StyledTextOutputEventSerializer method read.
@Override
public StyledTextOutputEvent read(Decoder decoder) throws Exception {
long timestamp = decoder.readLong();
String category = decoder.readString();
LogLevel logLevel = logLevelSerializer.read(decoder);
OperationIdentifier buildOperationId = decoder.readBoolean() ? new OperationIdentifier(decoder.readSmallLong()) : null;
List<StyledTextOutputEvent.Span> spans = spanSerializer.read(decoder);
return new StyledTextOutputEvent(timestamp, category, logLevel, buildOperationId, spans);
}
use of org.gradle.internal.operations.OperationIdentifier in project gradle by gradle.
the class TestListenerBuildOperationAdapter method createTestBuildOperationDescriptor.
private BuildOperationDescriptor createTestBuildOperationDescriptor(TestDescriptor testDescriptor, TestStartEvent testStartEvent) {
Details details = new Details(testDescriptor, testStartEvent.getStartTime());
InProgressExecuteTestBuildOperation parentOperation = runningTests.get(testDescriptor.getParent());
OperationIdentifier parentId = parentOperation == null ? CurrentBuildOperationRef.instance().getId() : parentOperation.descriptor.getId();
return BuildOperationDescriptor.displayName(testDescriptor.getName()).details(details).build(newOperationIdentifier(), parentId);
}
use of org.gradle.internal.operations.OperationIdentifier 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);
}
}
Aggregations