summaryrefslogtreecommitdiff
path: root/src/repl
diff options
context:
space:
mode:
authorGrzegorz Kossakowski <grzegorz.kossakowski@gmail.com>2014-12-05 14:19:00 +0100
committerGrzegorz Kossakowski <grzegorz.kossakowski@gmail.com>2014-12-05 14:19:00 +0100
commit124cf2f62f559caf37a5d5df7e15db7ba5958bcf (patch)
tree7cf981e5940bc70c8dfa2def557c631f8dc6c81e /src/repl
parent59832b0afedeaae8d0c1a48cf92d2b5f529ccd82 (diff)
parent35811876a3a089706951620e2434d171090ac0b0 (diff)
downloadscala-124cf2f62f559caf37a5d5df7e15db7ba5958bcf.tar.gz
scala-124cf2f62f559caf37a5d5df7e15db7ba5958bcf.tar.bz2
scala-124cf2f62f559caf37a5d5df7e15db7ba5958bcf.zip
Merge pull request #4176 from mpociecha/flat-classpath2
The alternative, flat representation of classpath elements
Diffstat (limited to 'src/repl')
-rw-r--r--src/repl/scala/tools/nsc/interpreter/ILoop.scala8
-rw-r--r--src/repl/scala/tools/nsc/interpreter/IMain.scala12
2 files changed, 11 insertions, 9 deletions
diff --git a/src/repl/scala/tools/nsc/interpreter/ILoop.scala b/src/repl/scala/tools/nsc/interpreter/ILoop.scala
index ee1dea4dc1..4fd5768b79 100644
--- a/src/repl/scala/tools/nsc/interpreter/ILoop.scala
+++ b/src/repl/scala/tools/nsc/interpreter/ILoop.scala
@@ -618,8 +618,8 @@ class ILoop(in0: Option[BufferedReader], protected val out: JPrintWriter)
if (f.exists) {
addedClasspath = ClassPath.join(addedClasspath, f.path)
intp.addUrlsToClassPath(f.toURI.toURL)
- echo("Added '%s' to classpath.".format(f.path, intp.global.classPath.asClasspathString))
- repldbg("Added '%s'. Your new classpath is:\n\"%s\"".format(f.path, intp.global.classPath.asClasspathString))
+ echo("Added '%s' to classpath.".format(f.path, intp.global.classPath.asClassPathString))
+ repldbg("Added '%s'. Your new classpath is:\n\"%s\"".format(f.path, intp.global.classPath.asClassPathString))
}
else echo("The path '" + f + "' doesn't seem to exist.")
}
@@ -663,8 +663,8 @@ class ILoop(in0: Option[BufferedReader], protected val out: JPrintWriter)
else {
addedClasspath = ClassPath.join(addedClasspath, f.path)
intp.addUrlsToClassPath(f.toURI.toURL)
- echo("Added '%s' to classpath.".format(f.path, intp.global.classPath.asClasspathString))
- repldbg("Added '%s'. Your new classpath is:\n\"%s\"".format(f.path, intp.global.classPath.asClasspathString))
+ echo("Added '%s' to classpath.".format(f.path, intp.global.classPath.asClassPathString))
+ repldbg("Added '%s'. Your new classpath is:\n\"%s\"".format(f.path, intp.global.classPath.asClassPathString))
}
}
diff --git a/src/repl/scala/tools/nsc/interpreter/IMain.scala b/src/repl/scala/tools/nsc/interpreter/IMain.scala
index b990e401ec..f9f7388363 100644
--- a/src/repl/scala/tools/nsc/interpreter/IMain.scala
+++ b/src/repl/scala/tools/nsc/interpreter/IMain.scala
@@ -15,7 +15,7 @@ import scala.concurrent.{ Future, ExecutionContext }
import scala.reflect.runtime.{ universe => ru }
import scala.reflect.{ ClassTag, classTag }
import scala.reflect.internal.util.{ BatchSourceFile, SourceFile }
-import scala.tools.util.PathResolver
+import scala.tools.util.PathResolverFactory
import scala.tools.nsc.io.AbstractFile
import scala.tools.nsc.typechecker.{ TypeStrings, StructuredTypeStrings }
import scala.tools.nsc.util.{ ScalaClassLoader, stringFromReader, stringFromWriter, StackTraceOps, ClassPath, MergedClassPath }
@@ -90,7 +90,7 @@ class IMain(@BeanProperty val factory: ScriptEngineFactory, initialSettings: Set
def compilerClasspath: Seq[java.net.URL] = (
if (isInitializeComplete) global.classPath.asURLs
- else new PathResolver(settings).result.asURLs // the compiler's classpath
+ else PathResolverFactory.create(settings).resultAsURLs // the compiler's classpath
)
def settings = initialSettings
// Run the code body with the given boolean settings flipped to true.
@@ -1282,9 +1282,11 @@ object IMain {
def getProgram(statements: String*): String = null
- def getScriptEngine: ScriptEngine = new IMain(this, new Settings() {
- usemanifestcp.value = true
- })
+ def getScriptEngine: ScriptEngine = {
+ val settings = new Settings()
+ settings.usemanifestcp.value = true
+ new IMain(this, settings)
+ }
}
// The two name forms this is catching are the two sides of this assignment: