Skip to content

Commit

Permalink
cli_3: resolve tool classpath with 2.13 artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
bjaglin committed Aug 18, 2024
1 parent b17725f commit b50724b
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,15 @@ final case class ScalafixArgumentsImpl(args: Args = Args.default)
.toSeq
.flatten

// Until community rules are built for Scala 3, use the Scala 2.13 version
val scalaVersionForDependencies =
if (Versions.scalaVersion.startsWith("3.")) Versions.scala213
else Versions.scalaVersion

val customDependenciesJARs = ScalafixCoursier.toolClasspath(
repositories,
keptDependencies.asJava,
Versions.scalaVersion
scalaVersionForDependencies
)

// External rules are built against `scalafix-core` to expose `scalafix.v1.Rule` implementations. The
Expand All @@ -106,7 +111,7 @@ final case class ScalafixArgumentsImpl(args: Args = Args.default)
// mismatch.
val scalafixCore = coursierapi.Module.parse(
"ch.epfl.scala::scalafix-core",
coursierapi.ScalaVersion.of(Versions.scalaVersion)
coursierapi.ScalaVersion.of(scalaVersionForDependencies)
)
customDependenciesJARs.getDependencies.asScala
.find(_.getModule == scalafixCore)
Expand Down

0 comments on commit b50724b

Please sign in to comment.