use of org.gradle.internal.component.local.model.DefaultLocalComponentMetadata in project gradle by gradle.
the class DefaultConfiguration method toRootComponentMetaData.
public ComponentResolveMetadata toRootComponentMetaData() {
Module module = getModule();
ComponentIdentifier componentIdentifier = componentIdentifierFactory.createComponentIdentifier(module);
ModuleVersionIdentifier moduleVersionIdentifier = moduleIdentifierFactory.moduleWithVersion(module.getGroup(), module.getName(), module.getVersion());
ProjectInternal project = projectFinder.findProject(module.getProjectPath());
AttributesSchemaInternal schema = project == null ? null : (AttributesSchemaInternal) project.getDependencies().getAttributesSchema();
DefaultLocalComponentMetadata metaData = new DefaultLocalComponentMetadata(moduleVersionIdentifier, componentIdentifier, module.getStatus(), schema);
configurationComponentMetaDataBuilder.addConfigurations(metaData, configurationsProvider.getAll());
return metaData;
}
use of org.gradle.internal.component.local.model.DefaultLocalComponentMetadata in project gradle by gradle.
the class DefaultIncludedBuild method registerProject.
private void registerProject(Set<Pair<ModuleVersionIdentifier, ProjectComponentIdentifier>> availableModules, ProjectInternal project) {
LocalComponentRegistry localComponentRegistry = project.getServices().get(LocalComponentRegistry.class);
ProjectComponentIdentifier originalIdentifier = newProjectId(project);
DefaultLocalComponentMetadata originalComponent = (DefaultLocalComponentMetadata) localComponentRegistry.getComponent(originalIdentifier);
ProjectComponentIdentifier componentIdentifier = idForProjectInThisBuild(project.getPath());
ModuleVersionIdentifier moduleId = originalComponent.getModuleVersionId();
LOGGER.info("Registering " + project + " in composite build. Will substitute for module '" + moduleId.getModule() + "'.");
availableModules.add(Pair.of(moduleId, componentIdentifier));
}
use of org.gradle.internal.component.local.model.DefaultLocalComponentMetadata 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.internal.component.local.model.DefaultLocalComponentMetadata 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