mirror of https://github.com/sbt/sbt.git
Patch for unidoc
This commit is contained in:
parent
571005efa0
commit
d0f540aea1
|
|
@ -18,7 +18,7 @@ import sbt.util.Logger
|
|||
import sbt.ConcurrentRestrictions.Tag
|
||||
import sbt.protocol.testing._
|
||||
import sbt.internal.util.Util.{ AnyOps, none }
|
||||
import sbt.internal.util.{ RunningProcesses, Terminal }
|
||||
import sbt.internal.util.{ RunningProcesses, Terminal => UTerminal }
|
||||
|
||||
private[sbt] object ForkTests {
|
||||
def apply(
|
||||
|
|
@ -97,7 +97,7 @@ private[sbt] object ForkTests {
|
|||
val is = new ObjectInputStream(socket.getInputStream)
|
||||
|
||||
try {
|
||||
val config = new ForkConfiguration(Terminal.isAnsiSupported, parallel)
|
||||
val config = new ForkConfiguration(UTerminal.isAnsiSupported, parallel)
|
||||
os.writeObject(config)
|
||||
|
||||
val taskdefs = opts.tests.map { t =>
|
||||
|
|
|
|||
|
|
@ -10,13 +10,13 @@ package sbt
|
|||
import java.util.regex.Pattern
|
||||
import scala.Console.{ BOLD, RESET }
|
||||
|
||||
import sbt.internal.util.Terminal
|
||||
import sbt.internal.util.{ Terminal => UTerminal }
|
||||
|
||||
object Highlight {
|
||||
|
||||
def showMatches(pattern: Pattern)(line: String): Option[String] = {
|
||||
val matcher = pattern.matcher(line)
|
||||
if (Terminal.isColorEnabled) {
|
||||
if (UTerminal.isColorEnabled) {
|
||||
// ANSI codes like \033[39m (normal text color) don't work on Windows
|
||||
val highlighted = matcher.replaceAll(scala.Console.RED + "$0" + RESET)
|
||||
if (highlighted == line) None else Some(highlighted)
|
||||
|
|
@ -26,5 +26,5 @@ object Highlight {
|
|||
None
|
||||
}
|
||||
def bold(s: String) =
|
||||
if (Terminal.isColorEnabled) BOLD + s.replace(RESET, RESET + BOLD) + RESET else s
|
||||
if (UTerminal.isColorEnabled) BOLD + s.replace(RESET, RESET + BOLD) + RESET else s
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue