use of org.gradle.api.artifacts.component.ComponentIdentifier 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) {
return metaData;
}
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();
metaData = new DefaultLocalComponentMetadata(moduleVersionIdentifier, componentIdentifier, module.getStatus(), schema);
localComponentMetadataBuilder.addConfigurations(metaData, configurationsProvider.getAll());
holder.cachedValue = metaData;
return metaData;
}
use of org.gradle.api.artifacts.component.ComponentIdentifier 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());
}
use of org.gradle.api.artifacts.component.ComponentIdentifier 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.api.artifacts.component.ComponentIdentifier in project gradle by gradle.
the class JsonProjectDependencyRenderer method populateModulesWithChildDependencies.
private void populateModulesWithChildDependencies(RenderableDependency dependency, Set<ComponentIdentifier> visited, Set<ModuleIdentifier> modules) {
for (RenderableDependency childDependency : dependency.getChildren()) {
ModuleIdentifier moduleId = getModuleIdentifier(childDependency);
if (moduleId == null) {
continue;
}
modules.add(moduleId);
boolean alreadyVisited = !visited.add((ComponentIdentifier) childDependency.getId());
if (!alreadyVisited) {
populateModulesWithChildDependencies(childDependency, visited, modules);
}
}
}
use of org.gradle.api.artifacts.component.ComponentIdentifier in project gradle by gradle.
the class IdeDependenciesExtractor method extractRepoFileDependencies.
public Collection<IdeExtendedRepoFileDependency> extractRepoFileDependencies(DependencyHandler dependencyHandler, Collection<Configuration> plusConfigurations, Collection<Configuration> minusConfigurations, boolean downloadSources, boolean downloadJavadoc) {
// can have multiple IDE dependencies with same component identifier (see GRADLE-1622)
Multimap<ComponentIdentifier, IdeExtendedRepoFileDependency> resolvedDependenciesComponentMap = LinkedHashMultimap.create();
for (IdeExtendedRepoFileDependency dep : resolvedExternalDependencies(plusConfigurations, minusConfigurations)) {
resolvedDependenciesComponentMap.put(toComponentIdentifier(dep.getId()), dep);
}
List<Class<? extends Artifact>> artifactTypes = new ArrayList<Class<? extends Artifact>>(2);
if (downloadSources) {
artifactTypes.add(SourcesArtifact.class);
}
if (downloadJavadoc) {
artifactTypes.add(JavadocArtifact.class);
}
downloadAuxiliaryArtifacts(dependencyHandler, resolvedDependenciesComponentMap, artifactTypes);
Collection<UnresolvedIdeRepoFileDependency> unresolvedDependencies = unresolvedExternalDependencies(plusConfigurations, minusConfigurations);
Collection<IdeExtendedRepoFileDependency> resolvedDependencies = resolvedDependenciesComponentMap.values();
Collection<IdeExtendedRepoFileDependency> resolvedAndUnresolved = new ArrayList<IdeExtendedRepoFileDependency>(unresolvedDependencies.size() + resolvedDependencies.size());
resolvedAndUnresolved.addAll(resolvedDependencies);
resolvedAndUnresolved.addAll(unresolvedDependencies);
return resolvedAndUnresolved;
}
Aggregations