summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/classpath/FlatClassPath.scala
diff options
context:
space:
mode:
authormpociecha <michal.pociecha@gmail.com>2014-11-29 18:00:37 +0100
committermpociecha <michal.pociecha@gmail.com>2014-11-30 22:31:31 +0100
commit3b585e901040e6a820e8533c5a818b7096b9625e (patch)
tree4dfe5b55d5d40268b84ee4fb4e5176c91b944a0a /src/compiler/scala/tools/nsc/classpath/FlatClassPath.scala
parentaf295c53a9c9bc3d579abd5678aba62210d23ada (diff)
downloadscala-3b585e901040e6a820e8533c5a818b7096b9625e.tar.gz
scala-3b585e901040e6a820e8533c5a818b7096b9625e.tar.bz2
scala-3b585e901040e6a820e8533c5a818b7096b9625e.zip
Add flat classpath implementation for directories
There's added the flat classpath implementation for directories using java.util.File directly. Since we work with a real directory - not the AbstractFile - we don't need to iterate all entries of a file to get inner entries of some package. We can just find an adequate directory for a package. There are added implementations for a class- and a sourcepath. Both extend DirectoryFileLookup which provides common logic.
Diffstat (limited to 'src/compiler/scala/tools/nsc/classpath/FlatClassPath.scala')
-rw-r--r--src/compiler/scala/tools/nsc/classpath/FlatClassPath.scala10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/classpath/FlatClassPath.scala b/src/compiler/scala/tools/nsc/classpath/FlatClassPath.scala
index bbd244b647..26b5429e23 100644
--- a/src/compiler/scala/tools/nsc/classpath/FlatClassPath.scala
+++ b/src/compiler/scala/tools/nsc/classpath/FlatClassPath.scala
@@ -89,3 +89,13 @@ private[nsc] case class ClassAndSourceFilesEntry(classFile: AbstractFile, srcFil
}
private[nsc] case class PackageEntryImpl(name: String) extends PackageEntry
+
+private[nsc] trait NoSourcePaths {
+ def asSourcePathString: String = ""
+ private[nsc] def sources(inPackage: String): Seq[SourceFileEntry] = Seq.empty
+}
+
+private[nsc] trait NoClassPaths {
+ def findClassFile(className: String): Option[AbstractFile] = None
+ private[nsc] def classes(inPackage: String): Seq[ClassFileEntry] = Seq.empty
+}