On Saturday, December 1, 2012 6:53:53 PM UTC+1, Joe Barnes wrote:
Hey guys, I'd like to know the best way to define a val that I can reuse in other settings. To be specific, I have about a dozen dependencies which have the same version. So rather than paste the version all through my build.sbt file, I want to define it as a val or whatever and reuse it.
Right now, the .sbt format doesn't allow val definitions to share between blank-line-delimited settings. But a single setting can be a block that internally defines a val:
libraryDependencies ++= {
val version = "1.2"
Seq(
"com.acme" % "a" % version,
"com.acme" % "b" % version
}