use of org.gradle.internal.component.local.model.OpaqueComponentArtifactIdentifier in project gradle by gradle.
the class LocalFileDependencyBackedArtifactSet method snapshot.
@Override
public ResolvedArtifactSet snapshot() {
ComponentIdentifier componentIdentifier = dependencyMetadata.getComponentId();
if (componentIdentifier != null && !componentFilter.isSatisfiedBy(componentIdentifier)) {
return ResolvedArtifactSet.EMPTY;
}
Set<File> files;
try {
files = dependencyMetadata.getFiles().getFiles();
} catch (Throwable throwable) {
return new FailingResolvedArtifactSetSnapshot(throwable);
}
List<ResolvedVariant> variants = Lists.newArrayListWithCapacity(files.size());
for (File file : files) {
ComponentArtifactIdentifier artifactIdentifier;
if (componentIdentifier == null) {
artifactIdentifier = new OpaqueComponentArtifactIdentifier(file);
if (!componentFilter.isSatisfiedBy(artifactIdentifier.getComponentIdentifier())) {
continue;
}
} else {
artifactIdentifier = new ComponentFileArtifactIdentifier(componentIdentifier, file.getName());
}
AttributeContainerInternal variantAttributes = DefaultArtifactAttributes.forFile(file, attributesFactory);
ResolvedVariant variant = new SingletonFileResolvedVariant(file, artifactIdentifier, variantAttributes);
variants.add(selector.select(Collections.singleton(variant)));
}
return new ResolvedVariantBackedArtifactSetSnapshot(variants, dependencyMetadata);
}
Aggregations