Simpler build settings
Scala
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
project
src
.gitignore
.travis.yml
LICENSE
README.md
build.sbt

README.md

sbt-auto-build

Build Status Download

Simpler build settings by using an auto-plugin to automatically add settings from sbt-utils.

Usage

In your project/plugins.sbt file:

resolvers += Resolver.url("hmrc-sbt-plugin-releases",
  url("https://dl.bintray.com/hmrc/sbt-plugin-releases"))(Resolver.ivyStylePatterns)

addSbtPlugin("uk.gov.hmrc" % "sbt-auto-build" % "x.x.x")

where 'x.x.x' is the latest release as advertised above.

We have added the resolver here, if you already have the 'https://dl.bintray.com/hmrc/sbt-plugin-releases' repo added there's no need to re-add it here.

Add the line .enablePlugins(SbtAutoBuildPlugin) to your project to enable the plugin.

What it does

When enabled sbt-auto-build automatically adds the most comonly used settings in sbt-utils which are the settings collections:

  • scalaSettings
  • SbtBuildInfo
  • defaultSettings
  • HeaderSettings

It also automatically adds sbt-utils and sbt-header plugins. SBT header is on by default and will generate licence headers in your source files. As a result you don't have to add licence headers to source files manually

To make the automatic addition of settings more visible you'll see output like this in your build:

[info] SbtAutoBuildPlugin adding 19 build settings:
[info] buildinfo, buildinfo, buildinfoBuildnumber, buildinfoKeys, buildinfoKeys, buildinfoObject, buildinfoPackage, buildinfoPackage, fork, headers, initialCommands, isSnapshot, organization, packageOptions, parallelExecution, scalaVersion, scalacOptions, sourceGenerators, testOptions

Updating from sbt-utils

See and example of this on the time project: HmrcBuild.scala and plugins.sbt

  1. Remove references to sbt-utils and sbt-header form your project/plugins.sbt file and add the code listed in 'Usage' above
  2. Remove references to scalaSettings, SbtBuildInfo, defaultSettings and HeaderSettings in your project/HmrcBuild.scala file