use of org.gradle.internal.component.model.ComponentResolveMetadata in project gradle by gradle.
the class DependencyLockingArtifactVisitor method visitNode.
@Override
public void visitNode(DependencyGraphNode node) {
boolean changing = false;
ComponentIdentifier identifier = node.getOwner().getComponentId();
ComponentResolveMetadata metadata = node.getOwner().getMetadata();
if (metadata != null && metadata.isChanging()) {
changing = true;
}
if (!node.isRoot() && identifier instanceof ModuleComponentIdentifier) {
ModuleComponentIdentifier id = (ModuleComponentIdentifier) identifier;
if (identifier instanceof MavenUniqueSnapshotComponentIdentifier) {
id = ((MavenUniqueSnapshotComponentIdentifier) id).getSnapshotComponent();
}
if (!id.getVersion().isEmpty()) {
if (allResolvedModules.add(id)) {
if (changing) {
addChangingModule(id);
}
if (dependencyLockingState.mustValidateLockState()) {
ModuleComponentIdentifier lockedId = modulesToBeLocked.remove(id.getModuleIdentifier());
if (lockedId == null) {
if (!dependencyLockingState.getIgnoredEntryFilter().isSatisfiedBy(id)) {
extraModules.add(id);
}
} else if (!lockedId.getVersion().equals(id.getVersion()) && !isNodeRejected(node)) {
// Need to check that versions do match, mismatch indicates a force was used
forcedModules.put(lockedId, id.getVersion());
}
}
}
}
}
}
Aggregations