Merge pull request #4377 from eed3si9n/wip/openjdk11

Scala 2.12.7 and linesIterator
This commit is contained in:
eugene yokota 2018-09-28 02:56:37 -04:00 committed by GitHub
commit 1fc0cd0314
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 16 additions and 15 deletions

View File

@ -27,7 +27,7 @@ final class InputTask[T] private (val parser: State => Parser[Task[T]]) {
Parser.parse(in, parser(s)) match {
case Right(v) => Parser.success(v)
case Left(msg) =>
val indented = msg.lines.map(" " + _).mkString("\n")
val indented = msg.linesIterator.map(" " + _).mkString("\n")
Parser.failure(s"Invalid programmatic input:\n$indented")
}
)
@ -47,7 +47,7 @@ object InputTask {
Parser.parse(in, it.parser(s)) match {
case Right(t) => Def.value(t)
case Left(msg) =>
val indented = msg.lines.map(" " + _).mkString("\n")
val indented = msg.linesIterator.map(" " + _).mkString("\n")
sys.error(s"Invalid programmatic input:\n$indented")
}
)

View File

@ -99,7 +99,7 @@ private[sbt] object LibraryManagement {
val culprit = t.getClass.getSimpleName
log.warn(s"Update task caching failed due to $culprit.")
log.warn("Report the following output to sbt:")
resolvedAgain.toString.lines.foreach(log.warn(_))
resolvedAgain.toString.linesIterator.foreach(log.warn(_))
log.trace(t)
resolvedAgain
}

View File

@ -36,7 +36,7 @@ private[sbt] object SbtRefactorings {
val sortedRecordedCommands = recordedCommands.sortBy(_._1)(reverseOrderingInt)
val newContent = replaceFromBottomToTop(lines.mkString(END_OF_LINE), sortedRecordedCommands)
(file, newContent.lines.toList)
(file, newContent.linesIterator.toList)
}
private def replaceFromBottomToTop(

View File

@ -38,7 +38,7 @@ class EmbeddedXmlSpec extends CheckIfParsedSpec {
split(buildSbt) must throwA[MessageOnlyException].like {
case exception =>
val index = buildSbt.lines.indexWhere(line => line.contains(errorLine)) + 1
val index = buildSbt.linesIterator.indexWhere(line => line.contains(errorLine)) + 1
val numberRegex = """(\d+)""".r
val message = exception.getMessage
val list = numberRegex.findAllIn(message).toList

View File

@ -10,9 +10,7 @@ package internal
package parser
import java.io.File
import sbt.internal.util.MessageOnlyException
import scala.io.Source
class ErrorSpec extends AbstractSpec {
@ -26,12 +24,13 @@ class ErrorSpec extends AbstractSpec {
foreach(new File(rootPath).listFiles) { file =>
print(s"Processing ${file.getName}: ")
val buildSbt = Source.fromFile(file).getLines().mkString("\n")
SbtParser(file, buildSbt.lines.toSeq) must throwA[MessageOnlyException].like {
case exp =>
val message = exp.getMessage
println(s"${exp.getMessage}")
message must contain(file.getName)
}
SbtParser(file, buildSbt.linesIterator.toSeq) must throwA[MessageOnlyException]
.like {
case exp =>
val message = exp.getMessage
println(s"${exp.getMessage}")
message must contain(file.getName)
}
containsLineNumber(buildSbt)
}
}
@ -60,7 +59,9 @@ class ErrorSpec extends AbstractSpec {
|val a = <a/><b/>
|val s = '
""".stripMargin
SbtParser(SbtParser.FAKE_FILE, buildSbt.lines.toSeq) must throwA[MessageOnlyException].like {
SbtParser(SbtParser.FAKE_FILE, buildSbt.linesIterator.toSeq) must throwA[
MessageOnlyException
].like {
case exp =>
val message = exp.getMessage
println(s"${exp.getMessage}")

View File

@ -4,7 +4,7 @@ import sbt.contraband.ContrabandPlugin.autoImport._
object Dependencies {
// WARNING: Please Scala update versions in PluginCross.scala too
val scala212 = "2.12.6"
val scala212 = "2.12.7"
val baseScalaVersion = scala212
// sbt modules