Search in sources :

Example 1 with EndOutputEvent

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.");
            }
        }
    }
}
Also used : EndOutputEvent(org.gradle.internal.logging.events.EndOutputEvent)

Example 2 with EndOutputEvent

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());
}
Also used : EndOutputEvent(org.gradle.internal.logging.events.EndOutputEvent)

Example 3 with 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);
}
Also used : ProgressStartEvent(org.gradle.internal.logging.events.ProgressStartEvent) ProgressCompleteEvent(org.gradle.internal.logging.events.ProgressCompleteEvent) ProgressEvent(org.gradle.internal.logging.events.ProgressEvent) EndOutputEvent(org.gradle.internal.logging.events.EndOutputEvent)

Example 4 with EndOutputEvent

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);
    }
}
Also used : UpdateNowEvent(org.gradle.internal.logging.events.UpdateNowEvent) ProgressStartEvent(org.gradle.internal.logging.events.ProgressStartEvent) FlushOutputEvent(org.gradle.internal.logging.events.FlushOutputEvent) ProgressCompleteEvent(org.gradle.internal.logging.events.ProgressCompleteEvent) EndOutputEvent(org.gradle.internal.logging.events.EndOutputEvent)

Aggregations

EndOutputEvent (org.gradle.internal.logging.events.EndOutputEvent)4 ProgressCompleteEvent (org.gradle.internal.logging.events.ProgressCompleteEvent)2 ProgressStartEvent (org.gradle.internal.logging.events.ProgressStartEvent)2 FlushOutputEvent (org.gradle.internal.logging.events.FlushOutputEvent)1 ProgressEvent (org.gradle.internal.logging.events.ProgressEvent)1 UpdateNowEvent (org.gradle.internal.logging.events.UpdateNowEvent)1