use of org.gradle.api.artifacts.result.ComponentSelectionCause in project gradle by gradle.
the class ComponentSelectionReasonSerializer method readDescriptions.
private List<ComponentSelectionDescriptor> readDescriptions(Decoder decoder) throws IOException {
int size = decoder.readSmallInt();
ImmutableList.Builder<ComponentSelectionDescriptor> builder = new ImmutableList.Builder<ComponentSelectionDescriptor>();
for (int i = 0; i < size; i++) {
ComponentSelectionCause cause = ComponentSelectionCause.values()[decoder.readByte()];
String desc = readDescriptionText(decoder);
builder.add(new DefaultComponentSelectionDescriptor(cause, desc));
}
return builder.build();
}
use of org.gradle.api.artifacts.result.ComponentSelectionCause in project gradle by gradle.
the class ComponentSelectionDescriptorSerializer method read.
@Override
public ComponentSelectionDescriptor read(Decoder decoder) throws IOException {
ComponentSelectionCause cause = ComponentSelectionCause.values()[decoder.readByte()];
String desc = decoder.readString();
String defaultReason = cause.getDefaultReason();
if (desc.equals(defaultReason)) {
return componentSelectionDescriptorFactory.newDescriptor(cause);
}
return componentSelectionDescriptorFactory.newDescriptor(cause, desc);
}
Aggregations