Search in sources :

Example 1 with IdeLocalFileDependency

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

the class WtpClasspathAttributeSupport method collectFilesFromConfigs.

private static Set<File> collectFilesFromConfigs(Set<Configuration> configs, Set<Configuration> minusConfigs) {
    Set<File> resultFiles = Sets.newHashSet();
    IdeDependenciesExtractor extractor = new IdeDependenciesExtractor();
    Collection<IdeExtendedRepoFileDependency> dependencies = extractor.resolvedExternalDependencies(configs, minusConfigs);
    for (IdeExtendedRepoFileDependency dependency : dependencies) {
        resultFiles.add(dependency.getFile());
    }
    Collection<IdeLocalFileDependency> localDependencies = extractor.extractLocalFileDependencies(configs, minusConfigs);
    for (IdeLocalFileDependency dependency : localDependencies) {
        resultFiles.add(dependency.getFile());
    }
    return resultFiles;
}
Also used : IdeLocalFileDependency(org.gradle.plugins.ide.internal.resolver.model.IdeLocalFileDependency) IdeExtendedRepoFileDependency(org.gradle.plugins.ide.internal.resolver.model.IdeExtendedRepoFileDependency) File(java.io.File) IdeDependenciesExtractor(org.gradle.plugins.ide.internal.IdeDependenciesExtractor)

Example 2 with IdeLocalFileDependency

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

the class WtpComponentFactory method getEntriesFromLibraries.

private List<WbDependentModule> getEntriesFromLibraries(Set<Configuration> plusConfigurations, Set<Configuration> minusConfigurations, EclipseWtpComponent wtp, String deployPath) {
    IdeDependenciesExtractor extractor = new IdeDependenciesExtractor();
    //below is not perfect because we're skipping the unresolved dependencies completely
    //however, it should be better anyway. Sometime soon we will hopefully change the wtp component stuff
    Collection<IdeExtendedRepoFileDependency> externals = extractor.resolvedExternalDependencies(plusConfigurations, minusConfigurations);
    Collection<IdeLocalFileDependency> locals = extractor.extractLocalFileDependencies(plusConfigurations, minusConfigurations);
    Collection<File> libFiles = Lists.newArrayList();
    for (IdeExtendedRepoFileDependency dependency : externals) {
        libFiles.add(dependency.getFile());
    }
    for (IdeLocalFileDependency dependency : locals) {
        libFiles.add(dependency.getFile());
    }
    List<WbDependentModule> libraryEntries = Lists.newArrayList();
    for (File file : libFiles) {
        libraryEntries.add(createWbDependentModuleEntry(file, wtp.getFileReferenceFactory(), deployPath));
    }
    return libraryEntries;
}
Also used : IdeLocalFileDependency(org.gradle.plugins.ide.internal.resolver.model.IdeLocalFileDependency) IdeExtendedRepoFileDependency(org.gradle.plugins.ide.internal.resolver.model.IdeExtendedRepoFileDependency) WbDependentModule(org.gradle.plugins.ide.eclipse.model.WbDependentModule) File(java.io.File) IdeDependenciesExtractor(org.gradle.plugins.ide.internal.IdeDependenciesExtractor)

Example 3 with IdeLocalFileDependency

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

the class EclipseDependenciesCreator method createLibraryDependencies.

private List<AbstractClasspathEntry> createLibraryDependencies() {
    ArrayList<AbstractClasspathEntry> libraries = Lists.newArrayList();
    boolean downloadSources = classpath.isDownloadSources();
    boolean downloadJavadoc = classpath.isDownloadJavadoc();
    Collection<IdeExtendedRepoFileDependency> repoFileDependencies = dependenciesExtractor.extractRepoFileDependencies(classpath.getProject().getDependencies(), classpath.getPlusConfigurations(), classpath.getMinusConfigurations(), downloadSources, downloadJavadoc);
    for (IdeExtendedRepoFileDependency dependency : repoFileDependencies) {
        libraries.add(createLibraryEntry(dependency.getFile(), dependency.getSourceFile(), dependency.getJavadocFile(), classpath, dependency.getId()));
    }
    Collection<IdeLocalFileDependency> localFileDependencies = dependenciesExtractor.extractLocalFileDependencies(classpath.getPlusConfigurations(), classpath.getMinusConfigurations());
    for (IdeLocalFileDependency it : localFileDependencies) {
        libraries.add(createLibraryEntry(it.getFile(), null, null, classpath, null));
    }
    return libraries;
}
Also used : IdeLocalFileDependency(org.gradle.plugins.ide.internal.resolver.model.IdeLocalFileDependency) IdeExtendedRepoFileDependency(org.gradle.plugins.ide.internal.resolver.model.IdeExtendedRepoFileDependency) AbstractClasspathEntry(org.gradle.plugins.ide.eclipse.model.AbstractClasspathEntry)

Example 4 with IdeLocalFileDependency

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

the class DefaultIdeDependencyResolver method getIdeLocalFileDependencies.

