【问题标题】:SBT 0.13/1.0 - replacment for <<= / <+= operators to redefine tasks?SBT 0.13/1.0 - 替换 <<= / <+= 运算符以重新定义任务?
【发布时间】:2017-01-29 13:33:37
【问题描述】:

目前 SBT 告诉我 &lt;&lt;= 我用来添加触发器的某些事件已被弃用。

updateBrowsers &lt;&lt;= updateBrowsers.triggeredBy(fastOptJS in Compile)

建议改用:=~=

但是经过多次尝试,fastOptJS 不再触发updateBrowsers 任务。

我尝试过的:

updateBrowsers := updateBrowsers.triggeredBy(fastOptJS in Compile)

updateBrowsers ~= (_ => updateBrowsers.triggeredBy(fastOptJS in Compile))

updateBrowsers :=  Def.task {
  updateBrowsers.triggeredBy(fastOptJS in Compile)
}

updateBrowsers := Def.taskDyn {
  updateBrowsers.triggeredBy(fastOptJS in Compile)
}

那么,我们如何在 SBT 0.13+ 中添加需要的任务依赖项或任务触发器?

【问题讨论】:

  • 如果dependsOn 改写有效,您可以尝试答案here。我无法让triggeredBy 工作。

标签: scala sbt


【解决方案1】:

我认为您的答案在文档中

http://www.scala-sbt.org/0.13/docs/Migrating-from-sbt-012x.html#Migrating+when+using+%2C++or

它明确指出,如果您有:

a <<= a triggeredBy b

由于问题 #1444,您不能在 SBT 0.13.13 及更早版本中将其替换为 :=

【讨论】:

  • 啊,谢谢 - 我在最初阅读时错过了它。确认新版本不再有此问题后会接受答案
猜你喜欢
  • 1970-01-01
  • 2014-05-23
  • 2017-08-12
  • 1970-01-01
  • 2016-08-13
  • 2018-03-23
  • 2016-06-22
  • 2011-02-09
  • 1970-01-01
相关资源
最近更新 更多