简体   繁体   English

SBT 0.13.8 SettingKey。〜=方法做什么

[英]SBT 0.13.8 what does the SettingKey.~= method do

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: SettingKey。〜=方法用于从libraryDependencies中排除依赖项(请参见播放2.3.8 sbt,不包括logb​​ack ),但是尝试找出它的作用是很困难的:

  1. There is no documentation about this function at http://www.scala-sbt.org/0.13.12/api/index.html#sbt.SettingKey , 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 无法使用Google进行搜索,因为它在方法名称和
  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. SBT源代码( https://github.com/sbt/sbt/blob/0.13/main/settings/src/main/scala/sbt/Structure.scala#L47 )的检查没有提供明显的答案。

Can anyone shed light on what this does? 谁能阐明它的作用?

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. 实际上,这就是所有要了解的内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM