How to use sbt plugin published in Scala 2 ?
exoego opened this issue · 1 comments
This section described how to use normal dependencies published for Scala 2.
I think it would be great if the section also mention regarding sbt plugin, for people like me who lack of in-depth understadning sbt.
When I updated my project/plugins.sbt
like below:
def dottySupport(moduleId: ModuleID): ModuleID = moduleId.withDottyCompat(scalaVersion.value)
addSbtPlugin(dottySupport("org.scala-js" % "sbt-scalajs" % "0.6.31"))
addSbtPlugin(dottySupport("org.scalameta" % "sbt-scalafmt" % "2.3.0"))
error: value withDottyCompat is not a member of sbt.ModuleID
occured.
sbt plugins are only published for Scala 2, because sbt itself is only compiled with Scala 2, so there is nothing special to do to use them (in other words, just remove the dottySupport method you added). In more details: the .sbt files inside project
are not part of your build but part of the meta-build, which uses its own scala version (the one that sbt currently uses) and is not affected by the scala version set in your build.