use of org.gradle.internal.execution.caching.CachingStateFactory in project gradle by gradle.
the class ResolveCachingStateStep method calculateCachingState.
private CachingState calculateCachingState(UnitOfWork work, BeforeExecutionState beforeExecutionState) {
Logger logger = buildCache.isEmitDebugLogging() ? LOGGER : NOPLogger.NOP_LOGGER;
CachingStateFactory cachingStateFactory = new DefaultCachingStateFactory(logger);
ImmutableList.Builder<CachingDisabledReason> cachingDisabledReasonsBuilder = ImmutableList.builder();
if (!buildCache.isEnabled()) {
cachingDisabledReasonsBuilder.add(BUILD_CACHE_DISABLED_REASON);
}
OverlappingOutputs detectedOverlappingOutputs = beforeExecutionState.getDetectedOverlappingOutputs().orElse(null);
work.shouldDisableCaching(detectedOverlappingOutputs).ifPresent(cachingDisabledReasonsBuilder::add);
return cachingStateFactory.createCachingState(beforeExecutionState, cachingDisabledReasonsBuilder.build());
}
Aggregations