How to Override Global Plugin Settings for for SBT 1.x
The way you configure global plugins for SBT 1.x is different to how it used to be for SBT 0.13.x. In a previous article on How to Browse Scala Sources of your Dependencies from Sublime I recommended creating global plugin to override the dependencySrcUnzipDir setting by creating a CustomCtagsSrcDir.scala file under ~/.sbt/0.13/plugins:
import sbt._
import Keys._
import net.ceedubs.sbtctags.CtagsKeys._
object CustomCtagsSrcDir extends Plugin {
override def settings = Seq(
:= baseDirectory.value / ".ctags_srcs"
dependencySrcUnzipDir )
}
This different to how it needs to be done in SBT 1.x.
To use sbt-ctags with SBT 1.x first clone the SBT 1x Compatibility PR that publishes sbt-ctags for SBT 1.x.
Next we need to publish this locally as the PR has not been merged as of this writing. This will install the sbt-ctags-0.2.1-SNAPSHOT:
sbt publishLocal
Add the sbt-ctags plugin to your ~/.sbt/1.0/plugins/plugins.sbt file to enable it globally:
addSbtPlugin("net.ceedubs" %% "sbt-ctags" % "0.2.1-SNAPSHOT")
Next override the location of your dependencySrcUnzipDir directory in ~/.sbt/1.0/global.sbt globally:
.dependencySrcUnzipDir := baseDirectory.value / ".ctags_srcs" SbtCtagsKeys
This is really neat. No more creating unnecessary classes to override settings.