diff --git a/.travis.yml b/.travis.yml index 060b447c..92e0f94a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,4 +13,6 @@ env: script: admin/build.sh -jdk: oraclejdk8 +jdk: + - oraclejdk8 + - openjdk11 diff --git a/build.sbt b/build.sbt index 25860796..ed9f2e87 100644 --- a/build.sbt +++ b/build.sbt @@ -6,7 +6,7 @@ scalaVersionsByJvm in ThisBuild := { val v213 = "2.13.0-M3" Map( 8 -> List(v213 -> true), - 9 -> List(v213 -> false)) + 11 -> List(v213 -> false)) } scalacOptions in ThisBuild ++= Seq("-deprecation", "-feature", "-Xfatal-warnings") @@ -53,7 +53,9 @@ lazy val core = project.in(file("core")).settings(scalaModuleSettings).settings( ) lazy val junit = project.in(file("junit")).settings( - libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % "test", + libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % Test, + // for javax.xml.bind.DatatypeConverter, used in SerializationStabilityTest + libraryDependencies += "javax.xml.bind" % "jaxb-api" % "2.3.0" % Test, testOptions += Tests.Argument(TestFrameworks.JUnit, "-a", "-v"), fork in Test := true, disablePublishing diff --git a/junit/src/test/scala/scala/SerializationStabilityTest.scala b/junit/src/test/scala/scala/SerializationStabilityTest.scala index edf3be86..9551ff44 100644 --- a/junit/src/test/scala/scala/SerializationStabilityTest.scala +++ b/junit/src/test/scala/scala/SerializationStabilityTest.scala @@ -30,7 +30,8 @@ object SerializationStability extends App { def patch(file: File, line: Int, prevResult: String, result: String): Unit = { amend(file) { content => - content.lines.toList.zipWithIndex.map { + // Predef.augmentString = work around scala/bug#11125 on JDK 11 + augmentString(content).lines.toList.zipWithIndex.map { case (content, i) if i == line - 1 => val newContent = content.replaceAllLiterally(quote(prevResult), quote(result)) if (newContent != content) @@ -50,7 +51,8 @@ object SerializationStability extends App { val newComment = s" // Generated on $timestamp with Scala ${scala.util.Properties.versionString})" amend(file) { content => - content.lines.toList.map { + // Predef.augmentString = work around scala/bug#11125 on JDK 11 + augmentString(content).lines.toList.map { f => f.replaceAll("""^ +// Generated on.*""", newComment) }.mkString("\n") }