use of org.gradle.api.internal.artifacts.result.DefaultResolvedVariantResult in project gradle by gradle.
the class NodeState method getResolvedVariant.
public ResolvedVariantResult getResolvedVariant() {
if (cachedVariantResult != null) {
return cachedVariantResult;
}
DisplayName name = Describables.of(metaData.getName());
List<? extends Capability> capabilities = metaData.getCapabilities().getCapabilities();
AttributeContainer attributes = desugar(metaData.getAttributes());
List<Capability> resolvedVariantCapabilities = capabilities.isEmpty() ? Collections.singletonList(component.getImplicitCapability()) : ImmutableList.copyOf(capabilities);
cachedVariantResult = new DefaultResolvedVariantResult(component.getComponentId(), name, attributes, resolvedVariantCapabilities, findExternalVariant());
return cachedVariantResult;
}
use of org.gradle.api.internal.artifacts.result.DefaultResolvedVariantResult in project gradle by gradle.
the class ResolvedVariantResultSerializer method read.
@Override
public ResolvedVariantResult read(Decoder decoder) throws IOException {
int index = decoder.readSmallInt();
if (index == -1) {
return null;
}
if (index == read.size()) {
ComponentIdentifier owner = componentIdentifierSerializer.read(decoder);
String variantName = decoder.readString();
AttributeContainer attributes = attributeContainerSerializer.read(decoder);
List<Capability> capabilities = readCapabilities(decoder);
read.add(null);
ResolvedVariantResult externalVariant = read(decoder);
DefaultResolvedVariantResult result = new DefaultResolvedVariantResult(owner, Describables.of(variantName), attributes, capabilities, externalVariant);
this.read.set(index, result);
return result;
}
return read.get(index);
}
Aggregations