@@ -51,43 +51,43 @@ object DottyPlugin extends AutoPlugin {
51
51
nightly
52
52
}
53
53
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
+ }
83
83
}
84
84
85
85
import autoImport ._
86
86
87
87
override def requires : Plugins = plugins.JvmPlugin
88
88
override def trigger = allRequirements
89
89
90
- // Adapted from CrossVersioconstant nUtil #sbtApiVersion
90
+ // Adapted from CrossVersionUtil #sbtApiVersion
91
91
private def sbtFullVersion (v : String ): Option [(Int , Int , Int )] =
92
92
{
93
93
val ReleaseV = """ (\d+)\.(\d+)\.(\d+)(-\d+)?""" .r
0 commit comments