This plugin basically just exists to allow me to more conveniently setup my baseline SBT configuration, which has evolved somewhat over the years, and is also becoming quite unwieldy when solely represented in giter8 format. If you want to use this plugin with a new project, you should probably start from that template.
If you generally agree with my opinions on how projects should be set up, though, then this is probably a really excellent plugin to base on! Between this plugin and my giter8 template, you can get a new Scala project up and running and publishing to Bintray or Sonatype within about five minutes. As an example, check out this quick screencast:
TLDR, it's really really easy.
Put one of the following into your
// for stock functionality (no publication defaults) addSbtPlugin("com.codecommit" % "sbt-spiewak" % "<version>") // publishing to bintray addSbtPlugin("com.codecommit" % "sbt-spiewak-bintray" % "<version>") // publishing to sonatype addSbtPlugin("com.codecommit" % "sbt-spiewak-sonatype" % "<version>")
Then, in your
build.sbt, make sure you set a value for
organization in ThisBuild := "com.codecommit" baseVersion in ThisBuild := "0.1" publishGithubUser in ThisBuild := "djspiewak" publishFullName in ThisBuild := "Daniel Spiewak"
Or something like that.
If you have a multi-module build and need a subproject to not publish (as is commonly done with the
root project), bring in
noPublishSettings. For example:
lazy val root = project .aggregate(core, bintray, sonatype) .in(file(".")) .settings(name := "root") .settings(noPublishSettings)
- Baseline plugin setup
- With sane git versioning settings
- Also with fixed
- Assumes Apache 2.0 license
- sbt-bintray (or sonatype!)
- With fixed support for Travis builds
- sbt-sonatype (or bintray!)
- With fixed snapshot publication URLs
- Infers previous versions by using git tags
- Automatically runs on
- Sane scalac settings
- SI-2712 fix across scala versions (dating back to 2.10)
- Ensures bintray package existence
- Performs sonatype release steps
- Stages through
bintrayReleaseto allow release atomicity
You will need to additionally define the following setting:
bintrayVcsUrl in Global := Some("email@example.com:you/your-repo.git")
Check sbt-bintray credentials on how to authenticate.
You will additionally need to define the following settings:
homepage in Global := Some(url("https://github.com/djspiewak/sbt-spiewak")), scmInfo in Global := Some(ScmInfo(url("https://github.com/djspiewak/sbt-spiewak"), "firstname.lastname@example.org:djspiewak/sbt-spiewak.git")))
Defaults Which You May Wish to Override...
You may consider overriding any of the following keys, which are hard-coded to defaults that I believe are sane:
licenses(defaults to Apache 2.0)
developers(defaults to just yourself, using the
startYear(defaults to 2018)
- When set to
true, it disallows breaking binary compatibility in any release which does not increment the major component unless the major component is
0(i.e. semantic versioning). Many Scala projects break binary compatibility in minor releases, such as Scala itself. This scheme is sometimes referred to as "scala ver". Setting
strictSemVer in ThisBuild := falsewill relax the MiMa compatibility checks and allow you to perform such breakage if desired.
- When set to