是否有可能看到sbt的执行计划?

时间:2014-12-21 10:00:10

标签: sbt

sbt构建配置可能变得非常复杂。如果确实如此,很难确切知道sbt会做什么,因为你不确定你是否在构建定义中做了正确的事情。如果你有一个大项目,运行完整的构建和测试周期来测试变化真的很痛苦而且很慢。

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

  • 将分叉多少个JVM以及何时
  • 确切地指定每个JVM的选项
  • 确切地将哪些任务分配给每个JVM
  • 究竟如何将测试分组到JVM中

也许某些信息只能通过做一些工作来确定,甚至可能通过执行完整的构建和测试来确定。但是,如果有一些清晰的报告可以清楚地说明发生了什么,那将是很棒的。

sbt是否提供这样的设施?

1 个答案:

答案 0 :(得分:1)

我认为在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

我也希望有这样的工具。