Search in sources :

Example 6 with DefaultProjectComponentIdentifier

use of org.gradle.api.internal.artifacts.DefaultProjectComponentIdentifier in project gradle by gradle.

the class AbstractCompositeParticipantBuildState method registerProject.

private void registerProject(Set<Pair<ModuleVersionIdentifier, ProjectComponentIdentifier>> availableModules, ProjectInternal project) {
    ProjectComponentIdentifier projectIdentifier = new DefaultProjectComponentIdentifier(getBuildIdentifier(), project.getIdentityPath(), project.getProjectPath(), project.getName());
    ModuleVersionIdentifier moduleId = DefaultModuleVersionIdentifier.newId(project.getDependencyMetaDataProvider().getModule());
    LOGGER.info("Registering {} in composite build. Will substitute for module '{}'.", project, moduleId.getModule());
    availableModules.add(Pair.of(moduleId, projectIdentifier));
}
Also used : ModuleVersionIdentifier(org.gradle.api.artifacts.ModuleVersionIdentifier) DefaultModuleVersionIdentifier(org.gradle.api.internal.artifacts.DefaultModuleVersionIdentifier) DefaultProjectComponentIdentifier(org.gradle.api.internal.artifacts.DefaultProjectComponentIdentifier) ProjectComponentIdentifier(org.gradle.api.artifacts.component.ProjectComponentIdentifier) DefaultProjectComponentIdentifier(org.gradle.api.internal.artifacts.DefaultProjectComponentIdentifier)

Example 7 with DefaultProjectComponentIdentifier

use of org.gradle.api.internal.artifacts.DefaultProjectComponentIdentifier in project gradle by gradle.

the class DefaultProjectStateRegistry method addProject.

private ProjectState addProject(BuildState owner, DefaultBuildProjectRegistry projectRegistry, DefaultProjectDescriptor descriptor) {
    Path projectPath = descriptor.path();
    Path identityPath = owner.calculateIdentityPathForProject(projectPath);
    String name = descriptor.getName();
    ProjectComponentIdentifier projectIdentifier = new DefaultProjectComponentIdentifier(owner.getBuildIdentifier(), identityPath, projectPath, name);
    IProjectFactory projectFactory = owner.getMutableModel().getServices().get(IProjectFactory.class);
    StateTransitionControllerFactory stateTransitionControllerFactory = owner.getMutableModel().getServices().get(StateTransitionControllerFactory.class);
    ProjectStateImpl projectState = new ProjectStateImpl(owner, identityPath, projectPath, descriptor.getName(), projectIdentifier, descriptor, projectFactory, stateTransitionControllerFactory);
    projectsByPath.put(identityPath, projectState);
    projectsById.put(projectIdentifier, projectState);
    projectRegistry.add(projectPath, projectState);
    return projectState;
}
Also used : Path(org.gradle.util.Path) StateTransitionControllerFactory(org.gradle.internal.model.StateTransitionControllerFactory) DefaultProjectComponentIdentifier(org.gradle.api.internal.artifacts.DefaultProjectComponentIdentifier) ProjectComponentIdentifier(org.gradle.api.artifacts.component.ProjectComponentIdentifier) DefaultProjectComponentIdentifier(org.gradle.api.internal.artifacts.DefaultProjectComponentIdentifier)

Aggregations

DefaultProjectComponentIdentifier (org.gradle.api.internal.artifacts.DefaultProjectComponentIdentifier)7 ProjectComponentIdentifier (org.gradle.api.artifacts.component.ProjectComponentIdentifier)3 MavenUniqueSnapshotComponentIdentifier (org.gradle.api.internal.artifacts.repositories.resolver.MavenUniqueSnapshotComponentIdentifier)3 DefaultModuleComponentIdentifier (org.gradle.internal.component.external.model.DefaultModuleComponentIdentifier)3 DefaultLibraryBinaryIdentifier (org.gradle.internal.component.local.model.DefaultLibraryBinaryIdentifier)3 OpaqueComponentArtifactIdentifier (org.gradle.internal.component.local.model.OpaqueComponentArtifactIdentifier)3 Path (org.gradle.util.Path)3 BuildIdentifier (org.gradle.api.artifacts.component.BuildIdentifier)2 LibraryBinaryIdentifier (org.gradle.api.artifacts.component.LibraryBinaryIdentifier)2 ModuleComponentIdentifier (org.gradle.api.artifacts.component.ModuleComponentIdentifier)2 File (java.io.File)1 ModuleVersionIdentifier (org.gradle.api.artifacts.ModuleVersionIdentifier)1 DefaultBuildIdentifier (org.gradle.api.internal.artifacts.DefaultBuildIdentifier)1 DefaultModuleVersionIdentifier (org.gradle.api.internal.artifacts.DefaultModuleVersionIdentifier)1 ForeignBuildIdentifier (org.gradle.api.internal.artifacts.ForeignBuildIdentifier)1 StateTransitionControllerFactory (org.gradle.internal.model.StateTransitionControllerFactory)1