use of org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.VariantNameBuilder in project gradle by gradle.
the class DefaultResolvedComponentResult method getVariant.
@Override
@SuppressWarnings("deprecation")
public ResolvedVariantResult getVariant() {
if (variants.isEmpty()) {
return new DefaultResolvedVariantResult(componentId, Describables.of("<empty>"), ImmutableAttributes.EMPTY, Collections.emptyList(), null);
}
// Returns an approximation of a composite variant
List<String> parts = variants.stream().map(ResolvedVariantResult::getDisplayName).collect(Collectors.toList());
DisplayName variantName = new VariantNameBuilder().getVariantName(parts);
ResolvedVariantResult firstVariant = variants.get(0);
return new DefaultResolvedVariantResult(componentId, variantName, firstVariant.getAttributes(), firstVariant.getCapabilities(), null);
}
Aggregations