use of org.gradle.api.internal.artifacts.ivyservice.DefaultArtifactCaches in project gradle by gradle.
the class DependencyManagementGradleUserHomeScopeServices method createArtifactCaches.
ArtifactCachesProvider createArtifactCaches(GlobalScopedCache globalScopedCache, CacheRepository cacheRepository, DefaultArtifactCaches.WritableArtifactCacheLockingParameters parameters, ListenerManager listenerManager, DocumentationRegistry documentationRegistry) {
DefaultArtifactCaches artifactCachesProvider = new DefaultArtifactCaches(globalScopedCache, cacheRepository, parameters, documentationRegistry);
listenerManager.addListener(new BuildAdapter() {
@SuppressWarnings("deprecation")
@Override
public void buildFinished(BuildResult result) {
artifactCachesProvider.getWritableCacheLockingManager().useCache(() -> {
// forces cleanup even if cache wasn't used
});
}
});
return artifactCachesProvider;
}
Aggregations