use of org.gradle.internal.logging.events.EndOutputEvent in project gradle by gradle.
the class OutputEventRenderer method restore.
@Override
public void restore(Snapshot state) {
synchronized (lock) {
SnapshotImpl snapshot = (SnapshotImpl) state;
if (snapshot.logLevel != logLevel.get()) {
configure(snapshot.logLevel);
}
// TODO - also close console when it is replaced
if (snapshot.console != console) {
if (snapshot.console == null) {
formatters.remove(console);
console.onOutput(new EndOutputEvent());
console = null;
} else {
throw new UnsupportedOperationException("Cannot restore previous console. This is not implemented yet.");
}
}
}
}
use of org.gradle.internal.logging.events.EndOutputEvent in project gradle by gradle.
the class OutputEventRenderer method removeChain.
private void removeChain(OutputEventListener listener) {
formatters.remove(listener);
listener.onOutput(new EndOutputEvent());
}
use of org.gradle.internal.logging.events.EndOutputEvent in project gradle by gradle.
the class WorkInProgressRenderer method onOutput.
@Override
public void onOutput(OutputEvent event) {
if (event instanceof ProgressStartEvent) {
progressArea.setVisible(true);
ProgressStartEvent startEvent = (ProgressStartEvent) event;
ProgressOperation op = operations.start(startEvent.getShortDescription(), startEvent.getStatus(), startEvent.getCategory(), startEvent.getOperationId(), startEvent.getParentId());
attach(op);
} else if (event instanceof ProgressCompleteEvent) {
ProgressCompleteEvent completeEvent = (ProgressCompleteEvent) event;
detach(operations.complete(completeEvent.getOperationId()));
} else if (event instanceof ProgressEvent) {
ProgressEvent progressEvent = (ProgressEvent) event;
operations.progress(progressEvent.getStatus(), progressEvent.getOperationId());
} else if (event instanceof EndOutputEvent) {
progressArea.setVisible(false);
}
listener.onOutput(event);
}
use of org.gradle.internal.logging.events.EndOutputEvent in project gradle by gradle.
the class BuildStatusRenderer method onOutput.
@Override
public void onOutput(OutputEvent event) {
if (event instanceof ProgressStartEvent) {
ProgressStartEvent startEvent = (ProgressStartEvent) event;
if (startEvent.isBuildOperationStart()) {
if (buildStartTimestamp == 0 && startEvent.getParentProgressOperationId() == null) {
// The very first event starts the Initializing phase
// TODO - should use BuildRequestMetaData to determine the build start time
buildStartTimestamp = startEvent.getTimestamp();
buildProgressOperationId = startEvent.getProgressOperationId();
phaseStarted(startEvent, Phase.Initializing);
} else if (startEvent.getBuildOperationCategory() == BuildOperationCategory.CONFIGURE_ROOT_BUILD) {
// Once the root build starts configuring, we are in Configuring phase
phaseStarted(startEvent, Phase.Configuring);
} else if (startEvent.getBuildOperationCategory() == BuildOperationCategory.CONFIGURE_BUILD && currentPhase == Phase.Configuring) {
// Any configuring event received from nested or buildSrc builds before the root build starts configuring is ignored
phaseHasMoreProgress(startEvent);
} else if (startEvent.getBuildOperationCategory() == BuildOperationCategory.CONFIGURE_PROJECT && currentPhase == Phase.Configuring) {
// Any configuring event received from nested or buildSrc builds before the root build starts configuring is ignored
currentPhaseChildren.add(startEvent.getProgressOperationId());
} else if (startEvent.getBuildOperationCategory() == BuildOperationCategory.RUN_MAIN_TASKS) {
phaseStarted(startEvent, Phase.Executing);
} else if (startEvent.getBuildOperationCategory() == BuildOperationCategory.RUN_WORK && currentPhase == Phase.Executing) {
// Any work execution happening in nested or buildSrc builds before the root build has started executing work is ignored
phaseHasMoreProgress(startEvent);
} else if (startEvent.getBuildOperationCategory().isTopLevelWorkItem() && currentPhase == Phase.Executing) {
// Any work execution happening in nested or buildSrc builds before the root build has started executing work is ignored
currentPhaseChildren.add(startEvent.getProgressOperationId());
}
}
} else if (event instanceof ProgressCompleteEvent) {
ProgressCompleteEvent completeEvent = (ProgressCompleteEvent) event;
if (completeEvent.getProgressOperationId().equals(buildProgressOperationId)) {
buildEnded();
} else if (currentPhaseChildren.remove(completeEvent.getProgressOperationId())) {
phaseProgressed(completeEvent);
}
}
listener.onOutput(event);
if (event instanceof UpdateNowEvent) {
currentTimePeriod = ((UpdateNowEvent) event).getTimestamp();
renderNow(currentTimePeriod);
} else if (event instanceof EndOutputEvent || event instanceof FlushOutputEvent) {
renderNow(currentTimePeriod);
}
}
Aggregations