use of org.gradle.internal.execution.OutputSnapshotter.OutputFileSnapshottingException in project gradle by gradle.
the class CaptureStateBeforeExecutionStep method captureExecutionState.
@Nonnull
private Optional<BeforeExecutionState> captureExecutionState(UnitOfWork work, PreviousExecutionContext context) {
return operation(operationContext -> {
ImmutableSortedMap<String, FileSystemSnapshot> unfilteredOutputSnapshots;
try {
unfilteredOutputSnapshots = outputSnapshotter.snapshotOutputs(work, context.getWorkspace());
} catch (OutputFileSnapshottingException e) {
work.handleUnreadableOutputs(e);
operationContext.setResult(Operation.Result.INSTANCE);
return Optional.empty();
}
try {
BeforeExecutionState executionState = captureExecutionStateWithOutputs(work, context, unfilteredOutputSnapshots);
operationContext.setResult(Operation.Result.INSTANCE);
return Optional.of(executionState);
} catch (InputFileFingerprintingException e) {
// Note that we let InputFingerprintException fall through as we've already
// been failing for non-file value fingerprinting problems even for tasks
work.handleUnreadableInputs(e);
operationContext.setResult(Operation.Result.INSTANCE);
return Optional.empty();
}
}, BuildOperationDescriptor.displayName("Snapshot inputs and outputs before executing " + work.getDisplayName()).details(Operation.Details.INSTANCE));
}
Aggregations