@@ -63,18 +63,6 @@ lazy val interfaces = project
6363 )
6464 .disablePlugins(ScalafixPlugin )
6565
66- // Scala 3 macros vendored separately (i.e. without runtime classes), to
67- // shadow Scala 2.13 macros in the Scala 3 compiler classpath, while producing
68- // code valid against Scala 2.13 bytecode
69- // TODO: after replacing with metaconfig_3, remove -Wconf filter in ScalafixBuild
70- lazy val `compat-metaconfig-macros` = projectMatrix
71- .settings(
72- libraryDependencies += metaconfig cross CrossVersion .for3Use2_13
73- )
74- .defaultAxes(VirtualAxis .jvm)
75- .jvmPlatform(cliScalaVersions)
76- .disablePlugins(ScalafixPlugin )
77-
7866lazy val core = projectMatrix
7967 .in(file(" scalafix-core" ))
8068 .settings(
@@ -83,33 +71,13 @@ lazy val core = projectMatrix
8371 libraryDependencies ++= Seq (
8472 googleDiff,
8573 metaconfig,
86- scalametaFor3Use2_13 ,
87- semanticdbSharedFor3Use2_13 ,
74+ scalameta ,
75+ semanticdbShared ,
8876 collectionCompat
8977 )
9078 )
9179 .defaultAxes(VirtualAxis .jvm)
92- .jvmPlatform(coreScalaVersions)
93- .enablePlugins(BuildInfoPlugin )
94-
95- // keep compiling core3 without exposing it to matrix projects, just
96- // to make https://github.com/scalacenter/scalafix/issues/2041 easier
97- lazy val core3 = project
98- .in(file(" scalafix-core" ))
99- .settings(
100- noPublishAndNoMima,
101- buildInfoSettingsForCore,
102- scalaVersion := scala3LTS,
103- libraryDependencies ++= Seq (
104- googleDiff,
105- metaconfig
106- ) ++ Seq (
107- scalametaFor3Use2_13,
108- semanticdbSharedFor3Use2_13
109- ).map { mod =>
110- mod.exclude213((orgLiHaoYi, " sourcecode" ), collectionCompat)
111- }
112- )
80+ .jvmPlatform(CrossVersion .binary, cliScalaVersions)
11381 .enablePlugins(BuildInfoPlugin )
11482
11583lazy val rules = projectMatrix
@@ -119,24 +87,11 @@ lazy val rules = projectMatrix
11987 description := " Built-in Scalafix rules" ,
12088 isFullCrossVersion,
12189 buildInfoSettingsForRules,
122- libraryDependencies ++= {
123- if (! isScala3.value)
124- Seq (
125- orgScalaLang % " scala-compiler" % scalaVersion.value,
126- orgScalaLang % " scala-reflect" % scalaVersion.value,
127- semanticdbScalacCore,
128- collectionCompat
129- )
130- else
131- Seq (
132- orgScalaLang %% " scala3-presentation-compiler" % scalaVersion.value,
133- coursierInterfaces
134- )
135- }
90+ libraryDependencies += metaconfig,
91+ settingsForSemanticdbScalac
13692 )
13793 .defaultAxes(VirtualAxis .jvm)
13894 .jvmPlatform(CrossVersion .full, cliScalaVersions)
139- .dependsOn(`compat-metaconfig-macros` % " provided" )
14095 .dependsOn(core)
14196 .enablePlugins(BuildInfoPlugin )
14297
@@ -145,35 +100,13 @@ lazy val reflect = projectMatrix
145100 .settings(
146101 moduleName := " scalafix-reflect" ,
147102 isFullCrossVersion,
148- libraryDependencies ++= Seq (
149- coursierInterfaces,
150- semanticdbScalacCore,
151- orgScalaLang % " scala-compiler" % scalaVersion.value,
152- orgScalaLang % " scala-reflect" % scalaVersion.value
153- )
103+ libraryDependencies += coursierInterfaces,
104+ settingsForSemanticdbScalac
154105 )
155106 .defaultAxes(VirtualAxis .jvm)
156- .jvmPlatform(coreScalaVersions )
107+ .jvmPlatform(CrossVersion .binary, cliScalaVersions )
157108 .dependsOn(core)
158109
159- // keep compiling reflect3 without exposing it to matrix projects, just
160- // to make https://github.com/scalacenter/scalafix/issues/2041 easier
161- lazy val reflect3 = project
162- .in(file(" scalafix-reflect" ))
163- .settings(
164- isFullCrossVersion,
165- noPublishAndNoMima,
166- scalaVersion := scala3LTS,
167- libraryDependencies ++= Seq (
168- // CrossVersion.for3Use2_13 would only lookup a binary version artifact, but this is published with full version
169- semanticdbScalacCore
170- .cross(CrossVersion .constant(scala213))
171- .exclude213((orgLiHaoYi, " sourcecode" ), collectionCompat),
172- orgScalaLang %% " scala3-compiler" % scalaVersion.value
173- )
174- )
175- .dependsOn(core3)
176-
177110lazy val cli = projectMatrix
178111 .in(file(" scalafix-cli" ))
179112 .settings(
@@ -182,6 +115,7 @@ lazy val cli = projectMatrix
182115 libraryDependencies ++= Seq (
183116 nailgunServer,
184117 jgit,
118+ metaconfig,
185119 commonText
186120 ),
187121 libraryDependencies ++= {
@@ -191,19 +125,6 @@ lazy val cli = projectMatrix
191125 // disappeared from the classpath to link
192126 runtimeDepsForBackwardCompatibility.map(_ % Runtime )
193127 },
194- // companion of `.dependsOn(reflect)`
195- // issue reported in https://github.com/sbt/sbt/issues/7405
196- // using workaround from https://github.com/sbt/sbt/issues/5369#issue-549758513
197- // https://github.com/sbt/sbt-projectmatrix/pull/97 only fixed dependencies to binary versions
198- projectDependencies := {
199- if (isScala3.value)
200- projectDependencies.value.map { dep =>
201- val matches = dep.name == " scalafix-reflect"
202- if (matches) dep.cross(CrossVersion .constant(scala213))
203- else dep
204- }
205- else projectDependencies.value
206- },
207128 publishLocalTransitive := Def .taskDyn {
208129 val ref = thisProjectRef.value
209130 publishLocal.all(ScopeFilter (inDependencies(ref)))
@@ -212,7 +133,6 @@ lazy val cli = projectMatrix
212133 .defaultAxes(VirtualAxis .jvm)
213134 .jvmPlatform(CrossVersion .full, cliScalaVersions)
214135 .dependsOn(interfaces)
215- .dependsOn(`compat-metaconfig-macros` % " provided" )
216136 .dependsOn(reflect, rules)
217137
218138lazy val testkit = projectMatrix
@@ -298,16 +218,9 @@ lazy val unit = projectMatrix
298218 libraryDependencies ++= Seq (
299219 jgit,
300220 munit,
221+ scalametaTestkit,
301222 scalatest
302223 ),
303- libraryDependencies += {
304- if (! isScala3.value) {
305- scalametaTeskitFor3Use2_13
306- } else {
307- // exclude _2.13 artifacts that have their _3 counterpart in the classpath
308- scalametaTeskitFor3Use2_13.exclude213(munit)
309- }
310- },
311224 buildInfoPackage := " scalafix.tests" ,
312225 buildInfoKeys := Seq [BuildInfoKey ](
313226 " scalaVersion" -> scalaVersion.value
@@ -333,7 +246,7 @@ lazy val integration = projectMatrix
333246 Seq (
334247 orgScalaLang %% " scala3-compiler" % scalaVersion.value,
335248 // exclude _2.13 artifacts that have their _3 counterpart in the classpath
336- coursierFor3Use2_13.exclude213(scalaXml)
249+ coursierFor3Use2_13.exclude213(scalaXml, collectionCompat )
337250 )
338251 }
339252 },
@@ -465,7 +378,7 @@ lazy val docs = projectMatrix
465378 Dependencies .runtimeDepsForBackwardCompatibility
466379 .map(_.withRevision(VersionScheme .Always )),
467380 // force eviction of mdoc transitive dependency
468- dependencyOverrides += scalametaFor3Use2_13
381+ dependencyOverrides += scalameta
469382 )
470383 .defaultAxes(VirtualAxis .jvm)
471384 .jvmPlatform(scalaVersions = Seq (scala213))
0 commit comments