lunatech-labs / lunatech-scala2-to-scala3-course

Lunatech course - "Moving forward from Scala 2 to Scala 3"
Apache License 2.0
204 stars 21 forks source link

Remove scalatest dependancy from crossDependencies #40

Closed robinraju closed 4 years ago

robinraju commented 4 years ago

sbt-dotty plugin is used to manage dependencies that are compatible with a specific dotty version.

It is useful when your build contains dependencies that have only been published with Scala 2.x, if you have:

libraryDependencies += "a" %% "b" % "c"

you can replace it by:

libraryDependencies += ("a" %% "b" % "c").withDottyCompat(scalaVersion.value)

when compiling with Dotty this will change the cross-version to a Scala 2.x one.

ScalatTest now have artifacts published for 0.24.x and it is safe to move it out of crossDependancies and sbt will resolve it automatically based on the specified scalaVersion.