use of org.gradle.api.internal.artifacts.ivyservice.resolveengine.artifact.ResolvableArtifact in project gradle by gradle.
the class ResolvedArtifactCollectingVisitor method visitArtifact.
@Override
public void visitArtifact(String variantName, AttributeContainer variantAttributes, ResolvableArtifact artifact) {
try {
if (seenArtifacts.add(artifact.getId())) {
// Trigger download of file, if required
File file = artifact.getFile();
this.artifacts.add(new DefaultResolvedArtifactResult(artifact.getId(), variantAttributes, variantName, Artifact.class, file));
}
} catch (Throwable t) {
failures.add(t);
}
}
use of org.gradle.api.internal.artifacts.ivyservice.resolveengine.artifact.ResolvableArtifact in project gradle by gradle.
the class DependencyResolvingClasspath method getFiles.
@Override
public Set<File> getFiles() {
ensureResolved(true);
final Set<File> result = new LinkedHashSet<File>();
ParallelResolveArtifactSet artifacts = ParallelResolveArtifactSet.wrap(resolveResult.artifactsResults.getArtifacts(), buildOperationExecutor);
artifacts.visit(new ArtifactVisitor() {
@Override
public void visitArtifact(String variantName, AttributeContainer variantAttributes, ResolvableArtifact artifact) {
result.add(artifact.getFile());
}
@Override
public void visitFailure(Throwable failure) {
throw UncheckedException.throwAsUncheckedException(failure);
}
@Override
public boolean includeFiles() {
return true;
}
@Override
public boolean requireArtifactFiles() {
return true;
}
@Override
public void visitFile(ComponentArtifactIdentifier artifactIdentifier, String variantName, AttributeContainer variantAttributes, File file) {
result.add(file);
}
});
return result;
}
use of org.gradle.api.internal.artifacts.ivyservice.resolveengine.artifact.ResolvableArtifact in project gradle by gradle.
the class ResolvedArtifactCollectingVisitor method visitArtifact.
@Override
public void visitArtifact(DisplayName variantName, AttributeContainer variantAttributes, List<? extends Capability> capabilities, ResolvableArtifact artifact) {
try {
if (seenArtifacts.add(artifact.getId())) {
File file = artifact.getFile();
this.artifacts.add(new DefaultResolvedArtifactResult(artifact.getId(), variantAttributes, capabilities, variantName, Artifact.class, file));
}
} catch (Exception t) {
failures.add(t);
}
}
Aggregations