Search in sources :

Example 1 with UnresolvedIdeRepoFileDependency

use of org.gradle.plugins.ide.internal.resolver.model.UnresolvedIdeRepoFileDependency in project gradle by gradle.

the class DefaultIdeDependencyResolver method getUnresolvedIdeRepoFileDependencies.

/**
     * Gets unresolved IDE repository file dependencies.
     *
     * @param configuration Configuration
     * @return Unresolved IDE repositoru file dependencies
     */
public List<UnresolvedIdeRepoFileDependency> getUnresolvedIdeRepoFileDependencies(Configuration configuration) {
    ResolutionResult result = getIncomingResolutionResult(configuration);
    List<UnresolvedDependencyResult> unresolvedDependencies = findAllUnresolvedDependencyResults(result.getRoot().getDependencies());
    List<UnresolvedIdeRepoFileDependency> unresolvedIdeRepoFileDependencies = new ArrayList<UnresolvedIdeRepoFileDependency>();
    for (UnresolvedDependencyResult unresolvedDependencyResult : unresolvedDependencies) {
        Throwable failure = unresolvedDependencyResult.getFailure();
        ComponentSelector componentSelector = unresolvedDependencyResult.getAttempted();
        String displayName = componentSelector.getDisplayName();
        File file = new File(unresolvedFileName(componentSelector));
        unresolvedIdeRepoFileDependencies.add(new UnresolvedIdeRepoFileDependency(file, failure, displayName));
    }
    return unresolvedIdeRepoFileDependencies;
}
Also used : UnresolvedDependencyResult(org.gradle.api.artifacts.result.UnresolvedDependencyResult) ComponentSelector(org.gradle.api.artifacts.component.ComponentSelector) ResolutionResult(org.gradle.api.artifacts.result.ResolutionResult) UnresolvedIdeRepoFileDependency(org.gradle.plugins.ide.internal.resolver.model.UnresolvedIdeRepoFileDependency) ArrayList(java.util.ArrayList) File(java.io.File)

Example 2 with UnresolvedIdeRepoFileDependency

use of org.gradle.plugins.ide.internal.resolver.model.UnresolvedIdeRepoFileDependency in project gradle by gradle.

the class UnresolvedDependenciesLogger method log.

public void log(Collection<UnresolvedIdeRepoFileDependency> deps) {
    for (UnresolvedIdeRepoFileDependency dep : deps) {
        logger.warn("Could not resolve: " + dep.getDisplayName());
        logger.debug("Could not resolve: " + dep.getDisplayName(), dep.getProblem());
    }
}
Also used : UnresolvedIdeRepoFileDependency(org.gradle.plugins.ide.internal.resolver.model.UnresolvedIdeRepoFileDependency)

Example 3 with UnresolvedIdeRepoFileDependency

use of org.gradle.plugins.ide.internal.resolver.model.UnresolvedIdeRepoFileDependency 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;
}
Also used : IdeExtendedRepoFileDependency(org.gradle.plugins.ide.internal.resolver.model.IdeExtendedRepoFileDependency) UnresolvedIdeRepoFileDependency(org.gradle.plugins.ide.internal.resolver.model.UnresolvedIdeRepoFileDependency) ArrayList(java.util.ArrayList) ProjectComponentIdentifier(org.gradle.api.artifacts.component.ProjectComponentIdentifier) ComponentIdentifier(org.gradle.api.artifacts.component.ComponentIdentifier) DefaultModuleComponentIdentifier(org.gradle.internal.component.external.model.DefaultModuleComponentIdentifier) ModuleComponentIdentifier(org.gradle.api.artifacts.component.ModuleComponentIdentifier) JavadocArtifact(org.gradle.language.java.artifact.JavadocArtifact) SourcesArtifact(org.gradle.language.base.artifact.SourcesArtifact) Artifact(org.gradle.api.component.Artifact)

Aggregations

UnresolvedIdeRepoFileDependency (org.gradle.plugins.ide.internal.resolver.model.UnresolvedIdeRepoFileDependency)3 ArrayList (java.util.ArrayList)2 File (java.io.File)1 ComponentIdentifier (org.gradle.api.artifacts.component.ComponentIdentifier)1 ComponentSelector (org.gradle.api.artifacts.component.ComponentSelector)1 ModuleComponentIdentifier (org.gradle.api.artifacts.component.ModuleComponentIdentifier)1 ProjectComponentIdentifier (org.gradle.api.artifacts.component.ProjectComponentIdentifier)1 ResolutionResult (org.gradle.api.artifacts.result.ResolutionResult)1 UnresolvedDependencyResult (org.gradle.api.artifacts.result.UnresolvedDependencyResult)1 Artifact (org.gradle.api.component.Artifact)1 DefaultModuleComponentIdentifier (org.gradle.internal.component.external.model.DefaultModuleComponentIdentifier)1 SourcesArtifact (org.gradle.language.base.artifact.SourcesArtifact)1 JavadocArtifact (org.gradle.language.java.artifact.JavadocArtifact)1 IdeExtendedRepoFileDependency (org.gradle.plugins.ide.internal.resolver.model.IdeExtendedRepoFileDependency)1