6

The SettingKey.~= method is used to exclude dependencies from libraryDependencies (see play 2.3.8 sbt excluding logback), but trying to find out what it does is hard as:

  1. There is no documentation about this function at http://www.scala-sbt.org/0.13.12/api/index.html#sbt.SettingKey,
  2. It cannot be searched using Google as it uses symbols in the method name and
  3. Examination of the SBT source code (https://github.com/sbt/sbt/blob/0.13/main/settings/src/main/scala/sbt/Structure.scala#L47) does not provide an obvious answer.

Can anyone shed light on what this does?

Community
  • 1
  • 1
Woodz
  • 1,029
  • 10
  • 24
  • 1
    "It cannot be searched using Google as it uses symbols in the method name" - just to say that isn't true as I found this question in exactly this way. Maybe Google's gotten a bit smarter about including squiggles in queries. – Nick Mar 14 '19 at 11:05

1 Answers1

10
someScopedKey ~= f

is equivalent to

someScopedKey := f(someScopedKey.value)

In other words, it transforms the previous value of the setting/task with a given function. That's literally all there is to know about it.

sjrd
  • 21,805
  • 2
  • 61
  • 91