Skip to content

Commit 692c430

Browse files
committed
Support Scala 2.13.0-M5
1 parent 7ab2b7d commit 692c430

File tree

5 files changed

+21
-7
lines changed

5 files changed

+21
-7
lines changed

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ organization := "software.purpledragon.xml"
55
version := "0.0.3-SNAPSHOT"
66

77
scalaVersion := "2.12.7"
8-
crossScalaVersions := Seq(scalaVersion.value, "2.11.12")
8+
crossScalaVersions := Seq(scalaVersion.value, "2.11.12", "2.13.0-M5")
99

1010
// dependencies common for all sub-projects
1111
libraryDependencies ++= Seq(

project/SettingsPlugin.scala

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,15 @@ object SettingsPlugin extends AutoPlugin {
88
override def trigger: PluginTrigger = AllRequirements
99
override def requires: Plugins = JvmPlugin
1010

11-
val javaVersion = "1.8"
11+
private val javaVersion = "1.8"
12+
private val scalatestStable = "3.0.5"
13+
private val scalatestSnapshot = "3.0.6-SNAP4"
14+
15+
object autoImport {
16+
val scalatestVersion = settingKey[String]("Version of scalatest to use")
17+
}
18+
19+
import autoImport._
1220

1321
override def projectSettings: Seq[Setting[_]] = Seq(
1422
organization := (organization in LocalRootProject).value,
@@ -33,6 +41,12 @@ object SettingsPlugin extends AutoPlugin {
3341
organizationName := "Purple Dragon Software",
3442
organizationHomepage := Some(url("https://purpledragon.software")),
3543
homepage := Some(url("https://stringbean.github.io/scala-xml-compare")),
36-
scmInfo := Some(ScmInfo(url("https://github.com/stringbean/scala-xml-compare"), "https://github.com/stringbean/scala-xml-compare.git"))
44+
scmInfo := Some(ScmInfo(url("https://github.com/stringbean/scala-xml-compare"), "https://github.com/stringbean/scala-xml-compare.git")),
45+
scalatestVersion := {
46+
scalaVersion.value match {
47+
case "2.13.0-M5" => scalatestSnapshot
48+
case _ => scalatestStable
49+
}
50+
}
3751
)
3852
}

xml-compare/build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name := "xml-compare"
22

33
libraryDependencies ++= Seq(
4-
"org.scalatest" %% "scalatest" % "3.0.5" % "test"
4+
"org.scalatest" %% "scalatest" % scalatestVersion.value % Test
55
)

xml-compare/src/main/scala/software/purpledragon/xml/compare/XmlCompare.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ object XmlCompare {
5757
if (leftChildren.size != rightChildren.size) {
5858
XmlDiffers("child count", leftChildren.size, rightChildren.size)
5959
} else {
60-
val meh: Seq[(Node, Node)] = leftChildren.zip(rightChildren)
60+
val matchedChildren = leftChildren.zip(rightChildren)
6161

62-
meh.foldLeft[XmlDiff](XmlEqual) { case (status, (leftChild, rightChild)) =>
62+
matchedChildren.foldLeft[XmlDiff](XmlEqual) { case (status, (leftChild, rightChild)) =>
6363
if (!status.isEqual) {
6464
// already failed
6565
status

xml-scalatest/build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name := "xml-scalatest"
22

33
libraryDependencies ++= Seq(
4-
"org.scalatest" %% "scalatest" % "3.0.5" % "provided"
4+
"org.scalatest" %% "scalatest" % scalatestVersion.value % Provided
55
)

0 commit comments

Comments
 (0)