use of org.gradle.internal.logging.events.OutputEvent 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.logging.events.OutputEvent in project gradle by gradle.
the class ThrottlingOutputEventListener method renderNow.
private void renderNow(long now) {
if (queue.isEmpty()) {
// Already rendered - don't update anything
return;
}
for (OutputEvent event : queue) {
listener.onOutput(event);
}
queue.clear();
lastUpdate = now;
}
Aggregations