use of org.gradle.api.artifacts.component.ProjectComponentIdentifier in project gradle by gradle.
the class DefaultProjectLocalComponentProvider method getLocalComponentMetadata.
private LocalComponentMetadata getLocalComponentMetadata(ProjectState projectState, ProjectInternal project) {
Module module = project.getDependencyMetaDataProvider().getModule();
ModuleVersionIdentifier moduleVersionIdentifier = moduleIdentifierFactory.moduleWithVersion(module.getGroup(), module.getName(), module.getVersion());
ProjectComponentIdentifier componentIdentifier = projectState.getComponentIdentifier();
DefaultLocalComponentMetadata metaData = new DefaultLocalComponentMetadata(moduleVersionIdentifier, componentIdentifier, module.getStatus(), (AttributesSchemaInternal) project.getDependencies().getAttributesSchema());
for (ConfigurationInternal configuration : project.getConfigurations().withType(ConfigurationInternal.class)) {
metadataBuilder.addConfiguration(metaData, configuration);
}
return metaData;
}
use of org.gradle.api.artifacts.component.ProjectComponentIdentifier in project gradle by gradle.
the class ModuleResolveState method maybeSkipSelectionChange.
private boolean maybeSkipSelectionChange(ComponentState newSelected) {
if (selectionChangedCounter == MAX_SELECTION_CHANGE + 1) {
LOGGER.warn("The dependency resolution engine wasn't able to find a version of module {} which satisfied all requirements because the graph wasn't stable enough. " + "The highest version was selected in order to stabilize selection.\n" + "Features available in a stable graph like version alignment are not guaranteed in this case.", id);
}
boolean newSelectedIsProject = false;
if (conflictResolution == ConflictResolution.preferProjectModules) {
if (newSelected.getComponentId() instanceof ProjectComponentIdentifier) {
// Keep the project selected
newSelectedIsProject = true;
}
}
Version newVersion = versionParser.transform(newSelected.getVersion());
Version currentVersion = versionParser.transform(selected.getVersion());
return !newSelectedIsProject && versionComparator.compare(newVersion, currentVersion) <= 0;
}
use of org.gradle.api.artifacts.component.ProjectComponentIdentifier in project gradle by gradle.
the class DefaultProjectComponentSelector method newSelector.
public static ProjectComponentSelector newSelector(Project project, ImmutableAttributes attributes, List<Capability> requestedCapabilities) {
ProjectInternal projectInternal = (ProjectInternal) project;
ProjectComponentIdentifier projectComponentIdentifier = projectInternal.getOwner().getComponentIdentifier();
return new DefaultProjectComponentSelector(projectComponentIdentifier.getBuild(), projectInternal.getIdentityPath(), projectInternal.getProjectPath(), project.getName(), attributes, requestedCapabilities);
}
use of org.gradle.api.artifacts.component.ProjectComponentIdentifier in project gradle by gradle.
the class IdeaPlugin method visitAllImlArtifactsInComposite.
private void visitAllImlArtifactsInComposite(ProjectInternal project, IdeaProject ideaProject, TaskDependencyResolveContext context) {
ProjectComponentIdentifier thisProjectId = projectPathRegistry.stateFor(project).getComponentIdentifier();
for (IdeArtifactRegistry.Reference<IdeaModuleMetadata> reference : artifactRegistry.getIdeProjects(IdeaModuleMetadata.class)) {
BuildIdentifier otherBuildId = reference.getOwningProject().getBuild();
if (thisProjectId.getBuild().equals(otherBuildId)) {
// IDEA Module for project in current build: don't include any module that has been excluded from project
boolean found = false;
for (IdeaModule ideaModule : ideaProject.getModules()) {
if (reference.get().getFile().equals(ideaModule.getOutputFile())) {
found = true;
break;
}
}
if (!found) {
continue;
}
}
reference.visitDependencies(context);
}
}
use of org.gradle.api.artifacts.component.ProjectComponentIdentifier in project gradle by gradle.
the class IncludedBuildDependencyMetadataBuilder method build.
public LocalComponentMetadata build(CompositeBuildParticipantBuildState build, ProjectComponentIdentifier projectIdentifier) {
GradleInternal gradle = build.getMutableModel();
LocalComponentRegistry localComponentRegistry = gradle.getServices().get(LocalComponentRegistry.class);
DefaultLocalComponentMetadata originalComponent = (DefaultLocalComponentMetadata) localComponentRegistry.getComponent(projectIdentifier);
ProjectComponentIdentifier foreignIdentifier = build.idToReferenceProjectFromAnotherBuild(projectIdentifier);
return createCompositeCopy(foreignIdentifier, originalComponent);
}
Aggregations