@@ -51,43 +51,43 @@ object DottyPlugin extends AutoPlugin {
5151 nightly
5252 }
5353
54- implicit class DottyCompatModuleID (moduleID : ModuleID ) {
55- /** If this ModuleID cross-version is a Dotty version, replace it
56- * by the Scala 2.x version that the Dotty version is retro-compatible with,
57- * otherwise do nothing.
58- *
59- * This setting is useful when your build contains dependencies that have only
60- * been published with Scala 2.x, if you have:
61- * {{{
62- * libraryDependencies += "a" %% "b" % "c"
63- * }}}
64- * you can replace it by:
65- * {{{
66- * libraryDependencies += ("a" %% "b" % "c").withDottyCompat(scalaVersion.value)
67- * }}}
68- * This will have no effect when compiling with Scala 2.x, but when compiling
69- * with Dotty this will change the cross-version to a Scala 2.x one. This
70- * works because Dotty is currently retro-compatible with Scala 2.x.
71- *
72- * NOTE: Dotty's retro-compatibility with Scala 2.x will be dropped before
73- * Dotty is released, you should not rely on it.
74- */
75- def withDottyCompat (scalaVersion : String ): ModuleID =
76- moduleID.crossVersion match {
77- case _ : librarymanagement.Binary if scalaVersion.startsWith(" 0." ) =>
78- moduleID.cross(CrossVersion .constant(" 2.12" ))
79- case _ =>
80- moduleID
81- }
82- }
54+ implicit class DottyCompatModuleID (moduleID : ModuleID ) {
55+ /** If this ModuleID cross-version is a Dotty version, replace it
56+ * by the Scala 2.x version that the Dotty version is retro-compatible with,
57+ * otherwise do nothing.
58+ *
59+ * This setting is useful when your build contains dependencies that have only
60+ * been published with Scala 2.x, if you have:
61+ * {{{
62+ * libraryDependencies += "a" %% "b" % "c"
63+ * }}}
64+ * you can replace it by:
65+ * {{{
66+ * libraryDependencies += ("a" %% "b" % "c").withDottyCompat(scalaVersion.value)
67+ * }}}
68+ * This will have no effect when compiling with Scala 2.x, but when compiling
69+ * with Dotty this will change the cross-version to a Scala 2.x one. This
70+ * works because Dotty is currently retro-compatible with Scala 2.x.
71+ *
72+ * NOTE: Dotty's retro-compatibility with Scala 2.x will be dropped before
73+ * Dotty is released, you should not rely on it.
74+ */
75+ def withDottyCompat (scalaVersion : String ): ModuleID =
76+ moduleID.crossVersion match {
77+ case _ : librarymanagement.Binary if scalaVersion.startsWith(" 0." ) =>
78+ moduleID.cross(CrossVersion .constant(" 2.12" ))
79+ case _ =>
80+ moduleID
81+ }
82+ }
8383 }
8484
8585 import autoImport ._
8686
8787 override def requires : Plugins = plugins.JvmPlugin
8888 override def trigger = allRequirements
8989
90- // Adapted from CrossVersioconstant nUtil #sbtApiVersion
90+ // Adapted from CrossVersionUtil #sbtApiVersion
9191 private def sbtFullVersion (v : String ): Option [(Int , Int , Int )] =
9292 {
9393 val ReleaseV = """ (\d+)\.(\d+)\.(\d+)(-\d+)?""" .r
0 commit comments