Skip to content

Commit

Permalink
reflect what is actually provided as argument
Browse files Browse the repository at this point in the history
  • Loading branch information
bjaglin committed Sep 29, 2024
1 parent 8f27d86 commit 2cf21ce
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/main/scala/scalafix/internal/sbt/ScalafixInterface.scala
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ object ScalafixInterface {

type Cache = BlockingCache[
(
String, // scalafixScalaBinaryVersion
String, // scalafixScalaMajorMinorVersion
Option[Arg.ToolClasspath]
),
(
Expand All @@ -139,7 +139,7 @@ object ScalafixInterface {

def apply(
cache: Cache,
scalafixScalaBinaryVersion: String,
scalafixScalaMajorMinorVersion: String,
toolClasspath: Arg.ToolClasspath,
logger: Logger,
callback: ScalafixMainCallback
Expand All @@ -150,7 +150,7 @@ object ScalafixInterface {
// shared as much as possible.
val (buildinRulesInterface, _) = cache.compute(
(
scalafixScalaBinaryVersion,
scalafixScalaMajorMinorVersion,
None
),
{
Expand All @@ -159,14 +159,14 @@ object ScalafixInterface {
None
case None =>
// cache miss, resolve scalafix artifacts and classload them
if (scalafixScalaBinaryVersion == "2.11")
if (scalafixScalaMajorMinorVersion == "2.11")
logger.error(
"Scala 2.11 is no longer supported. Please downgrade to the final version supporting " +
"it: sbt-scalafix 0.10.4."
)
val scalafixArguments = ScalafixAPI
.fetchAndClassloadInstance(
scalafixScalaBinaryVersion,
scalafixScalaMajorMinorVersion,
toolClasspath.repositories.asJava
)
.newArguments()
Expand Down Expand Up @@ -197,7 +197,7 @@ object ScalafixInterface {

val (toolClasspathInterface, _) = cache.compute(
(
scalafixScalaBinaryVersion,
scalafixScalaMajorMinorVersion,
Some(toolClasspath)
),
{
Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/scalafix/sbt/ScalafixPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ object ScalafixPlugin extends AutoPlugin {
shell: ShellArgs,
projectDepsExternal: Seq[ModuleID],
projectDepsInternal: Seq[File],
projectScalafixScalaBinaryVersion: String,
projectScalaMajorMinorVersion: String,
projectScalafixDependencies: Seq[ModuleID],
buildAllResolvers: Seq[Repository],
buildScalafixMainCallback: ScalafixMainCallback,
Expand Down Expand Up @@ -364,7 +364,7 @@ object ScalafixPlugin extends AutoPlugin {

val interface = ScalafixInterface(
cache = buildScalafixInterfaceCache,
scalafixScalaMajorMinorVersion = projectScalafixScalaBinaryVersion,
scalafixScalaMajorMinorVersion = projectScalaMajorMinorVersion,
toolClasspath = toolClasspath,
logger = ScalafixInterface.defaultLogger,
callback = buildScalafixMainCallback
Expand Down

0 comments on commit 2cf21ce

Please # to comment.