libraryDependencies <+= scalaVersion("org.scala-lang" % "scala-swing" % _)
<
tells SBT that your parameter is dependent on another parameter.
+
tells SBT that you want to add a different value, rather than replacing existing ones (also indicates that the contents of this parameter are a sequence, and you add one element to it).
The syntax for setting(function)
same as function(setting)
, where function
takes a parameter that is evaluated in the corresponding context as a parameter. I donβt even know how to write this, and it will be very much, so the shortcut is very useful.
You can also use (setting 1, setting 2)((a, b) => ... )
to create dependencies on several parameters.
PS: The following may work: it is a bit shorter, but it was deprecated without special compiler flags from 2.10.0.
libraryDependencies <+= scalaVersion("org.scala-lang" % "scala-swing" %)
source share