Search in sources :

Example 1 with Module

use of org.gradle.api.internal.artifacts.Module 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 2 with Module

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

the class ShortCircuitEmptyConfigurationResolver method emptyGraph.

private void emptyGraph(ConfigurationInternal configuration, ResolverResults results) {
    Module module = configuration.getModule();
    ModuleVersionIdentifier id = moduleIdentifierFactory.moduleWithVersion(module);
    ComponentIdentifier componentIdentifier = componentIdentifierFactory.createComponentIdentifier(module);
    ResolutionResult emptyResult = DefaultResolutionResultBuilder.empty(id, componentIdentifier);
    ResolvedLocalComponentsResult emptyProjectResult = new ResolvedLocalComponentsResultGraphVisitor(thisBuild.getCurrentBuild());
    results.graphResolved(emptyResult, emptyProjectResult, new EmptyResults());
}
Also used : ModuleVersionIdentifier(org.gradle.api.artifacts.ModuleVersionIdentifier) ResolutionResult(org.gradle.api.artifacts.result.ResolutionResult) ComponentIdentifier(org.gradle.api.artifacts.component.ComponentIdentifier) Module(org.gradle.api.internal.artifacts.Module) ResolvedLocalComponentsResult(org.gradle.api.internal.artifacts.ivyservice.resolveengine.projectresult.ResolvedLocalComponentsResult) ResolvedLocalComponentsResultGraphVisitor(org.gradle.api.internal.artifacts.ivyservice.resolveengine.projectresult.ResolvedLocalComponentsResultGraphVisitor)

Example 3 with Module

use of org.gradle.api.internal.artifacts.Module 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)

Example 4 with Module

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

the class ProjectIvyDependencyDescriptorFactory method createDependencyDescriptor.

public DslOriginDependencyMetadata createDependencyDescriptor(String clientConfiguration, AttributeContainer clientAttributes, ModuleDependency dependency) {
    ProjectDependencyInternal projectDependency = (ProjectDependencyInternal) dependency;
    projectDependency.beforeResolved();
    Module module = getProjectModule(dependency);
    ModuleVersionSelector requested = new DefaultModuleVersionSelector(module.getGroup(), module.getName(), module.getVersion());
    ComponentSelector selector = DefaultProjectComponentSelector.newSelector(projectDependency.getDependencyProject());
    List<Exclude> excludes = convertExcludeRules(clientConfiguration, dependency.getExcludeRules());
    LocalComponentDependencyMetadata dependencyMetaData = new LocalComponentDependencyMetadata(selector, requested, clientConfiguration, clientAttributes, projectDependency.getTargetConfiguration(), convertArtifacts(dependency.getArtifacts()), excludes, false, false, dependency.isTransitive());
    return new DslOriginDependencyMetadataWrapper(dependencyMetaData, dependency);
}
Also used : ProjectDependencyInternal(org.gradle.api.internal.artifacts.dependencies.ProjectDependencyInternal) DefaultModuleVersionSelector(org.gradle.api.internal.artifacts.DefaultModuleVersionSelector) ModuleVersionSelector(org.gradle.api.artifacts.ModuleVersionSelector) DefaultModuleVersionSelector(org.gradle.api.internal.artifacts.DefaultModuleVersionSelector) Exclude(org.gradle.internal.component.model.Exclude) ComponentSelector(org.gradle.api.artifacts.component.ComponentSelector) DefaultProjectComponentSelector(org.gradle.internal.component.local.model.DefaultProjectComponentSelector) DslOriginDependencyMetadataWrapper(org.gradle.internal.component.local.model.DslOriginDependencyMetadataWrapper) Module(org.gradle.api.internal.artifacts.Module) LocalComponentDependencyMetadata(org.gradle.internal.component.model.LocalComponentDependencyMetadata)

Example 5 with Module

use of org.gradle.api.internal.artifacts.Module 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;
}
Also used : ModuleVersionIdentifier(org.gradle.api.artifacts.ModuleVersionIdentifier) DefaultLocalComponentMetadata(org.gradle.internal.component.local.model.DefaultLocalComponentMetadata) ProjectInternal(org.gradle.api.internal.project.ProjectInternal) ComponentIdentifier(org.gradle.api.artifacts.component.ComponentIdentifier) Module(org.gradle.api.internal.artifacts.Module) AttributesSchemaInternal(org.gradle.api.internal.attributes.AttributesSchemaInternal)

Aggregations

Module (org.gradle.api.internal.artifacts.Module)9 ModuleVersionIdentifier (org.gradle.api.artifacts.ModuleVersionIdentifier)5 ComponentIdentifier (org.gradle.api.artifacts.component.ComponentIdentifier)5 DefaultLocalComponentMetadata (org.gradle.internal.component.local.model.DefaultLocalComponentMetadata)4 ProjectComponentIdentifier (org.gradle.api.artifacts.component.ProjectComponentIdentifier)3 ConfigurationInternal (org.gradle.api.internal.artifacts.configurations.ConfigurationInternal)3 ResolutionResult (org.gradle.api.artifacts.result.ResolutionResult)2 ResolvedLocalComponentsResult (org.gradle.api.internal.artifacts.ivyservice.resolveengine.projectresult.ResolvedLocalComponentsResult)2 ResolvedLocalComponentsResultGraphVisitor (org.gradle.api.internal.artifacts.ivyservice.resolveengine.projectresult.ResolvedLocalComponentsResultGraphVisitor)2 File (java.io.File)1 List (java.util.List)1 Set (java.util.Set)1 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)1 Inject (javax.inject.Inject)1 StringUtils.capitalize (org.apache.commons.lang.StringUtils.capitalize)1 NamedDomainObjectFactory (org.gradle.api.NamedDomainObjectFactory)1 NamedDomainObjectList (org.gradle.api.NamedDomainObjectList)1 NamedDomainObjectSet (org.gradle.api.NamedDomainObjectSet)1 Plugin (org.gradle.api.Plugin)1 Project (org.gradle.api.Project)1