summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/util/ClassPath.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-02-11 15:10:45 +0000
committerPaul Phillips <paulp@improving.org>2010-02-11 15:10:45 +0000
commite9a60f236b00d417ddd6fd2ac30448f0228b2921 (patch)
treed7c2fdbccac5ac406eec4df020a7ef2f0785c7a8 /src/compiler/scala/tools/nsc/util/ClassPath.scala
parenta78bf650be7cc82e43907d1bbf966b3d802fc301 (diff)
downloadscala-e9a60f236b00d417ddd6fd2ac30448f0228b2921.tar.gz
scala-e9a60f236b00d417ddd6fd2ac30448f0228b2921.tar.bz2
scala-e9a60f236b00d417ddd6fd2ac30448f0228b2921.zip
More work on classpaths.
which we must have no test cases at all. In the short term there will probably be a few more minor disruptions since with classpaths constructed a half dozen different ways, achieving consistency requires flushing out the undocumented accidents upon which any given island might depend. Review by community.
Diffstat (limited to 'src/compiler/scala/tools/nsc/util/ClassPath.scala')
-rw-r--r--src/compiler/scala/tools/nsc/util/ClassPath.scala7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/util/ClassPath.scala b/src/compiler/scala/tools/nsc/util/ClassPath.scala
index 3f6bed5227..c0c1f7a417 100644
--- a/src/compiler/scala/tools/nsc/util/ClassPath.scala
+++ b/src/compiler/scala/tools/nsc/util/ClassPath.scala
@@ -148,6 +148,10 @@ abstract class ClassPath[T] {
*/
def name: String
+ /** An URL representing this classpath.
+ */
+ def asURLs: List[URL]
+
/** Info which should be propagated to any sub-classpaths.
*/
def context: ClassPathContext[T]
@@ -206,6 +210,7 @@ abstract class ClassPath[T] {
*/
class SourcePath[T](dir: AbstractFile, val context: ClassPathContext[T]) extends ClassPath[T] {
def name = dir.name
+ def asURLs = List(dir.sfile.toURL)
val sourcepaths: List[AbstractFile] = List(dir)
lazy val classes: List[ClassRep] = dir partialMap {
@@ -225,6 +230,7 @@ class SourcePath[T](dir: AbstractFile, val context: ClassPathContext[T]) extends
*/
class DirectoryClassPath(dir: AbstractFile, val context: ClassPathContext[AbstractFile]) extends ClassPath[AbstractFile] {
def name = dir.name
+ def asURLs = List(dir.sfile.toURL)
val sourcepaths: List[AbstractFile] = Nil
lazy val classes: List[ClassRep] = dir partialMap {
@@ -248,6 +254,7 @@ class MergedClassPath[T](
extends ClassPath[T] {
def name = entries.head.name
+ def asURLs = entries flatMap (_.asURLs)
lazy val sourcepaths: List[AbstractFile] = entries flatMap (_.sourcepaths)
lazy val classes: List[AnyClassRep] = {