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

Add a way to cleanly override sbt plugin versions #7309

Open
henryxparker opened this issue Jun 20, 2023 · 0 comments
Open

Add a way to cleanly override sbt plugin versions #7309

henryxparker opened this issue Jun 20, 2023 · 0 comments

Comments

@henryxparker
Copy link

henryxparker commented Jun 20, 2023

Currently there is no simple command to override a plugin version.
If plugin A depends on plugin B, plugin B is imported automatically.
If the project already imported B but at an earlier version it will be evicted to the newer version.
Now lets say that A works fine with both versions of B, but the newer version of B breaks the build.
Currently, you must do something like this in the plugins.sbt

dependencyOverrides += {
  val sbtV = (pluginCrossBuild / sbtBinaryVersion).value
  val scalaV = (update / scalaBinaryVersion).value
  sbt.Defaults.sbtPluginExtra("com.twitter" % "scrooge-sbt-plugin" % "21.4.0" , sbtV, scalaV)
}

This is basically pulled directly from addSbtPlugin, with the only difference being that it goes into dependencyOverrides

  def addSbtPlugin(dependency: ModuleID): Setting[Seq[ModuleID]] =
    libraryDependencies += {
      val sbtV = (pluginCrossBuild / sbtBinaryVersion).value
      val scalaV = (update / scalaBinaryVersion).value
      sbtPluginExtra(dependency, sbtV, scalaV)
    }

So I figured it might be nice to add another set of methods akin to addSbtDependency
I figured overrideSbtPluginDependency or simply overrideSbtPlugin, but I'm open to suggestions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant