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