use of org.gradle.api.artifacts.result.ComponentSelectionReason in project gradle by gradle.
the class ComponentSelectionReasonSerializer method read.
public ComponentSelectionReason read(Decoder decoder) throws IOException {
byte id = decoder.readByte();
ComponentSelectionReason out = REASONS.get(id);
if (out == null) {
throw new IllegalArgumentException("Unable to find selection reason with id: " + id);
}
return out;
}
use of org.gradle.api.artifacts.result.ComponentSelectionReason in project gradle by gradle.
the class DependencyResultSerializer method read.
public DependencyResult read(Decoder decoder, Map<Long, ComponentSelector> selectors, Map<ComponentSelector, ModuleVersionResolveException> failures) throws IOException {
Long selectorId = decoder.readSmallLong();
ComponentSelector requested = selectors.get(selectorId);
byte resultByte = decoder.readByte();
if (resultByte == SUCCESSFUL) {
Long selectedId = decoder.readSmallLong();
return new DefaultDependencyResult(requested, selectedId, null, null);
} else if (resultByte == FAILED) {
ComponentSelectionReason reason = componentSelectionReasonSerializer.read(decoder);
ModuleVersionResolveException failure = failures.get(requested);
return new DefaultDependencyResult(requested, null, reason, failure);
} else {
throw new IllegalArgumentException("Unknown result type: " + resultByte);
}
}
use of org.gradle.api.artifacts.result.ComponentSelectionReason in project gradle by gradle.
the class ComponentResultSerializer method read.
public ComponentResult read(Decoder decoder) throws IOException {
long resultId = decoder.readSmallLong();
ModuleVersionIdentifier id = idSerializer.read(decoder);
ComponentSelectionReason reason = reasonSerializer.read(decoder);
ComponentIdentifier componentId = componentIdSerializer.read(decoder);
String variantName = decoder.readString();
AttributeContainer attributes = attributeContainerSerializer.read(decoder);
return new DetachedComponentResult(resultId, id, reason, componentId, variantName, attributes);
}
Aggregations