support explicitly defining sequences of settings in .sbt files

This commit is contained in:
Mark Harrah 2011-04-13 19:09:33 -04:00
parent 8b7e421807
commit 19ac4b51b2
1 changed files with 6 additions and 1 deletions

View File

@ -179,8 +179,13 @@ trait Init[Scope]
case Seq(x, xs @ _*) => (join(xs) zipWith x)( (t,h) => h +: t)
}
}
final class Setting[T](val key: ScopedKey[T], val init: Initialize[T])
sealed trait SettingsDefinition {
def settings: Seq[Setting[_]]
}
final class SettingList(val settings: Seq[Setting[_]]) extends SettingsDefinition
final class Setting[T](val key: ScopedKey[T], val init: Initialize[T]) extends SettingsDefinition
{
def settings = this :: Nil
def definitive: Boolean = !init.dependsOn.contains(key)
def dependsOn: Seq[ScopedKey[_]] = remove(init.dependsOn, key)
def mapReferenced(g: MapScoped): Setting[T] = new Setting(key, init mapReferenced g)