3

I've been having a look on how to get existing projects to use the Dotty compiler.

This has been straightforward for small projects following this.

https://github.com/lampepfl/dotty-example-project

This sets the scala version to 0.2.x. Which would mean that SBT could not find all the dependant libraries. However this can be sorted out by using withDottyCompat. This tells sbt to just go and get a 2.11 version. eg

eg ("org.scalatestplus.play" %% "scalatestplus-play" % "2.0.0").withDottyCompat()

All good so far. Where I'm stuck is to tell sbt to get play 2.11 versions of all the dependancies of a sbt plugin. Particularly Play! Eg

"com.typesafe.play" %% "twirl-api" % "1.1.1"

I can't work out how to intercept this and ask sbt to download the 2.11 version of the play dependencies.

Anyone managed this?

Oliver Shaw
  • 5,235
  • 4
  • 26
  • 35
  • 1
    I'm not sure what you mean by "dependencies of an sbt-plugin", could you create a simple project on github that reproduces the problem? If the issue is that the sbt plugin is automatically adding dependencies to your project, you can change those by doing: `libraryDependencies := libraryDependencies.value.map(_.withDottyCompat())` – Guillaume Martres Aug 29 '17 at 23:38
  • Thank you @GuillaumeMartres! I had to use "_.withDottyCompat(scalaVersion.value)" but it compiled and ran. I'll see how far I get – sea-rob Feb 15 '21 at 16:56

0 Answers0