use of org.gradle.internal.component.external.model.ModuleComponentResolveMetadata 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.ModuleComponentResolveMetadata 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.ModuleComponentResolveMetadata in project gradle by gradle.
the class CachedModuleVersionResult method supply.
public void supply(BuildableModuleComponentMetaDataResolveResult result) {
assert isCacheable() : "Results are not cacheable, cannot supply the results.";
if (state == Resolved) {
ModuleComponentResolveMetadata metaData = this.metaData;
result.resolved(metaData);
result.setAuthoritative(authoritative);
} else if (state == Missing) {
result.missing();
result.setAuthoritative(authoritative);
}
}
use of org.gradle.internal.component.external.model.ModuleComponentResolveMetadata 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());
}
Aggregations