mdedetrich
mdedetrich

Reputation: 1889

SBT: Simplest way to separate plugins.sbt

This is a very simple question, but I surprisingly havn't gotten an answer for it yet.

Simply put, in most non trivial SBT projects you will have a plugins.sbt file that contains plugins that are required to run your project (like a web container plugin if your SBT project is a website). However in the same file (plugins.sbt), plugins which have nothing to do with actually running your project (such as ensime/intellij/eclipse project generators) are also typically placed in plugins.sbt

I have seen this behavior for many SBT projects which are placed into github

This ideally speaking is not the correct way to do things, ideally plugins which have nothing to do with actually running/compiling your project should be in a separate file which is put into a .gitignore

What is the idiomatic SBT way of dealing with this (I assume it should be something that consists of having 2 separate plugins.sbt files, one with actual project plugins and the other with IDE generators and whatnot)

Upvotes: 0

Views: 92

Answers (1)

dscleaver
dscleaver

Reputation: 36

You can install plugins globally by placing them in ~/.sbt/0.13/plugins/. .sbt or .scala files located here are loaded for every project that you have.

You can also use addSbtPlugin() in a .sbt file to add other plugins.

Check out http://www.scala-sbt.org/release/docs/Getting-Started/Using-Plugins.html

Upvotes: 2

Related Questions