Few weeks ago when I was working on my pet project, I wanted to make it an SBT plugin. Since I had to spend some time studying SBT docs, I decided to write a short tutorial explaining how to write and deploy a SBT plugin.
Make sure your project can be built with SBT
First of all, your project needs to be buildable with SBT. This can be achieved simply – any project that follows the specific structure can be built with SBT. additionally, we are going to need a build.sbt file with the following contents at the top-level:
lazy val root = (project in file(".")).
name := "my-sbt-plugin",
version := "0.2.0",
organization := "com.github.miloszpp",
scalaVersion := "2.10.6",
sbtPlugin := true,
Note that we are using Scala version 2.10 despite that at the time of writing 2.11 is available. That’s because SBT 0.13 is build against Scala 2.10. You need to make sure that you are using matching versions, otherwise you might get compile errors.