Search in sources :

Example 1 with LocalComponentArtifactMetadata

use of org.gradle.internal.component.local.model.LocalComponentArtifactMetadata 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 LocalComponentArtifactMetadata

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

the class CompositeBuildIdeProjectResolver method buildArtifactFile.

/**
     * Finds an IDE metadata artifact with the specified type, and executes tasks to build the artifact file.
     */
public File buildArtifactFile(ProjectComponentIdentifier project, String type) {
    LocalComponentArtifactMetadata artifactMetaData = findArtifact(project, type);
    if (artifactMetaData == null) {
        return null;
    }
    artifactBuilder.build(artifactMetaData);
    return artifactMetaData.getFile();
}
Also used : LocalComponentArtifactMetadata(org.gradle.internal.component.local.model.LocalComponentArtifactMetadata)

Example 3 with LocalComponentArtifactMetadata

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

the class ProjectDependencyResolver method resolveArtifact.

@Override
public void resolveArtifact(ComponentArtifactMetadata artifact, ModuleSource moduleSource, BuildableArtifactResolveResult result) {
    if (isProjectModule(artifact.getComponentId())) {
        LocalComponentArtifactMetadata projectArtifact = (LocalComponentArtifactMetadata) artifact;
        // Run any registered actions to build this artifact
        artifactBuilder.build(projectArtifact);
        File localArtifactFile = projectArtifact.getFile();
        if (localArtifactFile != null) {
            result.resolved(localArtifactFile);
        } else {
            result.notFound(projectArtifact.getId());
        }
    }
}
Also used : File(java.io.File) LocalComponentArtifactMetadata(org.gradle.internal.component.local.model.LocalComponentArtifactMetadata)

Aggregations

LocalComponentArtifactMetadata (org.gradle.internal.component.local.model.LocalComponentArtifactMetadata)3 File (java.io.File)1 ProjectComponentIdentifier (org.gradle.api.artifacts.component.ProjectComponentIdentifier)1 LocalComponentRegistry (org.gradle.api.internal.artifacts.ivyservice.projectmodule.LocalComponentRegistry)1 DefaultLocalComponentMetadata (org.gradle.internal.component.local.model.DefaultLocalComponentMetadata)1 LocalComponentMetadata (org.gradle.internal.component.local.model.LocalComponentMetadata)1