Search in sources :

Example 1 with ProgressStartEvent

use of org.gradle.internal.logging.events.ProgressStartEvent 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 it has no parent ID, assign this operation as the root operation
        if (startEvent.getParentId() == null && BUILD_PROGRESS_CATEGORY.equals(startEvent.getCategory())) {
            rootOperationId = startEvent.getOperationId();
            buildStarted(startEvent);
        }
    } else if (event instanceof ProgressCompleteEvent) {
        ProgressCompleteEvent completeEvent = (ProgressCompleteEvent) event;
        if (completeEvent.getOperationId().equals(rootOperationId)) {
            rootOperationId = null;
            buildFinished(completeEvent);
        }
    } else if (event instanceof ProgressEvent) {
        ProgressEvent progressEvent = (ProgressEvent) event;
        if (progressEvent.getOperationId().equals(rootOperationId)) {
            buildProgressed(progressEvent);
        }
    }
}
Also used : ProgressStartEvent(org.gradle.internal.logging.events.ProgressStartEvent) ProgressCompleteEvent(org.gradle.internal.logging.events.ProgressCompleteEvent) ProgressEvent(org.gradle.internal.logging.events.ProgressEvent)

Example 2 with ProgressStartEvent

use of org.gradle.internal.logging.events.ProgressStartEvent 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 3 with ProgressStartEvent

use of org.gradle.internal.logging.events.ProgressStartEvent in project gradle by gradle.

the class ProgressStartEventSerializer method read.

@Override
public ProgressStartEvent read(Decoder decoder) throws Exception {
    OperationIdentifier id = new OperationIdentifier(decoder.readSmallLong());
    OperationIdentifier parentId = decoder.readBoolean() ? new OperationIdentifier(decoder.readSmallLong()) : null;
    long timestamp = decoder.readLong();
    String category = decoder.readString();
    String description = decoder.readString();
    String shortDescription = decoder.readNullableString();
    String loggingHeader = decoder.readNullableString();
    String status = decoder.readString();
    return new ProgressStartEvent(id, parentId, timestamp, category, description, shortDescription, loggingHeader, status);
}
Also used : ProgressStartEvent(org.gradle.internal.logging.events.ProgressStartEvent) OperationIdentifier(org.gradle.internal.logging.events.OperationIdentifier)

Aggregations

ProgressStartEvent (org.gradle.internal.logging.events.ProgressStartEvent)3 ProgressCompleteEvent (org.gradle.internal.logging.events.ProgressCompleteEvent)2 ProgressEvent (org.gradle.internal.logging.events.ProgressEvent)2 EndOutputEvent (org.gradle.internal.logging.events.EndOutputEvent)1 OperationIdentifier (org.gradle.internal.logging.events.OperationIdentifier)1