use of org.gradle.internal.component.model.DependencyMetadata in project gradle by gradle.
the class ClientModuleResolver method addClientModuleDependencies.
private void addClientModuleDependencies(ClientModule clientModule, MutableModuleComponentResolveMetadata clientModuleMetaData) {
List<DependencyMetadata> dependencies = Lists.newArrayList();
for (ModuleDependency moduleDependency : clientModule.getDependencies()) {
DependencyMetadata dependencyMetadata = dependencyDescriptorFactory.createDependencyDescriptor(moduleDependency.getTargetConfiguration(), null, moduleDependency);
dependencies.add(dependencyMetadata);
}
clientModuleMetaData.setDependencies(dependencies);
}
use of org.gradle.internal.component.model.DependencyMetadata in project gradle by gradle.
the class NodeState method visitDependencies.
/**
* Iterate over the dependencies originating in this node, adding them either as a 'pending' dependency
* or adding them to the `discoveredEdges` collection (and `this.outgoingEdges`)
*/
private void visitDependencies(ModuleExclusion resolutionFilter, PendingDependenciesHandler pendingDependenciesHandler, Collection<EdgeState> discoveredEdges) {
PendingDependenciesHandler.Visitor pendingDepsVisitor = pendingDependenciesHandler.start();
try {
for (DependencyMetadata dependency : metaData.getDependencies()) {
DependencyState dependencyState = new DependencyState(dependency, resolveState.getComponentSelectorConverter());
if (isExcluded(resolutionFilter, dependencyState)) {
continue;
}
dependencyState = maybeSubstitute(dependencyState);
if (!pendingDepsVisitor.maybeAddAsPendingDependency(this, dependencyState)) {
EdgeState dependencyEdge = new EdgeState(this, dependencyState, resolutionFilter, resolveState);
outgoingEdges.add(dependencyEdge);
discoveredEdges.add(dependencyEdge);
}
}
previousTraversalExclusions = resolutionFilter;
} finally {
// If there are 'pending' dependencies that share a target with any of these outgoing edges,
// then reset the state of the node that owns those dependencies.
// This way, all edges of the node will be re-processed.
pendingDepsVisitor.complete();
}
}
use of org.gradle.internal.component.model.DependencyMetadata in project gradle by gradle.
the class NodeState method isExcluded.
private boolean isExcluded(ModuleExclusion selector, DependencyState dependencyState) {
DependencyMetadata dependency = dependencyState.getDependency();
if (!resolveState.getEdgeFilter().isSatisfiedBy(dependency)) {
LOGGER.debug("{} is filtered.", dependency);
return true;
}
if (selector == ModuleExclusions.excludeNone()) {
return false;
}
ModuleIdentifier targetModuleId = dependencyState.getModuleIdentifier();
if (selector.excludeModule(targetModuleId)) {
LOGGER.debug("{} is excluded from {}.", targetModuleId, this);
return true;
}
return false;
}
use of org.gradle.internal.component.model.DependencyMetadata in project gradle by gradle.
the class NodeState method isExcluded.
private boolean isExcluded(ExcludeSpec excludeSpec, DependencyState dependencyState) {
DependencyMetadata dependency = dependencyState.getDependency();
if (!resolveState.getEdgeFilter().isSatisfiedBy(dependency)) {
LOGGER.debug("{} is filtered.", dependency);
return true;
}
if (excludeSpec == moduleExclusions.nothing()) {
return false;
}
ModuleIdentifier targetModuleId = dependencyState.getModuleIdentifier();
if (excludeSpec.excludes(targetModuleId)) {
LOGGER.debug("{} is excluded from {} by {}.", targetModuleId, this, excludeSpec);
return true;
}
return false;
}
use of org.gradle.internal.component.model.DependencyMetadata in project gradle by gradle.
the class IncompatibleDependencyAttributesMessageBuilder method formatAttributeQuery.
private static String formatAttributeQuery(SelectorState state, Attribute<?> attribute) {
DependencyMetadata dependencyMetadata = state.getDependencyMetadata();
ComponentSelector selector = dependencyMetadata.getSelector();
if (selector instanceof ModuleComponentSelector) {
StringBuilder sb = new StringBuilder("wants '" + state.getRequested() + "' with attribute " + attribute.getName() + " = ");
sb.append(selector.getAttributes().getAttribute(attribute));
return sb.toString();
} else {
// that for a specific module resolve state, all selectors are of the same type
return "doesn't provide any value for attribute " + attribute.getName();
}
}
Aggregations