/**
     * Gets IDE local file dependencies.
     *
     * @param configuration Configuration
     * @return IDE local file dependencies
     */
public List<IdeLocalFileDependency> getIdeLocalFileDependencies(Configuration configuration) {
    List<SelfResolvingDependency> externalDependencies = new ArrayList<SelfResolvingDependency>();
    findAllExternalDependencies(externalDependencies, new ArrayList<Dependency>(), configuration);
    List<IdeLocalFileDependency> ideLocalFileDependencies = new ArrayList<IdeLocalFileDependency>();
    for (SelfResolvingDependency externalDependency : externalDependencies) {
        Set<File> resolvedFiles = externalDependency.resolve(configuration.isTransitive());
        for (File resolvedFile : resolvedFiles) {
            IdeLocalFileDependency ideLocalFileDependency = new IdeLocalFileDependency(resolvedFile);
            ideLocalFileDependencies.add(ideLocalFileDependency);
        }
    }
    return ideLocalFileDependencies;
}
Also used : IdeLocalFileDependency(org.gradle.plugins.ide.internal.resolver.model.IdeLocalFileDependency) SelfResolvingDependency(org.gradle.api.artifacts.SelfResolvingDependency) ArrayList(java.util.ArrayList) UnresolvedIdeRepoFileDependency(org.gradle.plugins.ide.internal.resolver.model.UnresolvedIdeRepoFileDependency) SelfResolvingDependency(org.gradle.api.artifacts.SelfResolvingDependency) ProjectDependency(org.gradle.api.artifacts.ProjectDependency) IdeLocalFileDependency(org.gradle.plugins.ide.internal.resolver.model.IdeLocalFileDependency) IdeProjectDependency(org.gradle.plugins.ide.internal.resolver.model.IdeProjectDependency) IdeExtendedRepoFileDependency(org.gradle.plugins.ide.internal.resolver.model.IdeExtendedRepoFileDependency) Dependency(org.gradle.api.artifacts.Dependency) File(java.io.File)

Example 5 with IdeLocalFileDependency

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

the class IdeaDependenciesProvider method getFileDependencies.

private Set<Dependency> getFileDependencies(IdeaModule ideaModule, GeneratedIdeaScope scope) {
    Collection<Configuration> plusConfigurations = getPlusConfigurations(ideaModule, scope);
    Collection<Configuration> minusConfigurations = getMinusConfigurations(ideaModule, scope);
    Set<Dependency> dependencies = Sets.newLinkedHashSet();
    Collection<IdeLocalFileDependency> ideLocalFileDependencies = dependenciesExtractor.extractLocalFileDependencies(plusConfigurations, minusConfigurations);
    for (IdeLocalFileDependency fileDependency : ideLocalFileDependencies) {
        dependencies.add(toLibraryDependency(fileDependency, ideaModule, scope));
    }
    return dependencies;
}
Also used : IdeLocalFileDependency(org.gradle.plugins.ide.internal.resolver.model.IdeLocalFileDependency) Configuration(org.gradle.api.artifacts.Configuration) UnresolvedIdeRepoFileDependency(org.gradle.plugins.ide.internal.resolver.model.UnresolvedIdeRepoFileDependency) IdeLocalFileDependency(org.gradle.plugins.ide.internal.resolver.model.IdeLocalFileDependency) IdeProjectDependency(org.gradle.plugins.ide.internal.resolver.model.IdeProjectDependency) Dependency(org.gradle.plugins.ide.idea.model.Dependency) IdeExtendedRepoFileDependency(org.gradle.plugins.ide.internal.resolver.model.IdeExtendedRepoFileDependency)

Aggregations

IdeExtendedRepoFileDependency (org.gradle.plugins.ide.internal.resolver.model.IdeExtendedRepoFileDependency)5 IdeLocalFileDependency (org.gradle.plugins.ide.internal.resolver.model.IdeLocalFileDependency)5 File (java.io.File)3 IdeDependenciesExtractor (org.gradle.plugins.ide.internal.IdeDependenciesExtractor)2 IdeProjectDependency (org.gradle.plugins.ide.internal.resolver.model.IdeProjectDependency)2 UnresolvedIdeRepoFileDependency (org.gradle.plugins.ide.internal.resolver.model.UnresolvedIdeRepoFileDependency)2 ArrayList (java.util.ArrayList)1 Configuration (org.gradle.api.artifacts.Configuration)1 Dependency (org.gradle.api.artifacts.Dependency)1 ProjectDependency (org.gradle.api.artifacts.ProjectDependency)1 SelfResolvingDependency (org.gradle.api.artifacts.SelfResolvingDependency)1 AbstractClasspathEntry (org.gradle.plugins.ide.eclipse.model.AbstractClasspathEntry)1 WbDependentModule (org.gradle.plugins.ide.eclipse.model.WbDependentModule)1 Dependency (org.gradle.plugins.ide.idea.model.Dependency)1