I’m happy to announce the availability of dune-deps, a command-line tool that scans a dune project and gathers the dependencies into a graph. The output is in the dot format, supported by the
dot command from graphviz.
It shows the dependencies between the following:
- libraries defined by the project,
- executables defined by the project,
- direct dependencies on external libraries.
Dependencies are extracted by parsing
dune files. As an example, here’s what we obtain for the sources of opam, which has over 50K lines of code:
The commands for this are:
# obtain the project's sources $ git clone --depth=1 https://github.com/ocaml/opam.git # extract dependencies and eliminate superfluous graph edges $ dune-deps opam | tred > deps.dot # render the graph $ dot -Tpng deps.dot -o deps.png
A suggestion is to include such graph in your project’s