I have a project built with sbt 0.11.
I’m trying to create a simple UI with Scala Swing, so first thing is to add a dependency on scala-swing in my build.sbt:
libraryDependencies += "org.scala-lang" % "scala-swing" % "2.9.1-1"
But I have a SettingKey scalaVersion defined:
scalaVersion := "2.9.1-1"
How can I reference that property? If I try to use it like
libraryDependencies += "org.scala-lang" % "scala-swing" % scalaVersion
Compiler complains that it found sbt.SettingKey[String] while String is expected. There are methods get(...) and evaluate(...) on SettingKey but they require some Setting[Scope] parameter to be passed in.
What is the simplest way to just reference this property?
You need to tell the system that
libraryDependenciesnow depends onscalaVersion:(that’s my preferred formatting; it’s actually invoking the
applymethod onscalaVersionso you could write it a few different ways, e.g.,scalaVersion("org.scala-lang" % "scala-swing" % _).)If you had multiple settings you wanted to depend on simultaneously, you’d apply on the tuple of them: