[英]Make a SBT subproject task depends on another subproject task
I have 2 sbt subproject, one is a CLI, one is a sbt plugin.我有 2 个 sbt 子项目,一个是 CLI,一个是 sbt 插件。
The sbt plugin will try to download at execution time the CLI. sbt 插件会在执行时尝试下载 CLI。 We have an implicit dependency here.
我们在这里有一个隐式依赖。 The tests for the sbt plugin (implemented thanks to the sbt-scripted plugin) requires the CLI to be published locally.
sbt 插件的测试(通过 sbt 脚本插件实现)需要在本地发布 CLI。
I usually run sbt +cli/publishLocal +plugin/scripted
.我通常运行
sbt +cli/publishLocal +plugin/scripted
。
How can I make this task dependency explicit in sbt so everytime i run plugin/scripted
it runs first cli/publishLocal
first?我怎样才能在 sbt 中明确这个任务依赖,所以每次我运行
plugin/scripted
它首先运行cli/publishLocal
?
(FYI project source is here https://github.com/thibaultdelor/CliAppSbtPlugin ) (仅供参考项目源在这里https://github.com/thibaultdelor/CliAppSbtPlugin )
Have you considered something like the following?你有没有考虑过类似以下的事情?
plugin/scripted := {
val dummy0 = (cli/publishLocal).value
val dummy1 = (plugin/scripted).value
dummy1
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.