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, boolean verifyLocking) {
if (verifyLocking && configuration.getResolutionStrategy().isDependencyLockingEnabled()) {
DependencyLockingProvider dependencyLockingProvider = configuration.getResolutionStrategy().getDependencyLockingProvider();
DependencyLockingState lockingState = dependencyLockingProvider.loadLockState(configuration.getName());
if (lockingState.mustValidateLockState() && !lockingState.getLockedDependencies().isEmpty()) {
// Invalid lock state, need to do a real resolution to gather locking failures
delegate.resolveGraph(configuration, results);
return;
}
dependencyLockingProvider.persistResolvedDependencies(configuration.getName(), Collections.emptySet(), Collections.emptySet());
}
Module module = configuration.getModule();
ModuleVersionIdentifier id = moduleIdentifierFactory.moduleWithVersion(module);
ComponentIdentifier componentIdentifier = componentIdentifierFactory.createComponentIdentifier(module);
ResolutionResult emptyResult = DefaultResolutionResultBuilder.empty(id, componentIdentifier, configuration.getAttributes());
ResolvedLocalComponentsResult emptyProjectResult = new ResolvedLocalComponentsResultGraphVisitor(thisBuild);
results.graphResolved(emptyResult, emptyProjectResult, EmptyResults.INSTANCE);
}
use of org.gradle.api.artifacts.result.ResolutionResult in project gradle by gradle.
the class DependencyInsightReportTask method getRootComponentProperty.
/**
* The root component of the dependency graph to be inspected.
*
* @since 7.5
*/
@Input
@Optional
@Incubating
public Property<ResolvedComponentResult> getRootComponentProperty() {
Configuration configuration = getConfiguration();
if (!rootComponentProperty.isPresent() && configuration != null && getDependencySpec() != null) {
configurationName = configuration.getName();
configurationDescription = configuration.toString();
configurationAttributes = configuration.getAttributes();
ResolvableDependenciesInternal incoming = (ResolvableDependenciesInternal) configuration.getIncoming();
ResolutionResult result = incoming.getResolutionResult(errorHandler);
rootComponentProperty.set(result.getRootComponent());
}
return rootComponentProperty;
}
use of org.gradle.api.artifacts.result.ResolutionResult in project gradle by gradle.
the class AsciiDependencyReportRenderer method render.
@Override
public void render(Configuration configuration) {
if (canBeResolved(configuration)) {
ResolutionResult result = configuration.getIncoming().getResolutionResult();
RenderableDependency root = new RenderableModuleResult(result.getRoot());
renderNow(root);
} else {
renderNow(new UnresolvableConfigurationResult(configuration));
}
}
Aggregations