SBT 0.13.8 what does the SettingKey.~= method do

荒凉一梦 提交于 2019-12-08 04:12:13

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/41627627/sbt-0-13-8-what-does-the-settingkey-method-do

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!