use of org.gradle.internal.resolve.result.DefaultBuildableComponentResolveResult in project gradle by gradle.
the class DependencyGraphBuilder method resolve.
public void resolve(ResolveContext resolveContext, DependencyGraphVisitor modelVisitor) {
IdGenerator<Long> idGenerator = new LongIdGenerator();
DefaultBuildableComponentResolveResult rootModule = new DefaultBuildableComponentResolveResult();
moduleResolver.resolve(resolveContext, rootModule);
ResolveState resolveState = new ResolveState(idGenerator, rootModule, resolveContext.getName(), idResolver, metaDataResolver, edgeFilter, attributesSchema, moduleIdentifierFactory, moduleExclusions);
conflictHandler.registerResolver(new DirectDependencyForcingResolver(resolveState.root.moduleRevision));
traverseGraph(resolveState, conflictHandler);
resolveState.root.moduleRevision.setSelectionReason(VersionSelectionReasons.ROOT);
assembleResult(resolveState, modelVisitor);
}
use of org.gradle.internal.resolve.result.DefaultBuildableComponentResolveResult in project gradle by gradle.
the class DependencyGraphBuilder method resolve.
public void resolve(final ResolveContext resolveContext, final DependencyGraphVisitor modelVisitor) {
IdGenerator<Long> idGenerator = new LongIdGenerator();
DefaultBuildableComponentResolveResult rootModule = new DefaultBuildableComponentResolveResult();
moduleResolver.resolve(resolveContext, rootModule);
final ResolveState resolveState = new ResolveState(idGenerator, rootModule, resolveContext.getName(), idResolver, metaDataResolver, edgeFilter, attributesSchema, moduleExclusions, moduleReplacementsData, componentSelectorConverter, attributesFactory, dependencySubstitutionApplicator);
moduleConflictHandler.registerResolver(new DirectDependencyForcingResolver(resolveState.getRoot().getComponent()));
traverseGraph(resolveState);
validateGraph(resolveState);
resolveState.getRoot().getComponent().setRoot();
assembleResult(resolveState, modelVisitor);
}
use of org.gradle.internal.resolve.result.DefaultBuildableComponentResolveResult in project gradle by gradle.
the class DependencyGraphBuilder method resolve.
public void resolve(final ResolveContext resolveContext, final DependencyGraphVisitor modelVisitor, boolean includeSyntheticDependencies) {
IdGenerator<Long> idGenerator = new LongIdGenerator();
DefaultBuildableComponentResolveResult rootModule = new DefaultBuildableComponentResolveResult();
moduleResolver.resolve(resolveContext, rootModule);
int graphSize = estimateSize(resolveContext);
ResolutionStrategyInternal resolutionStrategy = resolveContext.getResolutionStrategy();
List<? extends DependencyMetadata> syntheticDependencies = includeSyntheticDependencies ? syntheticDependenciesOf(rootModule, resolveContext.getName()) : Collections.emptyList();
final ResolveState resolveState = new ResolveState(idGenerator, rootModule, resolveContext.getName(), idResolver, metaDataResolver, edgeFilter, attributesSchema, moduleExclusions, componentSelectorConverter, attributesFactory, dependencySubstitutionApplicator, versionSelectorScheme, versionComparator, versionParser, moduleConflictHandler.getResolver(), graphSize, resolveContext.getResolutionStrategy().getConflictResolution(), syntheticDependencies, conflictTracker);
Map<ModuleVersionIdentifier, ComponentIdentifier> componentIdentifierCache = Maps.newHashMapWithExpectedSize(graphSize / 2);
traverseGraph(resolveState, componentIdentifierCache);
validateGraph(resolveState, resolutionStrategy.isFailingOnDynamicVersions(), resolutionStrategy.isFailingOnChangingVersions());
assembleResult(resolveState, modelVisitor);
}
use of org.gradle.internal.resolve.result.DefaultBuildableComponentResolveResult in project gradle by gradle.
the class ComponentState method resolve.
public void resolve() {
if (alreadyResolved()) {
return;
}
ComponentOverrideMetadata componentOverrideMetadata;
if (selectors != null && selectors.size() > 0) {
// Taking the first selector here to determine the 'changing' status and 'client module' is our best bet to get the selector that will most likely be chosen in the end.
// As selectors are sorted accordingly (see ModuleSelectors.SELECTOR_COMPARATOR).
SelectorState firstSelector = selectors.first();
componentOverrideMetadata = DefaultComponentOverrideMetadata.forDependency(firstSelector.isChanging(), selectors.getFirstDependencyArtifact(), firstSelector.getClientModule());
} else {
componentOverrideMetadata = DefaultComponentOverrideMetadata.EMPTY;
}
DefaultBuildableComponentResolveResult result = new DefaultBuildableComponentResolveResult();
if (tryResolveVirtualPlatform()) {
return;
}
resolver.resolve(componentIdentifier, componentOverrideMetadata, result);
if (result.getFailure() != null) {
metadataResolveFailure = result.getFailure();
return;
}
metadata = result.getMetadata();
}
use of org.gradle.internal.resolve.result.DefaultBuildableComponentResolveResult in project gradle by gradle.
the class DefaultArtifactResolutionQuery method buildComponentResult.
private ComponentArtifactsResult buildComponentResult(ComponentIdentifier componentId, ComponentMetaDataResolver componentMetaDataResolver, ArtifactResolver artifactResolver) {
BuildableComponentResolveResult moduleResolveResult = new DefaultBuildableComponentResolveResult();
componentMetaDataResolver.resolve(componentId, DefaultComponentOverrideMetadata.EMPTY, moduleResolveResult);
ComponentResolveMetadata component = moduleResolveResult.getMetadata();
DefaultComponentArtifactsResult componentResult = new DefaultComponentArtifactsResult(component.getId());
for (Class<? extends Artifact> artifactType : artifactTypes) {
addArtifacts(componentResult, artifactType, component, artifactResolver);
}
return componentResult;
}
Aggregations