Search in sources :

Example 1 with DefaultArtifactCaches

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;
}
Also used : DefaultArtifactCaches(org.gradle.api.internal.artifacts.ivyservice.DefaultArtifactCaches) BuildResult(org.gradle.BuildResult) BuildAdapter(org.gradle.BuildAdapter)

Aggregations

BuildAdapter (org.gradle.BuildAdapter)1 BuildResult (org.gradle.BuildResult)1 DefaultArtifactCaches (org.gradle.api.internal.artifacts.ivyservice.DefaultArtifactCaches)1