Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pprint is only required on -cli for 0.9.x compat #1596

Merged
merged 1 commit into from
Apr 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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()));
Comment on lines +52 to +55
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice that this code is simplified

}

public static FetchResult toolClasspath(
Expand Down