diff options
Diffstat (limited to 'src/compiler/scala/tools/util/PathResolver.scala')
-rw-r--r-- | src/compiler/scala/tools/util/PathResolver.scala | 34 |
1 files changed, 5 insertions, 29 deletions
diff --git a/src/compiler/scala/tools/util/PathResolver.scala b/src/compiler/scala/tools/util/PathResolver.scala index 9decc99c8d..11b9766da4 100644 --- a/src/compiler/scala/tools/util/PathResolver.scala +++ b/src/compiler/scala/tools/util/PathResolver.scala @@ -10,9 +10,8 @@ package util import java.net.URL import scala.tools.reflect.WrappedProperties.AccessControl import scala.tools.nsc.Settings -import scala.tools.nsc.util.{ ClassFileLookup, ClassPath, JavaClassPath } +import scala.tools.nsc.util.{ClassFileLookup, ClassPath} import scala.reflect.io.{ File, Directory, Path, AbstractFile } -import ClassPath.{ JavaContext, DefaultJavaContext, split } import PartialFunction.condOpt import scala.tools.nsc.classpath.{ AggregateFlatClassPath, ClassPathFactory, FlatClassPath, FlatClassPathFactory } import scala.tools.nsc.settings.ClassPathRepresentationType @@ -40,7 +39,7 @@ object PathResolver { } /** pretty print class path */ - def ppcp(s: String) = split(s) match { + def ppcp(s: String) = ClassPath.split(s) match { case Nil => "" case Seq(x) => x case xs => xs.mkString(EOL, EOL, "") @@ -164,13 +163,6 @@ object PathResolver { |}""".asLines } - @deprecated("This method is no longer used be scalap and will be deleted", "2.11.5") - def fromPathString(path: String, context: JavaContext = DefaultJavaContext): JavaClassPath = { - val s = new Settings() - s.classpath.value = path - new PathResolver(s, context).result - } - /** With no arguments, show the interesting values in Environment and Defaults. * If there are arguments, show those in Calculated as if those options had been * given to a scala runner. @@ -187,8 +179,6 @@ object PathResolver { println("RESIDUAL: 'scala %s'\n".format(rest.mkString(" "))) pr.result match { - case cp: JavaClassPath => - cp.show() case cp: AggregateFlatClassPath => println(s"ClassPath has ${cp.aggregates.size} entries and results in:\n${cp.asClassPathStrings}") } @@ -196,12 +186,12 @@ object PathResolver { } trait PathResolverResult { - def result: ClassFileLookup[AbstractFile] + def result: ClassFileLookup def resultAsURLs: Seq[URL] = result.asURLs } -abstract class PathResolverBase[BaseClassPathType <: ClassFileLookup[AbstractFile], ResultClassPathType <: BaseClassPathType] +abstract class PathResolverBase[BaseClassPathType <: ClassFileLookup, ResultClassPathType <: BaseClassPathType] (settings: Settings, classPathFactory: ClassPathFactory[BaseClassPathType]) extends PathResolverResult { @@ -301,15 +291,6 @@ abstract class PathResolverBase[BaseClassPathType <: ClassFileLookup[AbstractFil protected def computeResult(): ResultClassPathType } -class PathResolver(settings: Settings, context: JavaContext) - extends PathResolverBase[ClassPath[AbstractFile], JavaClassPath](settings, context) { - - def this(settings: Settings) = this(settings, DefaultJavaContext) - - override protected def computeResult(): JavaClassPath = - new JavaClassPath(containers.toIndexedSeq, context) -} - class FlatClassPathResolver(settings: Settings, flatClassPathFactory: ClassPathFactory[FlatClassPath]) extends PathResolverBase[FlatClassPath, AggregateFlatClassPath](settings, flatClassPathFactory) { @@ -319,10 +300,5 @@ class FlatClassPathResolver(settings: Settings, flatClassPathFactory: ClassPathF } object PathResolverFactory { - - def create(settings: Settings): PathResolverResult = - settings.YclasspathImpl.value match { - case ClassPathRepresentationType.Flat => new FlatClassPathResolver(settings) - case ClassPathRepresentationType.Recursive => new PathResolver(settings) - } + def create(settings: Settings): PathResolverResult = new FlatClassPathResolver(settings) } |