Search in sources :

Example 1 with FilePath

use of org.gradle.plugins.ide.idea.model.FilePath in project gradle by gradle.

the class IdeaDependenciesProvider method toLibraryDependency.

private SingleEntryModuleLibrary toLibraryDependency(IdeExtendedRepoFileDependency dependency, IdeaModule ideaModule, GeneratedIdeaScope scope) {
    Set<FilePath> javadoc = Sets.newLinkedHashSet();
    for (File javaDocFile : dependency.getJavadocFiles()) {
        javadoc.add(toPath(ideaModule, javaDocFile));
    }
    Set<FilePath> source = Sets.newLinkedHashSet();
    for (File sourceFile : dependency.getSourceFiles()) {
        source.add(toPath(ideaModule, sourceFile));
    }
    SingleEntryModuleLibrary library = new SingleEntryModuleLibrary(toPath(ideaModule, dependency.getFile()), javadoc, source, scope.name());
    library.setModuleVersion(dependency.getId());
    return library;
}
Also used : FilePath(org.gradle.plugins.ide.idea.model.FilePath) SingleEntryModuleLibrary(org.gradle.plugins.ide.idea.model.SingleEntryModuleLibrary) File(java.io.File)

Example 2 with FilePath

use of org.gradle.plugins.ide.idea.model.FilePath 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;
}
Also used : FilePath(org.gradle.plugins.ide.idea.model.FilePath) ModuleLibrary(org.gradle.plugins.ide.idea.model.ModuleLibrary) Dependency(org.gradle.plugins.ide.idea.model.Dependency) File(java.io.File)

Aggregations

File (java.io.File)2 FilePath (org.gradle.plugins.ide.idea.model.FilePath)2 Dependency (org.gradle.plugins.ide.idea.model.Dependency)1 ModuleLibrary (org.gradle.plugins.ide.idea.model.ModuleLibrary)1 SingleEntryModuleLibrary (org.gradle.plugins.ide.idea.model.SingleEntryModuleLibrary)1