Search in sources :

Example 1 with DefaultLocalComponentMetadata

use of org.gradle.internal.component.local.model.DefaultLocalComponentMetadata in project gradle by gradle.

the class IncludedBuildDependencyMetadataBuilder method registerProject.

private void registerProject(IncludedBuild build, ProjectInternal project) {
    LocalComponentRegistry localComponentRegistry = project.getServices().get(LocalComponentRegistry.class);
    ProjectComponentIdentifier originalIdentifier = newProjectId(project);
    DefaultLocalComponentMetadata originalComponent = (DefaultLocalComponentMetadata) localComponentRegistry.getComponent(originalIdentifier);
    ProjectComponentIdentifier componentIdentifier = newProjectId(build, project.getPath());
    LocalComponentMetadata compositeComponent = createCompositeCopy(build, componentIdentifier, originalComponent);
    context.register(componentIdentifier, compositeComponent, project.getProjectDir());
    for (LocalComponentArtifactMetadata artifactMetaData : localComponentRegistry.getAdditionalArtifacts(originalIdentifier)) {
        context.registerAdditionalArtifact(componentIdentifier, createCompositeCopy(componentIdentifier, artifactMetaData));
    }
}
Also used : DefaultLocalComponentMetadata(org.gradle.internal.component.local.model.DefaultLocalComponentMetadata) LocalComponentMetadata(org.gradle.internal.component.local.model.LocalComponentMetadata) DefaultLocalComponentMetadata(org.gradle.internal.component.local.model.DefaultLocalComponentMetadata) LocalComponentRegistry(org.gradle.api.internal.artifacts.ivyservice.projectmodule.LocalComponentRegistry) ProjectComponentIdentifier(org.gradle.api.artifacts.component.ProjectComponentIdentifier) LocalComponentArtifactMetadata(org.gradle.internal.component.local.model.LocalComponentArtifactMetadata)

Example 2 with DefaultLocalComponentMetadata

use of org.gradle.internal.component.local.model.DefaultLocalComponentMetadata in project gradle by gradle.

the class IncludedBuildDependencySubstitutionsBuilder method registerProject.

private void registerProject(IncludedBuild build, ProjectInternal project) {
    LocalComponentRegistry localComponentRegistry = project.getServices().get(LocalComponentRegistry.class);
    ProjectComponentIdentifier originalIdentifier = newProjectId(project);
    DefaultLocalComponentMetadata originalComponent = (DefaultLocalComponentMetadata) localComponentRegistry.getComponent(originalIdentifier);
    ProjectComponentIdentifier componentIdentifier = newProjectId(build, project.getPath());
    context.registerSubstitution(originalComponent.getId(), componentIdentifier);
}
Also used : DefaultLocalComponentMetadata(org.gradle.internal.component.local.model.DefaultLocalComponentMetadata) LocalComponentRegistry(org.gradle.api.internal.artifacts.ivyservice.projectmodule.LocalComponentRegistry) ProjectComponentIdentifier(org.gradle.api.artifacts.component.ProjectComponentIdentifier)

Example 3 with DefaultLocalComponentMetadata

use of org.gradle.internal.component.local.model.DefaultLocalComponentMetadata in project gradle by gradle.

the class DefaultProjectLocalComponentProvider method getLocalComponentMetaData.

private LocalComponentMetadata getLocalComponentMetaData(ProjectInternal project) {
    Module module = project.getModule();
    ModuleVersionIdentifier moduleVersionIdentifier = moduleIdentifierFactory.moduleWithVersion(module.getGroup(), module.getName(), module.getVersion());
    ComponentIdentifier componentIdentifier = newProjectId(project);
    DefaultLocalComponentMetadata metaData = new DefaultLocalComponentMetadata(moduleVersionIdentifier, componentIdentifier, module.getStatus(), (AttributesSchemaInternal) project.getDependencies().getAttributesSchema());
    metaDataBuilder.addConfigurations(metaData, project.getConfigurations().withType(ConfigurationInternal.class));
    return metaData;
}
Also used : ModuleVersionIdentifier(org.gradle.api.artifacts.ModuleVersionIdentifier) DefaultLocalComponentMetadata(org.gradle.internal.component.local.model.DefaultLocalComponentMetadata) ProjectComponentIdentifier(org.gradle.api.artifacts.component.ProjectComponentIdentifier) ComponentIdentifier(org.gradle.api.artifacts.component.ComponentIdentifier) Module(org.gradle.api.internal.artifacts.Module) ConfigurationInternal(org.gradle.api.internal.artifacts.configurations.ConfigurationInternal)

