Pretty-printing plans

You can print the plan to get detailed info on what will happen during instantiation. The printout includes file:line info so your IDE can show you where the binding was defined!

val plan = Injector().plan(module)



You can also query a plan to see the dependencies and reverse dependencies of a specific class and their order of instantiation:

// Print dependencies
// Print reverse dependencies


The printer highlights circular dependencies.

distage also uses some macros to create TagKs and function bindings, you can turn on macro debug output during compilation by setting -Dizumi.debug.macro.rtti=true java property:

sbt -Dizumi.debug.macro.rtti=true compile

Graphviz rendering

Add GraphDumpBootstrapModule to your Injector’s configuration to enable dumping of graphviz files with a graphical representation of the Plan.

val injector = Injector(new GraphDumpBootstrapModule())

Data will be saved dumped to ./target/plan-last-full.gv and ./target/plan-last-nogc.gv in current working directory.

You’ll need a GraphViz installation to render these files into a viewable PNG images:

dot -Tpng target/plan-last-nogc.gv -o out.png