gpt4 book ai didi

sbt - 能不能看到sbt的执行计划?

转载 作者:行者123 更新时间:2023-12-04 14:43:05 26 4
gpt4 key购买 nike

sbt 构建配置可能会变得相当复杂。当它发生时,很难确切地说出 sbt 会做什么,因为你不确定你在构建定义中做了正确的事情。如果您有一个大型项目,运行完整的构建和测试周期来测试更改真的很痛苦而且很慢。

例如,我正在配置 sbt 以并行构建和测试我的项目。如果我能请 sbt 报告就太好了:

  • 究竟有多少 JVM 将被 fork 以及何时 fork
  • 确切地说每个 JVM 将分配什么选项
  • 具体分配给每个 JVM 的任务是什么
  • JVM 中测试的具体分组方式

也许这些信息中的一些只能通过做一些工作来确定,甚至可能通过执行完整的构建和测试来确定。但是,如果有某种简洁的报告可以清楚地说明正在发生的事情,那就太好了。

sbt 是否提供这样的设施?

最佳答案

我不认为它可以在 sbt 中轻易实现。

inspect 命令可以告诉您很多您需要的东西,但与您所追求的相比,它只是一小部分,而且还缺少很多完整的计划。

> help inspect
inspect <key>

For a plain setting, the value bound to the key argument is displayed using its toString method.
Otherwise, the type of task ("Task" or "Input task") is displayed.

"Dependencies" shows the settings that this setting depends on.

"Reverse dependencies" shows the settings that depend on this setting.

When a key is resolved to a value, it may not actually be defined in the requested scope.
In this case, there is a defined search sequence.
"Delegates" shows the scopes that are searched for the key.
"Provided by" shows the scope that contained the value returned for the key.

"Related" shows all of the scopes in which the key is defined.

inspect tree <key>

Displays `key` and its dependencies in a tree structure.
For settings, the value bound to the setting is displayed and for tasks, the type of the task is shown.

inspect uses <key>

Displays the settings and tasks that directly depend on `key`.

inspect definitions <key>

Displays the scopes in which `key` is defined.

阅读Inspect the build了解命令。

您可能还想将 show 与某些设置一起使用,例如 forkjavaOptions:

> help fork
If true, forks a new JVM when running. If false, runs in the same JVM as the build.

> help javaOptions
Options passed to a new JVM when forking.

参见 Forking在官方文档中。

我也想拥有这样的工具。

关于sbt - 能不能看到sbt的执行计划?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27588350/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com