SBT per Version Global Plugins
Join the DZone community and get the full member experience.
Join For FreeI'm an IntelliJ user, so I have the SBT idea plugin permanently in my global SBT plugins. This is fine, until I start working across versions of SBT, and particularly with milestone builds of unreleased SBT versions, because in that case, the version of the idea plugin that I usually use with other versions of SBT may not be available. Hence I need to have per SBT version global plugins. I think this might be easier to do in future, but for now, here's a way to do it:
libraryDependencies <++= (sbtBinaryVersion in update, scalaBinaryVersion in update) { (sbtV, scalaV) => sbtV match { case sbt013 if sbt013.startsWith("0.13.") => Seq( Defaults.sbtPluginExtra("com.github.mpeltonen" % "sbt-idea" % "1.5.0-SNAPSHOT", sbtV, scalaV) ) case _ => Seq( Defaults.sbtPluginExtra("com.github.mpeltonen" % "sbt-idea" % "1.4.0", sbtV, scalaV) ) } }
Published at DZone with permission of James Roper, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Trending
-
The SPACE Framework for Developer Productivity
-
Mastering Go-Templates in Ansible With Jinja2
-
Using Render Log Streams to Log to Papertrail
-
AI and Cybersecurity Protecting Against Emerging Threats
Comments