List<ISourceContainer> result = new ArrayList<ISourceContainer>(superResult.length * 2);
result.addAll(getSrcFoldersAsISourceContainers(configuration));
for (ISourceContainer sourceContainer: superResult) {
if (sourceContainer instanceof PackageFragmentRootSourceContainer) {
PackageFragmentRootSourceContainer sc = (PackageFragmentRootSourceContainer) sourceContainer;
IPath maybeSourcePath = sc.getPackageFragmentRoot().getSourceAttachmentPath();
if (maybeSourcePath != null) {
maybeSourcePath = ClojureCore.toOSAbsoluteIPath(maybeSourcePath);
if (maybeSourcePath.toFile().isFile()) {
result.add(new ExternalArchiveSourceContainer(maybeSourcePath.toOSString(), false));
} else {
result.add(new DirectorySourceContainer(maybeSourcePath, false));
}
}
// unconditionnally add the path of the archive, *after* the sourcePath, so that cljs in sourcePath
// take precedence over cljs in "bin" path
if (sc.getPackageFragmentRoot().isExternal()) {
if (sc.getPackageFragmentRoot().isArchive()) {
result.add(new ExternalArchiveSourceContainer(sc.getPackageFragmentRoot().getPath().toOSString(), false));
} else {
result.add(new DirectorySourceContainer(sc.getPackageFragmentRoot().getPath(), false));
}
} else {
if (sc.getPackageFragmentRoot().isArchive()) {
result.add(new ArchiveSourceContainer((IFile) sc.getPackageFragmentRoot().getCorrespondingResource(), false));
} else {
result.add(new FolderSourceContainer((IContainer) sc.getPackageFragmentRoot().getCorrespondingResource(), false));
}
}
} else if (sourceContainer instanceof ExternalArchiveSourceContainer) {
// TODO
ExternalArchiveSourceContainer sc = (ExternalArchiveSourceContainer) sourceContainer;
} else if (sourceContainer instanceof JavaProjectSourceContainer) {
// TODO
JavaProjectSourceContainer sc = (JavaProjectSourceContainer) sourceContainer;
sc.getJavaProject();
} else {
/* TODO manager other kinds ?
DirectorySourceContainer
ISourceContainer