use of org.gradle.plugins.ide.eclipse.model.internal.SourceFoldersCreator in project gradle by gradle.
the class LinkedResourcesCreator method links.
public Set<Link> links(final Project project) {
SourceSetContainer sourceSets = project.getExtensions().getByType(JavaPluginExtension.class).getSourceSets();
EclipseClasspath classpath = project.getExtensions().getByType(EclipseModel.class).getClasspath();
File defaultOutputDir = classpath == null ? project.file(EclipsePluginConstants.DEFAULT_PROJECT_OUTPUT_PATH) : classpath.getDefaultOutputDir();
List<SourceFolder> sourceFolders = new SourceFoldersCreator().getBasicExternalSourceFolders(sourceSets, new Function<File, String>() {
@Override
public String apply(File dir) {
return project.relativePath(dir);
}
}, defaultOutputDir);
Set<Link> links = Sets.newLinkedHashSetWithExpectedSize(sourceFolders.size());
for (SourceFolder sourceFolder : sourceFolders) {
links.add(new Link(sourceFolder.getName(), "2", sourceFolder.getAbsolutePath(), null));
}
return links;
}
Aggregations