depend 0.1.0

Dependency Tool for D

To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:

Dependency Tool for D

This tool checks actual import dependencies against a UML model of target dependencies.


Run dmd with the switch --deps to extract the actual dependencies. For example:

dmd -deps=dependencies src/depend.d -o-

Use the depend tool together with the Graphviz programs for a visualization of the module dependencies:

src/depend.d --dot dependencies | dot -Tsvg -odependencies.svg

For best results, remove the transitive dependencies:

src/depend.d --dot dependencies | tred | dot -Tsvg -odependencies.svg

Consider switching to package dependencies instead of module dependencies:

src/depend.d --packages --dot dependencies | tred | dot -Tsvg -odependencies.svg

Or filter dependencies of source files matching a regular expression:

src/depend.d --filter 'src|test' --dot dependencies | tred | dot -Tsvg -odependencies.svg

Then, specify the target dependencies as a PlantUML model. For example, create a text file model.uml:

package model {}
package view {}
package controller {}

controller ..> view
controller ..> model
view .> model

Finally, use the depend tool for checking actual dependencies against the target dependencies:

src/depend.d --target model.uml dependencies

The tool complains about violations:

error: unintended dependency model -> controller
  • Maro Kröplin
0.4.0 2021-Jan-05
0.3.1 2019-Aug-19
0.3.0 2019-Aug-18
0.2.0 2018-Jul-06
0.1.0 2018-Jun-03
Show all 12 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 0 downloads this month

  • 190 downloads total

Short URL: