Can sbt execution plan be seen?

The sbt build configuration can get quite complex. When this happens, it is difficult to tell exactly what sbt will do because you are not sure you did the right thing in defining the assembly. And if you have a large project, doing full build and test cycles to validate changes is very painful and slow.

For example, I am setting up sbt to build and test my project in parallel. It would be great if I could ask sbt to report:

  • exactly how many JVMs will be forked and when
  • exactly what options will be assigned to each JVM
  • exactly what tasks will be assigned to each JVM
  • exactly how the tests will be grouped in the JVM

Perhaps some of this information can only be determined by doing some work, perhaps even by doing a full build and testing. But nevertheless, it would be great to have some kind of neat report that clearly states what is going on.

Does sbt offer such a facility?

+3


source to share


1 answer


I don't think this can be easily achieved in sbt.

There's a inspect

team out there that can tell you quite a bit of what you need, but that's just a small part compared to what you need, and a lot is missing to have a complete plan.

> 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.

      

Read Inspect Assembly to learn more about the command.



You can also use show

with some customization like fork

or javaOptions

:

> 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.

      

See Forking in the official documentation.

I would also like to have such a tool.

+1


source







All Articles