Skip to content

Commit caf28eb

Browse files
committed
withDottyCompat: correctly handle dotty-{library,compiler}
Support for them got dropped when we did the renaming, but the latest sbt-dotty is supposed to still work with older dotty versions, so we should keep supporting this. Also removed the "scala3" special-case since we never published an artefact named "scala3".
1 parent 9a13214 commit caf28eb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

sbt-dotty/src/dotty/tools/sbtplugin/DottyPlugin.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,16 +90,17 @@ object DottyPlugin extends AutoPlugin {
9090
* with Dotty this will change the cross-version to a Scala 2.x one. This
9191
* works because Dotty is currently retro-compatible with Scala 2.x.
9292
*
93-
* NOTE: As a special-case, the cross-version of dotty-library, dotty-compiler and
94-
* dotty will never be rewritten because we know that they're Dotty-only.
93+
* NOTE: As a special-case, the cross-version of scala3-library and scala3-compiler
94+
* will never be rewritten because we know that they're Scala 3 only.
9595
* This makes it possible to do something like:
9696
* {{{
9797
* libraryDependencies ~= (_.map(_.withDottyCompat(scalaVersion.value)))
9898
* }}}
9999
*/
100100
def withDottyCompat(scalaVersion: String): ModuleID = {
101101
val name = moduleID.name
102-
if (name != "scala3" && name != "scala3-library" && name != "scala3-compiler")
102+
if (name != "scala3-library" && name != "scala3-compiler" &&
103+
name != "dotty" && name != "dotty-library" && name != "dotty-compiler")
103104
moduleID.crossVersion match {
104105
case binary: librarymanagement.Binary =>
105106
val compatVersion =

0 commit comments

Comments
 (0)