Adjust to Zinc change

This commit is contained in:
Eugene Yokota 2020-08-10 23:41:55 -04:00
parent d3ffd33e17
commit ff711f4719
1 changed files with 9 additions and 8 deletions

View File

@ -9,7 +9,7 @@ package sbt
import java.io.File
import java.nio.channels.ClosedChannelException
import sbt.internal.inc.{ AnalyzingCompiler, PlainVirtualFile }
import sbt.internal.inc.{ AnalyzingCompiler, MappedFileConverter, PlainVirtualFile }
import sbt.internal.util.{ DeprecatedJLine, Terminal }
import sbt.util.Logger
import xsbti.compile.{ Compilers, Inputs }
@ -56,13 +56,14 @@ final class Console(compiler: AnalyzingCompiler) {
terminal: Terminal
)(loader: Option[ClassLoader], bindings: Seq[(String, Any)])(implicit log: Logger): Try[Unit] = {
def console0(): Unit =
try compiler.console(classpath map { x =>
PlainVirtualFile(x.toPath)
}, options, initialCommands, cleanupCommands, log)(
loader,
bindings
)
catch { case _: InterruptedException | _: ClosedChannelException => }
try {
compiler.console(classpath map { x =>
PlainVirtualFile(x.toPath)
}, MappedFileConverter.empty, options, initialCommands, cleanupCommands, log)(
loader,
bindings
)
} catch { case _: InterruptedException | _: ClosedChannelException => }
val previous = sys.props.get("scala.color").getOrElse("auto")
try {
sys.props("scala.color") = if (terminal.isColorEnabled) "true" else "false"