use of org.gradle.internal.component.external.model.VirtualComponentIdentifier in project gradle by gradle.
the class ModuleComponentResolveMetadataSerializer method readPlatformOwners.
private void readPlatformOwners(Decoder decoder, MutableModuleComponentResolveMetadata mutable) throws IOException {
int len = decoder.readSmallInt();
if (len > 0) {
for (int i = 0; i < len; i++) {
VirtualComponentIdentifier moduleComponentIdentifier = readModuleIdentifier(decoder);
mutable.belongsTo(moduleComponentIdentifier);
}
}
}
use of org.gradle.internal.component.external.model.VirtualComponentIdentifier in project gradle by gradle.
the class NodeState method visitOwners.
/**
* If a component declares that it belongs to a platform, we add an edge to the platform.
*
* @param discoveredEdges the collection of edges for this component
*/
private void visitOwners(Collection<EdgeState> discoveredEdges) {
ImmutableList<? extends VirtualComponentIdentifier> owners = component.getMetadata().getPlatformOwners();
if (!owners.isEmpty()) {
PendingDependenciesVisitor visitor = resolveState.newPendingDependenciesVisitor();
for (VirtualComponentIdentifier owner : owners) {
if (owner instanceof ModuleComponentIdentifier) {
ModuleComponentIdentifier platformId = (ModuleComponentIdentifier) owner;
final ModuleComponentSelector cs = DefaultModuleComponentSelector.newSelector(platformId.getModuleIdentifier(), platformId.getVersion());
// There are 2 possibilities here:
// 1. the "platform" referenced is a real module, in which case we directly add it to the graph
// 2. the "platform" is a virtual, constructed thing, in which case we add virtual edges to the graph
addPlatformEdges(discoveredEdges, platformId, cs);
visitor.markNotPending(platformId.getModuleIdentifier());
}
}
visitor.complete();
}
}
Aggregations