mirror of https://github.com/sbt/sbt.git
Added simple setting DSL with simple task DSL
This commit is contained in:
parent
4883983afa
commit
400ca7ba30
14
README.md
14
README.md
|
|
@ -113,7 +113,7 @@ The template files are:
|
|||
|
||||
The Template build isn't quite finished. There will most likely be a build.sbt DSL variant that does not require a project scala file.
|
||||
|
||||
## Simple task DSL
|
||||
## Simple SBT DSL
|
||||
|
||||
SBT extras defines a simplified task DSL for those who are defining simple tasks that do not need to be relied upon, or you are unsure and can refactor later. Once including the sbt-extra-plugin, all you have to do is place the following in your build.sbt to create tasks:
|
||||
|
||||
|
|
@ -124,3 +124,15 @@ or if you need to depend on other keys:
|
|||
simple_task("zomg2") on (name, version) is { (n,v) => println("ZOMG " + n + " = " + v + " !!!!!") }
|
||||
|
||||
The DSL currently supports between 2 and 9 dependencies. The DSL does not allow defining tasks on different configurations, although this will be added shortly.
|
||||
|
||||
### Simple Setttings
|
||||
|
||||
SBT distinguishes between defining Setting and Tasks through the `apply` and `map` methods. The Simple DSL has no such distinction. Defining a setting is as easy as:
|
||||
|
||||
simple_setting("name") is "project-name"
|
||||
|
||||
Settings can also depend on other settings.
|
||||
|
||||
simple_setting("name") on (version) is { v => "project-name" + v }
|
||||
|
||||
Since a Setting can *only* be defined using other settings, attempting to use a non-setting in the on calls results in a type error.
|
||||
|
|
|
|||
Loading…
Reference in New Issue