Search in sources :

Example 1 with InMemoryModuleMetadataCache

use of org.gradle.api.internal.artifacts.ivyservice.modulecache.InMemoryModuleMetadataCache in project gradle by gradle.

the class DependencyManagementBuildScopeServices method createModuleRepositoryCacheProvider.

ModuleRepositoryCacheProvider createModuleRepositoryCacheProvider(BuildCommencedTimeProvider timeProvider, ImmutableModuleIdentifierFactory moduleIdentifierFactory, ArtifactCachesProvider artifactCaches, AttributeContainerSerializer attributeContainerSerializer, MavenMutableModuleMetadataFactory mavenMetadataFactory, IvyMutableModuleMetadataFactory ivyMetadataFactory, SimpleMapInterner stringInterner, FileStoreAndIndexProvider fileStoreAndIndexProvider, ModuleSourcesSerializer moduleSourcesSerializer, ChecksumService checksumService) {
    ArtifactIdentifierFileStore artifactIdentifierFileStore = fileStoreAndIndexProvider.getArtifactIdentifierFileStore();
    ModuleRepositoryCaches writableCaches = artifactCaches.withWritableCache((md, manager) -> prepareModuleRepositoryCaches(md, manager, timeProvider, moduleIdentifierFactory, attributeContainerSerializer, mavenMetadataFactory, ivyMetadataFactory, stringInterner, artifactIdentifierFileStore, moduleSourcesSerializer, checksumService));
    AtomicReference<Path> roCachePath = new AtomicReference<>();
    Optional<ModuleRepositoryCaches> readOnlyCaches = artifactCaches.withReadOnlyCache((ro, manager) -> {
        roCachePath.set(ro.getCacheDir().toPath());
        return prepareReadOnlyModuleRepositoryCaches(ro, manager, timeProvider, moduleIdentifierFactory, attributeContainerSerializer, mavenMetadataFactory, ivyMetadataFactory, stringInterner, artifactIdentifierFileStore, moduleSourcesSerializer, checksumService);
    });
    AbstractModuleVersionsCache moduleVersionsCache = readOnlyCaches.map(mrc -> (AbstractModuleVersionsCache) new TwoStageModuleVersionsCache(timeProvider, mrc.moduleVersionsCache, writableCaches.moduleVersionsCache)).orElse(writableCaches.moduleVersionsCache);
    AbstractModuleMetadataCache persistentModuleMetadataCache = readOnlyCaches.map(mrc -> (AbstractModuleMetadataCache) new TwoStageModuleMetadataCache(timeProvider, mrc.moduleMetadataCache, writableCaches.moduleMetadataCache)).orElse(writableCaches.moduleMetadataCache);
    AbstractArtifactsCache moduleArtifactsCache = readOnlyCaches.map(mrc -> (AbstractArtifactsCache) new TwoStageArtifactsCache(timeProvider, mrc.moduleArtifactsCache, writableCaches.moduleArtifactsCache)).orElse(writableCaches.moduleArtifactsCache);
    ModuleArtifactCache moduleArtifactCache = readOnlyCaches.map(mrc -> (ModuleArtifactCache) new TwoStageModuleArtifactCache(roCachePath.get(), mrc.moduleArtifactCache, writableCaches.moduleArtifactCache)).orElse(writableCaches.moduleArtifactCache);
    ModuleRepositoryCaches persistentCaches = new ModuleRepositoryCaches(new InMemoryModuleVersionsCache(timeProvider, moduleVersionsCache), new InMemoryModuleMetadataCache(timeProvider, persistentModuleMetadataCache), new InMemoryModuleArtifactsCache(timeProvider, moduleArtifactsCache), new InMemoryModuleArtifactCache(timeProvider, moduleArtifactCache));
    ModuleRepositoryCaches inMemoryOnlyCaches = new ModuleRepositoryCaches(new InMemoryModuleVersionsCache(timeProvider), new InMemoryModuleMetadataCache(timeProvider), new InMemoryModuleArtifactsCache(timeProvider), new InMemoryModuleArtifactCache(timeProvider));
    return new ModuleRepositoryCacheProvider(persistentCaches, inMemoryOnlyCaches);
}
Also used : ArtifactIdentifierFileStore(org.gradle.api.internal.filestore.ArtifactIdentifierFileStore) DefaultArtifactIdentifierFileStore(org.gradle.api.internal.filestore.DefaultArtifactIdentifierFileStore) TwoStageArtifactIdentifierFileStore(org.gradle.api.internal.filestore.TwoStageArtifactIdentifierFileStore) Path(java.nio.file.Path) NamedObjectInstantiator(org.gradle.api.internal.model.NamedObjectInstantiator) ProjectDependencyResolver(org.gradle.api.internal.artifacts.ivyservice.projectmodule.ProjectDependencyResolver) ValidateStep(org.gradle.internal.execution.steps.ValidateStep) BuildState(org.gradle.internal.build.BuildState) StartParameterResolutionOverride(org.gradle.api.internal.artifacts.ivyservice.ivyresolve.StartParameterResolutionOverride) ComponentSelectionDescriptorFactory(org.gradle.api.internal.artifacts.ivyservice.resolveengine.result.ComponentSelectionDescriptorFactory) AssignWorkspaceStep(org.gradle.internal.execution.steps.AssignWorkspaceStep) ProgressLoggerFactory(org.gradle.internal.logging.progress.ProgressLoggerFactory) InMemoryModuleArtifactCache(org.gradle.api.internal.artifacts.ivyservice.modulecache.artifacts.InMemoryModuleArtifactCache) ExecutionResult(org.gradle.internal.execution.ExecutionResult) Duration(java.time.Duration) Map(java.util.Map) ModuleMetadataSerializer(org.gradle.api.internal.artifacts.ivyservice.modulecache.ModuleMetadataSerializer) FileStoreAndIndexProvider(org.gradle.api.internal.artifacts.ivyservice.modulecache.FileStoreAndIndexProvider) AbstractArtifactsCache(org.gradle.api.internal.artifacts.ivyservice.modulecache.artifacts.AbstractArtifactsCache) ValueSnapshotter(org.gradle.internal.snapshot.ValueSnapshotter) Path(java.nio.file.Path) Step(org.gradle.internal.execution.steps.Step) RuntimeShadedJarFactory(org.gradle.api.internal.runtimeshaded.RuntimeShadedJarFactory) TwoStageModuleVersionsCache(org.gradle.api.internal.artifacts.ivyservice.modulecache.dynamicversions.TwoStageModuleVersionsCache) CalculatedValueContainerFactory(org.gradle.internal.model.CalculatedValueContainerFactory) Capability(org.gradle.api.capabilities.Capability) DesugaredAttributeContainerSerializer(org.gradle.api.internal.artifacts.ivyservice.resolveengine.result.DesugaredAttributeContainerSerializer) ModuleRepositoryCacheProvider(org.gradle.api.internal.artifacts.ivyservice.modulecache.ModuleRepositoryCacheProvider) BroadcastChangingOutputsStep(org.gradle.internal.execution.steps.BroadcastChangingOutputsStep) PersistentModuleMetadataCache(org.gradle.api.internal.artifacts.ivyservice.modulecache.PersistentModuleMetadataCache) ResolverProviderFactory(org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ResolverProviderFactory) NotationParser(org.gradle.internal.typeconversion.NotationParser) ExternalResourceAccessor(org.gradle.api.internal.artifacts.repositories.resolver.ExternalResourceAccessor) OutputSnapshotter(org.gradle.internal.execution.OutputSnapshotter) ExecuteStep(org.gradle.internal.execution.steps.ExecuteStep) ChangingValueDependencyResolutionListener(org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ChangingValueDependencyResolutionListener) ExecutionEngine(org.gradle.internal.execution.ExecutionEngine) FeaturePreviews(org.gradle.api.internal.FeaturePreviews) RelativeFilePathResolver(org.gradle.internal.file.RelativeFilePathResolver) LocallyAvailableResourceFinderFactory(org.gradle.internal.resource.local.ivy.LocallyAvailableResourceFinderFactory) ClasspathWalker(org.gradle.internal.classpath.ClasspathWalker) DefaultLocalMavenRepositoryLocator(org.gradle.api.internal.artifacts.mvnsettings.DefaultLocalMavenRepositoryLocator) UnitOfWork(org.gradle.internal.execution.UnitOfWork) ResolveChangesStep(org.gradle.internal.execution.steps.ResolveChangesStep) ClassPathRegistry(org.gradle.api.internal.ClassPathRegistry) InMemoryModuleArtifactsCache(org.gradle.api.internal.artifacts.ivyservice.modulecache.artifacts.InMemoryModuleArtifactsCache) UpToDateResult(org.gradle.internal.execution.steps.UpToDateResult) TwoStageModuleMetadataCache(org.gradle.api.internal.artifacts.ivyservice.modulecache.TwoStageModuleMetadataCache) ProjectDependencyFactory(org.gradle.api.internal.notations.ProjectDependencyFactory) AttributeContainerSerializer(org.gradle.api.internal.artifacts.ivyservice.resolveengine.result.AttributeContainerSerializer) GeneratedGradleJarCache(org.gradle.cache.internal.GeneratedGradleJarCache) LocalComponentMetadataBuilder(org.gradle.api.internal.artifacts.ivyservice.moduleconverter.LocalComponentMetadataBuilder) Try(org.gradle.internal.Try) ProjectArtifactResolver(org.gradle.api.internal.artifacts.ivyservice.projectmodule.ProjectArtifactResolver) GlobalScopedCache(org.gradle.cache.scopes.GlobalScopedCache) CollectionCallbackActionDecorator(org.gradle.api.internal.CollectionCallbackActionDecorator) DependencyConstraintNotationParser(org.gradle.api.internal.notations.DependencyConstraintNotationParser) CachedExternalResourceIndex(org.gradle.internal.resource.cached.CachedExternalResourceIndex) MavenSettingsProvider(org.gradle.api.internal.artifacts.mvnsettings.MavenSettingsProvider) ReadOnlyModuleArtifactCache(org.gradle.api.internal.artifacts.ivyservice.modulecache.artifacts.ReadOnlyModuleArtifactCache) DependencyDescriptorFactory(org.gradle.api.internal.artifacts.ivyservice.moduleconverter.dependencies.DependencyDescriptorFactory) BuildCommencedTimeProvider(org.gradle.util.internal.BuildCommencedTimeProvider) LocalMavenRepositoryLocator(org.gradle.api.internal.artifacts.mvnsettings.LocalMavenRepositoryLocator) CachingResult(org.gradle.internal.execution.steps.CachingResult) ChecksumService(org.gradle.internal.hash.ChecksumService) RepositoryDisabler(org.gradle.api.internal.artifacts.ivyservice.ivyresolve.RepositoryDisabler) ModuleRepositoryCaches(org.gradle.api.internal.artifacts.ivyservice.modulecache.ModuleRepositoryCaches) IvyMutableModuleMetadataFactory(org.gradle.api.internal.artifacts.repositories.metadata.IvyMutableModuleMetadataFactory) InputFingerprinter(org.gradle.internal.execution.fingerprint.InputFingerprinter) DefaultMavenFileLocations(org.gradle.api.internal.artifacts.mvnsettings.DefaultMavenFileLocations) DependencyResolutionManagementInternal(org.gradle.internal.management.DependencyResolutionManagementInternal) ClasspathBuilder(org.gradle.internal.classpath.ClasspathBuilder) IdentityCacheStep(org.gradle.internal.execution.steps.IdentityCacheStep) ImmutableAttributesFactory(org.gradle.api.internal.attributes.ImmutableAttributesFactory) ServiceRegistration(org.gradle.internal.service.ServiceRegistration) ProjectArtifactSetResolver(org.gradle.api.internal.artifacts.ivyservice.projectmodule.ProjectArtifactSetResolver) SignatureVerificationServiceFactory(org.gradle.api.internal.artifacts.verification.signatures.SignatureVerificationServiceFactory) LocalComponentRegistry(org.gradle.api.internal.artifacts.ivyservice.projectmodule.LocalComponentRegistry) RemovePreviousOutputsStep(org.gradle.internal.execution.steps.RemovePreviousOutputsStep) UniqueId(org.gradle.internal.id.UniqueId) DefaultDependenciesAccessors(org.gradle.api.internal.catalog.DefaultDependenciesAccessors) ModuleDescriptorHashCodec(org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ModuleDescriptorHashCodec) DefaultArtifactDependencyResolver(org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultArtifactDependencyResolver) CachingState(org.gradle.internal.execution.caching.CachingState) BuildStateRegistry(org.gradle.internal.build.BuildStateRegistry) DependencyFactory(org.gradle.api.internal.artifacts.dsl.dependencies.DependencyFactory) BeforeExecutionState(org.gradle.internal.execution.history.BeforeExecutionState) DefaultProjectLocalComponentProvider(org.gradle.api.internal.artifacts.ivyservice.projectmodule.DefaultProjectLocalComponentProvider) CreateOutputsStep(org.gradle.internal.execution.steps.CreateOutputsStep) ArtifactIdentifierFileStore(org.gradle.api.internal.filestore.ArtifactIdentifierFileStore) CapabilityNotationParserFactory(org.gradle.api.internal.artifacts.dsl.CapabilityNotationParserFactory) FileHasher(org.gradle.internal.hash.FileHasher) HashSet(java.util.HashSet) ImmutableList(com.google.common.collect.ImmutableList) ModuleSourcesSerializer(org.gradle.api.internal.artifacts.ivyservice.modulecache.ModuleSourcesSerializer) GradleInternal(org.gradle.api.internal.GradleInternal) DefaultMavenSettingsProvider(org.gradle.api.internal.artifacts.mvnsettings.DefaultMavenSettingsProvider) ListenerManager(org.gradle.internal.event.ListenerManager) DesugaringAttributeContainerSerializer(org.gradle.internal.resolve.caching.DesugaringAttributeContainerSerializer) TimeoutHandler(org.gradle.internal.execution.timeout.TimeoutHandler) OutputChangeListener(org.gradle.internal.execution.OutputChangeListener) TwoStageByUrlCachedExternalResourceIndex(org.gradle.internal.resource.cached.TwoStageByUrlCachedExternalResourceIndex) ProviderFactory(org.gradle.api.provider.ProviderFactory) DefaultComponentIdentifierFactory(org.gradle.api.internal.artifacts.component.DefaultComponentIdentifierFactory) ApiTextResourceAdapter(org.gradle.api.internal.resources.ApiTextResourceAdapter) DefaultArtifactIdentifierFileStore(org.gradle.api.internal.filestore.DefaultArtifactIdentifierFileStore) DependencyMetaDataProvider(org.gradle.api.internal.artifacts.configurations.DependencyMetaDataProvider) ReadOnlyModuleMetadataCache(org.gradle.api.internal.artifacts.ivyservice.modulecache.ReadOnlyModuleMetadataCache) ConnectionFailureRepositoryDisabler(org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ConnectionFailureRepositoryDisabler) LocalComponentProvider(org.gradle.api.internal.artifacts.ivyservice.projectmodule.LocalComponentProvider) ProjectPublicationRegistry(org.gradle.api.internal.artifacts.ivyservice.projectmodule.ProjectPublicationRegistry) DependencyVerificationOverride(org.gradle.api.internal.artifacts.ivyservice.ivyresolve.verification.DependencyVerificationOverride) CurrentFileCollectionFingerprint(org.gradle.internal.fingerprint.CurrentFileCollectionFingerprint) UserCodeApplicationContext(org.gradle.configuration.internal.UserCodeApplicationContext) AbstractModuleVersionsCache(org.gradle.api.internal.artifacts.ivyservice.modulecache.dynamicversions.AbstractModuleVersionsCache) ArtifactCachesProvider(org.gradle.api.internal.artifacts.ivyservice.ArtifactCachesProvider) AfterExecutionState(org.gradle.internal.execution.history.AfterExecutionState) PreviousExecutionState(org.gradle.internal.execution.history.PreviousExecutionState) WorkValidationContext(org.gradle.internal.execution.WorkValidationContext) ExternalResourceFileStore(org.gradle.internal.resource.cached.ExternalResourceFileStore) CachingTextUriResourceLoader(org.gradle.internal.resource.transfer.CachingTextUriResourceLoader) DocumentationRegistry(org.gradle.api.internal.DocumentationRegistry) ModuleDescriptorHashModuleSource(org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ModuleDescriptorHashModuleSource) CurrentGradleInstallation(org.gradle.internal.installation.CurrentGradleInstallation) ProducerGuard(org.gradle.cache.internal.ProducerGuard) VirtualFileSystem(org.gradle.internal.vfs.VirtualFileSystem) DefaultModuleArtifactsCache(org.gradle.api.internal.artifacts.ivyservice.modulecache.artifacts.DefaultModuleArtifactsCache) CurrentBuildOperationRef(org.gradle.internal.operations.CurrentBuildOperationRef) BuildOperationExecutor(org.gradle.internal.operations.BuildOperationExecutor) VersionComparator(org.gradle.api.internal.artifacts.ivyservice.ivyresolve.strategy.VersionComparator) DefaultSignatureVerificationServiceFactory(org.gradle.api.internal.artifacts.verification.signatures.DefaultSignatureVerificationServiceFactory) DefaultModuleArtifactCache(org.gradle.api.internal.artifacts.ivyservice.modulecache.artifacts.DefaultModuleArtifactCache) InternalBuildFinishedListener(org.gradle.initialization.internal.InternalBuildFinishedListener) ComponentIdentifierFactory(org.gradle.api.internal.artifacts.component.ComponentIdentifierFactory) ServiceRegistry(org.gradle.internal.service.ServiceRegistry) TwoStageExternalResourceFileStore(org.gradle.internal.resource.cached.TwoStageExternalResourceFileStore) ModuleArtifactCache(org.gradle.api.internal.artifacts.ivyservice.modulecache.artifacts.ModuleArtifactCache) TextUriResourceLoader(org.gradle.internal.resource.TextUriResourceLoader) CleaningInMemoryCacheDecoratorFactory(org.gradle.cache.internal.CleaningInMemoryCacheDecoratorFactory) LoadPreviousExecutionStateStep(org.gradle.internal.execution.steps.LoadPreviousExecutionStateStep) ResolveIvyFactory(org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ResolveIvyFactory) TwoStageArtifactsCache(org.gradle.api.internal.artifacts.ivyservice.modulecache.artifacts.TwoStageArtifactsCache) BuildScopedCache(org.gradle.cache.scopes.BuildScopedCache) ImmutableSortedMap(com.google.common.collect.ImmutableSortedMap) FileResourceRepository(org.gradle.internal.resource.local.FileResourceRepository) DefaultVersionComparator(org.gradle.api.internal.artifacts.ivyservice.ivyresolve.strategy.DefaultVersionComparator) OverlappingOutputDetector(org.gradle.internal.execution.history.OverlappingOutputDetector) RemoveUntrackedExecutionStateStep(org.gradle.internal.execution.steps.RemoveUntrackedExecutionStateStep) File(java.io.File) DefaultVersionSelectorScheme(org.gradle.api.internal.artifacts.ivyservice.ivyresolve.strategy.DefaultVersionSelectorScheme) DefaultModuleVersionsCache(org.gradle.api.internal.artifacts.ivyservice.modulecache.dynamicversions.DefaultModuleVersionsCache) Instantiator(org.gradle.internal.reflect.Instantiator) ObjectFactory(org.gradle.api.model.ObjectFactory) DefaultMetadataFileSourceCodec(org.gradle.api.internal.artifacts.repositories.metadata.DefaultMetadataFileSourceCodec) DefaultExternalResourceAccessor(org.gradle.api.internal.artifacts.repositories.resolver.DefaultExternalResourceAccessor) ResolveInputChangesStep(org.gradle.internal.execution.steps.ResolveInputChangesStep) InMemoryModuleVersionsCache(org.gradle.api.internal.artifacts.ivyservice.modulecache.dynamicversions.InMemoryModuleVersionsCache) ExternalResourceName(org.gradle.internal.resource.ExternalResourceName) MavenMutableModuleMetadataFactory(org.gradle.api.internal.artifacts.repositories.metadata.MavenMutableModuleMetadataFactory) DefaultExecutionEngine(org.gradle.internal.execution.impl.DefaultExecutionEngine) LocallyAvailableResourceFinder(org.gradle.internal.resource.local.LocallyAvailableResourceFinder) TimeoutStep(org.gradle.internal.execution.steps.TimeoutStep) IdentifyStep(org.gradle.internal.execution.steps.IdentifyStep) ClientModuleNotationParserFactory(org.gradle.api.internal.notations.ClientModuleNotationParserFactory) PersistentModuleSource(org.gradle.internal.component.model.PersistentModuleSource) DefaultProjectPublicationRegistry(org.gradle.api.internal.artifacts.ivyservice.projectmodule.DefaultProjectPublicationRegistry) ClassLoaderHierarchyHasher(org.gradle.internal.hash.ClassLoaderHierarchyHasher) StartParameter(org.gradle.StartParameter) PreferJavaRuntimeVariant(org.gradle.internal.component.external.model.PreferJavaRuntimeVariant) ResourceConnectorFactory(org.gradle.internal.resource.connector.ResourceConnectorFactory) SuppliedComponentMetadataSerializer(org.gradle.api.internal.artifacts.ivyservice.modulecache.SuppliedComponentMetadataSerializer) FileResourceListener(org.gradle.internal.resource.local.FileResourceListener) ImmutableMap(com.google.common.collect.ImmutableMap) TwoStageModuleArtifactCache(org.gradle.api.internal.artifacts.ivyservice.modulecache.artifacts.TwoStageModuleArtifactCache) ValueSnapshot(org.gradle.internal.snapshot.ValueSnapshot) ReadOnlyModuleArtifactsCache(org.gradle.api.internal.artifacts.ivyservice.modulecache.artifacts.ReadOnlyModuleArtifactsCache) CaptureStateAfterExecutionStep(org.gradle.internal.execution.steps.CaptureStateAfterExecutionStep) Sets(com.google.common.collect.Sets) List(java.util.List) ArtifactCacheMetadata(org.gradle.api.internal.artifacts.ivyservice.ArtifactCacheMetadata) StoreExecutionStateStep(org.gradle.internal.execution.steps.StoreExecutionStateStep) InMemoryModuleMetadataCache(org.gradle.api.internal.artifacts.ivyservice.modulecache.InMemoryModuleMetadataCache) VersionParser(org.gradle.api.internal.artifacts.ivyservice.ivyresolve.strategy.VersionParser) Optional(java.util.Optional) ComponentMetadataSupplierRuleExecutor(org.gradle.internal.resolve.caching.ComponentMetadataSupplierRuleExecutor) OriginMetadata(org.gradle.caching.internal.origin.OriginMetadata) SkipUpToDateStep(org.gradle.internal.execution.steps.SkipUpToDateStep) ArtifactCacheLockingManager(org.gradle.api.internal.artifacts.ivyservice.ArtifactCacheLockingManager) ExecutionStateChangeDetector(org.gradle.internal.execution.history.changes.ExecutionStateChangeDetector) AtomicReference(java.util.concurrent.atomic.AtomicReference) ReadOnlyModuleVersionsCache(org.gradle.api.internal.artifacts.ivyservice.modulecache.dynamicversions.ReadOnlyModuleVersionsCache) AbstractModuleMetadataCache(org.gradle.api.internal.artifacts.ivyservice.modulecache.AbstractModuleMetadataCache) TemporaryFileProvider(org.gradle.api.internal.file.temp.TemporaryFileProvider) Deleter(org.gradle.internal.file.Deleter) RepositoryTransport(org.gradle.api.internal.artifacts.repositories.transport.RepositoryTransport) FileCollectionFactory(org.gradle.api.internal.file.FileCollectionFactory) DependencyNotationParser(org.gradle.api.internal.notations.DependencyNotationParser) ExecutionHistoryStore(org.gradle.internal.execution.history.ExecutionHistoryStore) ByUrlCachedExternalResourceIndex(org.gradle.internal.resource.cached.ByUrlCachedExternalResourceIndex) InMemoryCacheDecoratorFactory(org.gradle.cache.internal.InMemoryCacheDecoratorFactory) DependenciesAccessors(org.gradle.initialization.DependenciesAccessors) RepositoryTransportFactory(org.gradle.api.internal.artifacts.repositories.transport.RepositoryTransportFactory) ModuleComponentArtifactMetadata(org.gradle.internal.component.external.model.ModuleComponentArtifactMetadata) ValidationFinishedContext(org.gradle.internal.execution.steps.ValidationFinishedContext) CaptureStateBeforeExecutionStep(org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep) ModuleExclusions(org.gradle.api.internal.artifacts.ivyservice.resolveengine.excludes.ModuleExclusions) CachingVersionSelectorScheme(org.gradle.api.internal.artifacts.ivyservice.ivyresolve.strategy.CachingVersionSelectorScheme) ComponentMetadataRuleExecutor(org.gradle.internal.resolve.caching.ComponentMetadataRuleExecutor) InstantiatorFactory(org.gradle.internal.instantiation.InstantiatorFactory) TwoStageArtifactIdentifierFileStore(org.gradle.api.internal.filestore.TwoStageArtifactIdentifierFileStore) DefaultDependencyResolutionManagement(org.gradle.internal.management.DefaultDependencyResolutionManagement) MetadataFileSource(org.gradle.api.internal.artifacts.repositories.metadata.MetadataFileSource) CachingContext(org.gradle.internal.execution.steps.CachingContext) ModuleComponentResolveMetadataSerializer(org.gradle.api.internal.artifacts.ivyservice.modulecache.ModuleComponentResolveMetadataSerializer) VersionSelectorScheme(org.gradle.api.internal.artifacts.ivyservice.ivyresolve.strategy.VersionSelectorScheme) SimpleMapInterner(org.gradle.util.internal.SimpleMapInterner) DefaultExternalResourceFileStore(org.gradle.internal.resource.cached.DefaultExternalResourceFileStore) FileResolver(org.gradle.api.internal.file.FileResolver) DependenciesAccessorsWorkspaceProvider(org.gradle.api.internal.catalog.DependenciesAccessorsWorkspaceProvider) TransformationNodeDependencyResolver(org.gradle.api.internal.artifacts.transform.TransformationNodeDependencyResolver) GradleProperties(org.gradle.api.internal.properties.GradleProperties) Collections(java.util.Collections) InMemoryModuleArtifactCache(org.gradle.api.internal.artifacts.ivyservice.modulecache.artifacts.InMemoryModuleArtifactCache) ReadOnlyModuleArtifactCache(org.gradle.api.internal.artifacts.ivyservice.modulecache.artifacts.ReadOnlyModuleArtifactCache) DefaultModuleArtifactCache(org.gradle.api.internal.artifacts.ivyservice.modulecache.artifacts.DefaultModuleArtifactCache) ModuleArtifactCache(org.gradle.api.internal.artifacts.ivyservice.modulecache.artifacts.ModuleArtifactCache) TwoStageModuleArtifactCache(org.gradle.api.internal.artifacts.ivyservice.modulecache.artifacts.TwoStageModuleArtifactCache) InMemoryModuleArtifactsCache(org.gradle.api.internal.artifacts.ivyservice.modulecache.artifacts.InMemoryModuleArtifactsCache) InMemoryModuleVersionsCache(org.gradle.api.internal.artifacts.ivyservice.modulecache.dynamicversions.InMemoryModuleVersionsCache) InMemoryModuleMetadataCache(org.gradle.api.internal.artifacts.ivyservice.modulecache.InMemoryModuleMetadataCache) AtomicReference(java.util.concurrent.atomic.AtomicReference) TwoStageModuleArtifactCache(org.gradle.api.internal.artifacts.ivyservice.modulecache.artifacts.TwoStageModuleArtifactCache) ModuleRepositoryCaches(org.gradle.api.internal.artifacts.ivyservice.modulecache.ModuleRepositoryCaches) TwoStageArtifactsCache(org.gradle.api.internal.artifacts.ivyservice.modulecache.artifacts.TwoStageArtifactsCache) AbstractModuleVersionsCache(org.gradle.api.internal.artifacts.ivyservice.modulecache.dynamicversions.AbstractModuleVersionsCache) TwoStageModuleVersionsCache(org.gradle.api.internal.artifacts.ivyservice.modulecache.dynamicversions.TwoStageModuleVersionsCache) AbstractArtifactsCache(org.gradle.api.internal.artifacts.ivyservice.modulecache.artifacts.AbstractArtifactsCache) AbstractModuleMetadataCache(org.gradle.api.internal.artifacts.ivyservice.modulecache.AbstractModuleMetadataCache) InMemoryModuleArtifactCache(org.gradle.api.internal.artifacts.ivyservice.modulecache.artifacts.InMemoryModuleArtifactCache) ModuleRepositoryCacheProvider(org.gradle.api.internal.artifacts.ivyservice.modulecache.ModuleRepositoryCacheProvider) TwoStageModuleMetadataCache(org.gradle.api.internal.artifacts.ivyservice.modulecache.TwoStageModuleMetadataCache)

