use of org.gradle.plugins.ide.idea.model.Dependency in project gradle by gradle.
the class IdeaDependenciesProvider method getProjectDependencies.
private Set<Dependency> getProjectDependencies(IdeaModule ideaModule, GeneratedIdeaScope scope) {
Collection<Configuration> plusConfigurations = getPlusConfigurations(ideaModule, scope);
Collection<Configuration> minusConfigurations = getMinusConfigurations(ideaModule, scope);
Collection<IdeProjectDependency> extractedDependencies = dependenciesExtractor.extractProjectDependencies(ideaModule.getProject(), plusConfigurations, minusConfigurations);
Set<Dependency> dependencies = Sets.newLinkedHashSet();
for (IdeProjectDependency ideProjectDependency : extractedDependencies) {
dependencies.add(moduleDependencyBuilder.create(ideProjectDependency, scope.name()));
}
return dependencies;
}
use of org.gradle.plugins.ide.idea.model.Dependency in project gradle by gradle.
the class IdeaDependenciesProvider method getExternalDependencies.
private Set<Dependency> getExternalDependencies(IdeaModule ideaModule, GeneratedIdeaScope scope) {
if (ideaModule.isOffline()) {
return Collections.emptySet();
}
Collection<Configuration> plusConfigurations = getPlusConfigurations(ideaModule, scope);
Collection<Configuration> minusConfigurations = getMinusConfigurations(ideaModule, scope);
Set<Dependency> dependencies = Sets.newLinkedHashSet();
Collection<IdeExtendedRepoFileDependency> ideRepoFileDependencies = dependenciesExtractor.extractRepoFileDependencies(ideaModule.getProject().getDependencies(), plusConfigurations, minusConfigurations, ideaModule.isDownloadSources(), ideaModule.isDownloadJavadoc());
for (IdeExtendedRepoFileDependency dependency : ideRepoFileDependencies) {
dependencies.add(toLibraryDependency(dependency, ideaModule, scope));
}
return dependencies;
}
use of org.gradle.plugins.ide.idea.model.Dependency 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;
}
use of org.gradle.plugins.ide.idea.model.Dependency in project gradle by gradle.
the class IdeaModelBuilder method buildDependencies.
private void buildDependencies(Map<String, DefaultIdeaModule> modules, IdeaModule ideaModule) {
ideaModule.setOffline(offlineDependencyResolution);
Set<Dependency> resolved = ideaModule.resolveDependencies();
List<DefaultIdeaDependency> dependencies = new LinkedList<DefaultIdeaDependency>();
for (Dependency dependency : resolved) {
if (dependency instanceof SingleEntryModuleLibrary) {
SingleEntryModuleLibrary d = (SingleEntryModuleLibrary) dependency;
DefaultIdeaSingleEntryLibraryDependency defaultDependency = new DefaultIdeaSingleEntryLibraryDependency().setFile(d.getLibraryFile()).setSource(d.getSourceFile()).setJavadoc(d.getJavadocFile()).setScope(new DefaultIdeaDependencyScope(d.getScope())).setExported(d.isExported());
if (d.getModuleVersion() != null) {
defaultDependency.setGradleModuleVersion(new DefaultGradleModuleVersion(d.getModuleVersion()));
}
dependencies.add(defaultDependency);
} else if (dependency instanceof ModuleDependency) {
ModuleDependency moduleDependency = (ModuleDependency) dependency;
DefaultIdeaModuleDependency ideaModuleDependency = new DefaultIdeaModuleDependency(moduleDependency.getName()).setExported(moduleDependency.isExported()).setScope(new DefaultIdeaDependencyScope(moduleDependency.getScope()));
// Find IdeaModule model for dependency within same build: may be null
DefaultIdeaModule targetModule = modules.get(moduleDependency.getName());
ideaModuleDependency.setDependencyModule(targetModule);
dependencies.add(ideaModuleDependency);
}
}
modules.get(ideaModule.getName()).setDependencies(dependencies);
}
use of org.gradle.plugins.ide.idea.model.Dependency in project gradle by gradle.
the class IdeaScalaConfigurer method getIdeaModuleLibraryDependenciesAsFiles.
private static Iterable<File> getIdeaModuleLibraryDependenciesAsFiles(IdeaModule ideaModule) {
// could make resolveDependencies() cache its result for later use by GenerateIdeaModule
Set<Dependency> dependencies = ideaModule.resolveDependencies();
List<File> files = Lists.newArrayList();
for (ModuleLibrary moduleLibrary : Iterables.filter(dependencies, ModuleLibrary.class)) {
for (FilePath filePath : Iterables.filter(moduleLibrary.getClasses(), FilePath.class)) {
files.add(filePath.getFile());
}
}
return files;
}
Aggregations