@@ -17,19 +17,36 @@ inThisBuild(
17
17
val rules = project
18
18
.disablePlugins(ScalafixPlugin )
19
19
.settings(
20
- libraryDependencies += " ch.epfl.scala" %% " scalafix-core" % Versions .scalafixVersion,
20
+ libraryDependencies +=
21
+ (" ch.epfl.scala" %% " scalafix-core" % Versions .scalafixVersion)
22
+ .cross(CrossVersion .for3Use2_13),
21
23
libraryDependencies += " joda-time" % " joda-time" % " 2.10.6"
22
24
)
23
25
24
26
val service = project
25
27
.dependsOn(rules % ScalafixConfig )
26
28
.settings(
27
29
// SyntacticRule
28
- libraryDependencies += " ch.epfl.scala" %% " example-scalafix-rule" % " 3.0.0" % ScalafixConfig
30
+ libraryDependencies +=
31
+ (" ch.epfl.scala" %% " example-scalafix-rule" % " 3.0.0" )
32
+ .cross(CrossVersion .for3Use2_13) % ScalafixConfig
29
33
)
30
34
31
35
// SameProjectSyntacticRule
32
36
val sameproject = project
33
37
.settings(
34
- libraryDependencies += " ch.epfl.scala" %% " scalafix-core" % Versions .scalafixVersion % ScalafixConfig
38
+ libraryDependencies +=
39
+ (" ch.epfl.scala" %% " scalafix-core" % Versions .scalafixVersion)
40
+ .cross(CrossVersion .for3Use2_13) % ScalafixConfig ,
41
+ // Since sbt 1.10.x (https://github.com/sbt/sbt/pull/7480), scala3-library is not automatically added
42
+ // to non-standard configurations, but is needed by the Scala 3 compiler, so it must be added explicitly
43
+ // if no dependency brings it implicitly, which is the case here because the only dependency is for3Use2_13.
44
+ libraryDependencies ++= {
45
+ if (scalaBinaryVersion.value == " 3" )
46
+ Seq (
47
+ " org.scala-lang" %% " scala3-library" % scalaVersion.value % ScalafixConfig
48
+ )
49
+ else
50
+ Nil
51
+ }
35
52
)
0 commit comments