Initial draft

eugene yokota 2014-03-23 12:04:08 -07:00
parent c1130d0a41
commit 15d6057dcb
1 changed files with 45 additions and 0 deletions

@ -0,0 +1,45 @@
This document outlines the desired use cases of BuildLevel feature.
## User Story: Changing the build level of test.sbt
User splits up her `*.sbt` into `compile.sbt`, `test.sbt`, and `publish.sbt`. Here's `test.sbt`:
```scala
buildLevel in ThisSet := test
libraryDependency += "org.specs2" %% "specs2" % "2.3.10" % "test"
```
When she launches sbt, `test.sbt` is read normally.
When she launches sbt with `sbt.buildLevel=-test`, any settings written in `tesst.sbt` are ignored.
## User Story: Setting the build level of plugins
User splits up her `project/plugins.sbt` into `compile.sbt`, `test.sbt` and `publish.sbt`. Here's `project/publish.sbt`:
```scala
buildLevel in ThisSet := publish
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.20.0")
```
Suppose sbt-assembly 0.20.0 is an auto plugin that loads settings into all Scala projects automatically.
When she launches sbt, sbt-assembly is loaded normally.
When she launches sbt with `sbt.buildLevel=-publish`, the plugin is no longer loaded.
## User Story: Optional global settings
User splits up her `~/.sbt/0.13/plugins/plugins.sbt` into `idea.sbt` etc. Here's `~/.sbt/0.13/plugins/idea.sbt`:
```scala
buildLevel in ThisSet := BuildLevel(name = "idea", optional = true)
addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.6.0")
```
When she launches sbt, sbt-idea is not loaded automatically.
When she launches sbt with `sbt.buildLevel=+idea`, the plugin is loaded.