Custom settings and tasks in sbt

July 01, 2013

sbt configuration

build.sbt:

val x = SettingKey[Int]("x", "the x setting")
val y = SettingKey[Int]("y", "the y setting")

val multiply = TaskKey[Int]("multiply")

multiply := {
  x.value * y.value
}

x := 6
y := 7

Usage

$ sbt "show multiply"
[info] 42