use of org.gradle.tooling.internal.provider.events.DefaultTaskSkippedResult in project gradle by gradle.
the class ClientForwardingTaskOperationListener method toTaskResult.
private static AbstractTaskResult toTaskResult(TaskInternal task, OperationResult result) {
TaskStateInternal state = task.getState();
long startTime = result.getStartTime();
long endTime = result.getEndTime();
if (state.getUpToDate()) {
return new DefaultTaskSuccessResult(startTime, endTime, true, state.isFromCache(), state.getSkipMessage());
} else if (state.getSkipped()) {
return new DefaultTaskSkippedResult(startTime, endTime, state.getSkipMessage());
} else {
Throwable failure = result.getFailure();
if (failure == null) {
return new DefaultTaskSuccessResult(startTime, endTime, false, state.isFromCache(), "SUCCESS");
} else {
return new DefaultTaskFailureResult(startTime, endTime, Collections.singletonList(DefaultFailure.fromThrowable(failure)));
}
}
}
use of org.gradle.tooling.internal.provider.events.DefaultTaskSkippedResult in project gradle by gradle.
the class ClientForwardingTaskOperationListener method toTaskResult.
private static AbstractTaskResult toTaskResult(TaskInternal task, OperationFinishEvent result) {
TaskStateInternal state = task.getState();
long startTime = result.getStartTime();
long endTime = result.getEndTime();
if (state.getUpToDate()) {
return new DefaultTaskSuccessResult(startTime, endTime, true, state.isFromCache(), state.getSkipMessage());
} else if (state.getSkipped()) {
return new DefaultTaskSkippedResult(startTime, endTime, state.getSkipMessage());
} else {
Throwable failure = result.getFailure();
if (failure == null) {
return new DefaultTaskSuccessResult(startTime, endTime, false, state.isFromCache(), "SUCCESS");
} else {
return new DefaultTaskFailureResult(startTime, endTime, Collections.singletonList(DefaultFailure.fromThrowable(failure)));
}
}
}
Aggregations