Skip to content

withDottyCompat: correctly handle dotty-{library,compiler} #10118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions sbt-dotty/src/dotty/tools/sbtplugin/DottyPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,17 @@ object DottyPlugin extends AutoPlugin {
* with Dotty this will change the cross-version to a Scala 2.x one. This
* works because Dotty is currently retro-compatible with Scala 2.x.
*
* NOTE: As a special-case, the cross-version of dotty-library, dotty-compiler and
* dotty will never be rewritten because we know that they're Dotty-only.
* NOTE: As a special-case, the cross-version of scala3-library and scala3-compiler
* will never be rewritten because we know that they're Scala 3 only.
* This makes it possible to do something like:
* {{{
* libraryDependencies ~= (_.map(_.withDottyCompat(scalaVersion.value)))
* }}}
*/
def withDottyCompat(scalaVersion: String): ModuleID = {
val name = moduleID.name
if (name != "scala3" && name != "scala3-library" && name != "scala3-compiler")
if (name != "scala3-library" && name != "scala3-compiler" &&
name != "dotty" && name != "dotty-library" && name != "dotty-compiler")
moduleID.crossVersion match {
case binary: librarymanagement.Binary =>
val compatVersion =
Expand Down