Example 2 with InMemoryModuleMetadataCache

use of org.gradle.api.internal.artifacts.ivyservice.modulecache.InMemoryModuleMetadataCache in project gradle by gradle.

the class DependencyManagementBuildScopeServices method createModuleRepositoryCacheProvider.

ModuleRepositoryCacheProvider createModuleRepositoryCacheProvider(BuildCommencedTimeProvider timeProvider, CacheLockingManager cacheLockingManager, ImmutableModuleIdentifierFactory moduleIdentifierFactory, ArtifactCacheMetadata artifactCacheMetadata, AttributeContainerSerializer attributeContainerSerializer, MavenMutableModuleMetadataFactory mavenMetadataFactory, IvyMutableModuleMetadataFactory ivyMetadataFactory) {
    ModuleRepositoryCaches caches = new ModuleRepositoryCaches(new DefaultModuleVersionsCache(timeProvider, cacheLockingManager, moduleIdentifierFactory), new DefaultModuleMetadataCache(timeProvider, cacheLockingManager, artifactCacheMetadata, moduleIdentifierFactory, attributeContainerSerializer, mavenMetadataFactory, ivyMetadataFactory), new DefaultModuleArtifactsCache(timeProvider, cacheLockingManager), new DefaultModuleArtifactCache("module-artifact", timeProvider, cacheLockingManager));
    ModuleRepositoryCaches inMemoryCaches = new ModuleRepositoryCaches(new InMemoryModuleVersionsCache(timeProvider), new InMemoryModuleMetadataCache(timeProvider), new InMemoryModuleArtifactsCache(timeProvider), new InMemoryModuleArtifactCache(timeProvider));
    return new ModuleRepositoryCacheProvider(caches, inMemoryCaches);
}
Also used : InMemoryModuleArtifactsCache(org.gradle.api.internal.artifacts.ivyservice.modulecache.artifacts.InMemoryModuleArtifactsCache) ModuleRepositoryCaches(org.gradle.api.internal.artifacts.ivyservice.modulecache.ModuleRepositoryCaches) DefaultModuleArtifactCache(org.gradle.api.internal.artifacts.ivyservice.modulecache.artifacts.DefaultModuleArtifactCache) InMemoryModuleVersionsCache(org.gradle.api.internal.artifacts.ivyservice.modulecache.dynamicversions.InMemoryModuleVersionsCache) InMemoryModuleMetadataCache(org.gradle.api.internal.artifacts.ivyservice.modulecache.InMemoryModuleMetadataCache) DefaultModuleVersionsCache(org.gradle.api.internal.artifacts.ivyservice.modulecache.dynamicversions.DefaultModuleVersionsCache) DefaultModuleMetadataCache(org.gradle.api.internal.artifacts.ivyservice.modulecache.DefaultModuleMetadataCache) DefaultModuleArtifactsCache(org.gradle.api.internal.artifacts.ivyservice.modulecache.artifacts.DefaultModuleArtifactsCache) InMemoryModuleArtifactCache(org.gradle.api.internal.artifacts.ivyservice.modulecache.artifacts.InMemoryModuleArtifactCache) ModuleRepositoryCacheProvider(org.gradle.api.internal.artifacts.ivyservice.modulecache.ModuleRepositoryCacheProvider)

Aggregations

ImmutableList (com.google.common.collect.ImmutableList)1 ImmutableMap (com.google.common.collect.ImmutableMap)1 ImmutableSortedMap (com.google.common.collect.ImmutableSortedMap)1 Sets (com.google.common.collect.Sets)1 File (java.io.File)1 Path (java.nio.file.Path)1 Duration (java.time.Duration)1 Collections (java.util.Collections)1 HashSet (java.util.HashSet)1 List (java.util.List)1 Map (java.util.Map)1 Optional (java.util.Optional)1 AtomicReference (java.util.concurrent.atomic.AtomicReference)1 StartParameter (org.gradle.StartParameter)1 Capability (org.gradle.api.capabilities.Capability)1 ClassPathRegistry (org.gradle.api.internal.ClassPathRegistry)1 CollectionCallbackActionDecorator (org.gradle.api.internal.CollectionCallbackActionDecorator)1 DocumentationRegistry (org.gradle.api.internal.DocumentationRegistry)1 FeaturePreviews (org.gradle.api.internal.FeaturePreviews)1 GradleInternal (org.gradle.api.internal.GradleInternal)1