Skip to content

Commit 1a71863

Browse files
committed
Add scala-xml dep for dotty too
This wasn't needed so far because dotty-compiler depends on scala-xml but that will change soon.
1 parent ed4d89d commit 1a71863

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

project/scalatest.scala

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ import com.typesafe.tools.mima.plugin.MimaKeys.{mimaPreviousArtifacts, mimaCurre
2525
import com.typesafe.tools.mima.core._
2626
import com.typesafe.tools.mima.core.ProblemFilters._
2727

28+
import dotty.tools.sbtplugin.DottyPlugin.autoImport._
29+
2830
object ScalatestBuild {
2931

3032
// To run gentests
@@ -174,8 +176,10 @@ object ScalatestBuild {
174176

175177
def scalaXmlDependency(theScalaVersion: String): Seq[ModuleID] =
176178
CrossVersion.partialVersion(theScalaVersion) match {
177-
case Some((2, scalaMajor)) if scalaMajor >= 11 => Seq("org.scala-lang.modules" %% "scala-xml" % "1.2.0")
178-
case other => Seq.empty
179+
case Some((scalaEpoch, scalaMajor)) if scalaEpoch != 2 || scalaMajor >= 11 =>
180+
Seq(("org.scala-lang.modules" %% "scala-xml" % "1.2.0").withDottyCompat(theScalaVersion))
181+
case other =>
182+
Seq.empty
179183
}
180184

181185

@@ -946,6 +950,7 @@ object ScalatestBuild {
946950
initialCommands in console := """|import org.scalatest._
947951
|import org.scalactic._
948952
|import Matchers._""".stripMargin,
953+
libraryDependencies ++= scalaXmlDependency(scalaVersion.value),
949954
libraryDependencies ++= scalatestLibraryDependencies,
950955
sourceGenerators in Compile += {
951956
Def.task {
@@ -2133,7 +2138,6 @@ object ScalatestBuild {
21332138
(resourceManaged in Compile).value,
21342139
name.value)
21352140

2136-
import dotty.tools.sbtplugin.DottyPlugin.autoImport._
21372141
// List of available night build at https://repo1.maven.org/maven2/ch/epfl/lamp/dotty-compiler_0.14/
21382142
lazy val dottyVersion = dottyLatestNightlyBuild.get
21392143
// lazy val dottyVersion = "0.15.0-bin-20190522-ffb250d-NIGHTLY"

0 commit comments

Comments
 (0)