Example 4 with DefaultLocalComponentMetadata

use of org.gradle.internal.component.local.model.DefaultLocalComponentMetadata in project gradle by gradle.

the class IncludedBuildDependencyMetadataBuilder method registerProject.

private void registerProject(Map<ProjectComponentIdentifier, RegisteredProject> registeredProjects, IncludedBuildInternal build, ProjectInternal project) {
    LocalComponentRegistry localComponentRegistry = project.getServices().get(LocalComponentRegistry.class);
    ProjectComponentIdentifier originalIdentifier = newProjectId(project);
    DefaultLocalComponentMetadata originalComponent = (DefaultLocalComponentMetadata) localComponentRegistry.getComponent(originalIdentifier);
    ProjectComponentIdentifier componentIdentifier = build.idForProjectInThisBuild(project.getPath());
    LocalComponentMetadata compositeComponent = createCompositeCopy(build.getModel(), componentIdentifier, originalComponent);
    registeredProjects.put(componentIdentifier, new RegisteredProject(compositeComponent));
}
Also used : DefaultLocalComponentMetadata(org.gradle.internal.component.local.model.DefaultLocalComponentMetadata) LocalComponentMetadata(org.gradle.internal.component.local.model.LocalComponentMetadata) DefaultLocalComponentMetadata(org.gradle.internal.component.local.model.DefaultLocalComponentMetadata) LocalComponentRegistry(org.gradle.api.internal.artifacts.ivyservice.projectmodule.LocalComponentRegistry) ProjectComponentIdentifier(org.gradle.api.artifacts.component.ProjectComponentIdentifier)

Example 5 with DefaultLocalComponentMetadata

use of org.gradle.internal.component.local.model.DefaultLocalComponentMetadata in project gradle by gradle.

the class DefaultRootComponentMetadataBuilder method toRootComponentMetaData.

@Override
public ComponentResolveMetadata toRootComponentMetaData() {
    Module module = metadataProvider.getModule();
    ComponentIdentifier componentIdentifier = componentIdentifierFactory.createComponentIdentifier(module);
    DefaultLocalComponentMetadata metadata = holder.tryCached(componentIdentifier);
    if (metadata == null) {
        metadata = buildRootComponentMetadata(module, componentIdentifier);
        holder.cachedValue = metadata;
    }
    return metadata;
}
Also used : DefaultLocalComponentMetadata(org.gradle.internal.component.local.model.DefaultLocalComponentMetadata) ProjectComponentIdentifier(org.gradle.api.artifacts.component.ProjectComponentIdentifier) ComponentIdentifier(org.gradle.api.artifacts.component.ComponentIdentifier) Module(org.gradle.api.internal.artifacts.Module)

Aggregations

DefaultLocalComponentMetadata (org.gradle.internal.component.local.model.DefaultLocalComponentMetadata)9 ProjectComponentIdentifier (org.gradle.api.artifacts.component.ProjectComponentIdentifier)8 LocalComponentRegistry (org.gradle.api.internal.artifacts.ivyservice.projectmodule.LocalComponentRegistry)5 ModuleVersionIdentifier (org.gradle.api.artifacts.ModuleVersionIdentifier)4 Module (org.gradle.api.internal.artifacts.Module)4 ComponentIdentifier (org.gradle.api.artifacts.component.ComponentIdentifier)3 ConfigurationInternal (org.gradle.api.internal.artifacts.configurations.ConfigurationInternal)2 LocalComponentMetadata (org.gradle.internal.component.local.model.LocalComponentMetadata)2 GradleInternal (org.gradle.api.internal.GradleInternal)1 AttributesSchemaInternal (org.gradle.api.internal.attributes.AttributesSchemaInternal)1 ProjectInternal (org.gradle.api.internal.project.ProjectInternal)1 DefaultProjectComponentIdentifier (org.gradle.internal.component.local.model.DefaultProjectComponentIdentifier)1 LocalComponentArtifactMetadata (org.gradle.internal.component.local.model.LocalComponentArtifactMetadata)1