Adding new task dependencies to built-in SBT tasks?

前端 未结 4 2040
耶瑟儿~
耶瑟儿~ 2021-02-01 03:43

Is it possible to override or modify built-in SBT tasks (like compile) to depend on custom tasks in my own Build.scala? Overriding e.g. \"compile\" directly is not possible sinc

4条回答
  •  渐次进展
    2021-02-01 04:24

    Since this question appears when Googling how to add a dependency in SBT, and the current answers are deprecated as of 0.13.x and removed in 1.0, here's the updated answer, assuming that printAction is the task that compile should depend on:

    (Compile / compile) := ((Compile / compile) dependsOn printAction).value

提交回复
热议问题