Skip to content

Commit

Permalink
Merge pull request #1596 from bjaglin/move-pprint
Browse files Browse the repository at this point in the history
pprint is only required on -cli for 0.9.x compat
  • Loading branch information
bjaglin authored Apr 12, 2022
2 parents c5633c6 + 404d805 commit 71e6ca2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 27 deletions.
23 changes: 13 additions & 10 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,9 @@ lazy val core = projectMatrix
googleDiff,
collectionCompat
),
libraryDependencies ++= {
if (isScala211.value) Seq(metaconfigFor211)
else
Seq(
metaconfig,
// metaconfig 0.10.0 shaded pprint but rules built with an old
// scalafix-core must have the original package in the classpath to link
// https://github.com/scalameta/metaconfig/pull/154/files#r794005161
pprint % Runtime
)
libraryDependencies += {
if (isScala211.value) metaconfigFor211
else metaconfig
}
)
.defaultAxes(VirtualAxis.jvm)
Expand Down Expand Up @@ -128,6 +121,16 @@ lazy val cli = projectMatrix
jgit,
commonText
),
libraryDependencies ++= {
if (isScala211.value) Seq()
else
Seq(
// metaconfig 0.10.0 shaded pprint but rules built with an old
// scalafix-core must have the original package in the classpath to link
// https://github.com/scalameta/metaconfig/pull/154/files#r794005161
pprint % Runtime
)
},
publishLocalTransitive := Def.taskDyn {
val ref = thisProjectRef.value
publishLocal.all(ScopeFilter(inDependencies(ref)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,10 @@ public static List<URL> scalafixCliJars(
String scalafixVersion,
String scalaVersion
) throws ScalafixException {
List<Dependency> dependencies = new ArrayList<Dependency>();
dependencies.add(
Dependency.parse(
"ch.epfl.scala:::scalafix-cli:" + scalafixVersion,
ScalaVersion.of(scalaVersion)
).withConfiguration("runtime")
);
// Coursier does not seem to fetch runtime dependencies transitively, despite what Maven dictates
// https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#dependency-scope
// so to be able to retrieve the runtime dependencies of scalafix-core, we need an explicit reference
dependencies.add(
Dependency.parse(
"ch.epfl.scala::scalafix-core:" + scalafixVersion,
ScalaVersion.of(scalaVersion)
).withConfiguration("runtime")
);
return toURLs(fetch(repositories, dependencies, ResolutionParams.create()));
Dependency scalafixCli = Dependency
.parse("ch.epfl.scala:::scalafix-cli:" + scalafixVersion, ScalaVersion.of(scalaVersion))
.withConfiguration("runtime");
return toURLs(fetch(repositories, Collections.singletonList(scalafixCli), ResolutionParams.create()));
}

public static FetchResult toolClasspath(
Expand Down

0 comments on commit 71e6ca2

Please sign in to comment.