use of org.gradle.api.artifacts.result.ResolutionResult in project gradle by gradle.
the class DefaultIdeDependencyResolver method getUnresolvedIdeRepoFileDependencies.
/**
* Gets unresolved IDE repository file dependencies.
*
* @param configuration Configuration
* @return Unresolved IDE repositoru file dependencies
*/
public List<UnresolvedIdeRepoFileDependency> getUnresolvedIdeRepoFileDependencies(Configuration configuration) {
ResolutionResult result = getIncomingResolutionResult(configuration);
List<UnresolvedDependencyResult> unresolvedDependencies = findAllUnresolvedDependencyResults(result.getRoot().getDependencies());
List<UnresolvedIdeRepoFileDependency> unresolvedIdeRepoFileDependencies = new ArrayList<UnresolvedIdeRepoFileDependency>();
for (UnresolvedDependencyResult unresolvedDependencyResult : unresolvedDependencies) {
Throwable failure = unresolvedDependencyResult.getFailure();
ComponentSelector componentSelector = unresolvedDependencyResult.getAttempted();
String displayName = componentSelector.getDisplayName();
File file = new File(unresolvedFileName(componentSelector));
unresolvedIdeRepoFileDependencies.add(new UnresolvedIdeRepoFileDependency(file, failure, displayName));
}
return unresolvedIdeRepoFileDependencies;
}
use of org.gradle.api.artifacts.result.ResolutionResult in project gradle by gradle.
the class ShortCircuitEmptyConfigurationResolver method emptyGraph.
private void emptyGraph(ConfigurationInternal configuration, ResolverResults results) {
Module module = configuration.getModule();
ModuleVersionIdentifier id = moduleIdentifierFactory.moduleWithVersion(module);
ComponentIdentifier componentIdentifier = componentIdentifierFactory.createComponentIdentifier(module);
ResolutionResult emptyResult = DefaultResolutionResultBuilder.empty(id, componentIdentifier);
ResolvedLocalComponentsResult emptyProjectResult = new ResolvedLocalComponentsResultGraphVisitor(thisBuild.getCurrentBuild());
results.graphResolved(emptyResult, emptyProjectResult, new EmptyResults());
}
use of org.gradle.api.artifacts.result.ResolutionResult in project gradle by gradle.
the class DefaultTransformUpstreamDependenciesResolver method selectedArtifactsFor.
private FileCollectionInternal selectedArtifactsFor(ImmutableAttributes fromAttributes) {
if (dependencies == null) {
ResolutionResult result = resolutionResultProvider.getValue();
dependencies = computeDependencies(componentIdentifier, ComponentIdentifier.class, result.getAllComponents(), false);
}
return filteredResultFactory.resultsMatching(fromAttributes, selectDependenciesWithId(dependencies));
}
use of org.gradle.api.artifacts.result.ResolutionResult in project gradle by gradle.
the class DefaultTransformUpstreamDependenciesResolver method computeDependenciesFor.
private void computeDependenciesFor(ImmutableAttributes fromAttributes, TaskDependencyResolveContext context) {
if (buildDependencies == null) {
ResolutionResult result = resolutionResultProvider.getTaskDependencyValue();
buildDependencies = computeDependencies(componentIdentifier, ComponentIdentifier.class, result.getAllComponents(), true);
}
FileCollectionInternal files = filteredResultFactory.resultsMatching(fromAttributes, selectDependenciesWithId(buildDependencies));
context.add(files);
}
use of org.gradle.api.artifacts.result.ResolutionResult in project gradle by gradle.
the class ErrorHandlingConfigurationResolver method resolveGraph.
@Override
public void resolveGraph(ConfigurationInternal configuration, ResolverResults results) throws ResolveException {
try {
delegate.resolveGraph(configuration, results);
} catch (Exception e) {
results.failed(wrapException(e, configuration));
BrokenResolvedConfiguration broken = new BrokenResolvedConfiguration(e, configuration);
results.artifactsResolved(broken, broken);
return;
}
ResolutionResult wrappedResult = new ErrorHandlingResolutionResult(results.getResolutionResult(), configuration);
results.graphResolved(wrappedResult, results.getResolvedLocalComponents(), results.getVisitedArtifacts());
}
Aggregations