use of org.gradle.internal.component.external.model.MutableModuleComponentResolveMetadata in project gradle by gradle.
the class DefaultModuleMetaDataCache method getCachedModuleDescriptor.
public CachedMetaData getCachedModuleDescriptor(ModuleComponentRepository repository, ModuleComponentIdentifier componentId) {
ModuleComponentAtRepositoryKey key = createKey(repository, componentId);
ModuleMetadataCacheEntry entry = getCache().get(key);
if (entry == null) {
return null;
}
if (entry.isMissing()) {
return new DefaultCachedMetaData(entry, null, timeProvider);
}
MutableModuleComponentResolveMetadata metadata = moduleMetadataStore.getModuleDescriptor(key);
if (metadata == null) {
// Descriptor file has been deleted - ignore the entry
getCache().remove(key);
return null;
}
return new DefaultCachedMetaData(entry, entry.configure(metadata), timeProvider);
}
use of org.gradle.internal.component.external.model.MutableModuleComponentResolveMetadata in project gradle by gradle.
the class ClientModuleResolver method resolve.
public void resolve(ComponentIdentifier identifier, ComponentOverrideMetadata componentOverrideMetadata, BuildableComponentResolveResult result) {
resolver.resolve(identifier, componentOverrideMetadata, result);
if (result.getFailure() != null) {
return;
}
ClientModule clientModule = componentOverrideMetadata.getClientModule();
if (clientModule != null) {
MutableModuleComponentResolveMetadata clientModuleMetaData = ((ModuleComponentResolveMetadata) result.getMetaData()).asMutable();
addClientModuleDependencies(clientModule, clientModuleMetaData);
setClientModuleArtifact(clientModuleMetaData);
result.setMetaData(clientModuleMetaData.asImmutable());
}
}
use of org.gradle.internal.component.external.model.MutableModuleComponentResolveMetadata in project gradle by gradle.
the class DefaultComponentMetadataHandler method processMetadata.
public ModuleComponentResolveMetadata processMetadata(ModuleComponentResolveMetadata metadata) {
ModuleComponentResolveMetadata updatedMetadata;
if (rules.isEmpty()) {
updatedMetadata = metadata;
} else {
MutableModuleComponentResolveMetadata mutableMetadata = metadata.asMutable();
ComponentMetadataDetails details = instantiator.newInstance(ComponentMetadataDetailsAdapter.class, mutableMetadata);
processAllRules(metadata, details);
updatedMetadata = mutableMetadata.asImmutable();
}
if (!updatedMetadata.getStatusScheme().contains(updatedMetadata.getStatus())) {
throw new ModuleVersionResolveException(updatedMetadata.getId(), String.format("Unexpected status '%s' specified for %s. Expected one of: %s", updatedMetadata.getStatus(), updatedMetadata.getComponentId().getDisplayName(), updatedMetadata.getStatusScheme()));
}
return updatedMetadata;
}
use of org.gradle.internal.component.external.model.MutableModuleComponentResolveMetadata in project gradle by gradle.
the class IvyDynamicResolveModuleComponentRepositoryAccess method transformDependencies.
private void transformDependencies(BuildableModuleComponentMetaDataResolveResult result) {
ModuleComponentResolveMetadata metadata = result.getMetaData();
MutableModuleComponentResolveMetadata mutableMetadata = metadata.asMutable();
List<DependencyMetadata> transformed = new ArrayList<DependencyMetadata>();
for (DependencyMetadata dependency : metadata.getDependencies()) {
transformed.add(dependency.withRequestedVersion(dependency.getDynamicConstraintVersion()));
}
mutableMetadata.setDependencies(transformed);
result.setMetadata(mutableMetadata.asImmutable());
}
use of org.gradle.internal.component.external.model.MutableModuleComponentResolveMetadata in project gradle by gradle.
the class ValidatingIvyPublisher method validateMetadata.
private void validateMetadata(IvyNormalizedPublication publication) {
IvyPublicationIdentity identity = publication.getProjectIdentity();
IvyFieldValidator organisation = field(publication, "organisation", identity.getOrganisation()).notEmpty().validInFileName();
IvyFieldValidator moduleName = field(publication, "module name", identity.getModule()).notEmpty().validInFileName();
IvyFieldValidator revision = field(publication, "revision", identity.getRevision()).notEmpty().validInFileName();
MutableModuleComponentResolveMetadata metadata = parseIvyFile(publication);
ModuleVersionIdentifier moduleId = metadata.getId();
organisation.matches(moduleId.getGroup());
moduleName.matches(moduleId.getName());
revision.matches(moduleId.getVersion());
field(publication, "branch", metadata.getDescriptor().getBranch()).optionalNotEmpty().doesNotContainSpecialCharacters(true);
field(publication, "status", metadata.getStatus()).optionalNotEmpty().validInFileName();
}
Aggregations