Description

Dependency Tool for D

Package Information

Version0.0.1 (2015-Apr-30)
Repository https://github.com/funkwerk/depend
LicenseMIT
CopyrightCopyright © 2015, Mario Kröplin
AuthorsMario Kröplin
Registered byMario Kröplin
Dependencies none

Installation

To use this package, put the following dependency into your project's dependencies section:

dub.json
dub.sdl

Readme

Dependency Tool for D

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

Usage

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

dmd -deps=dependencies -c src/depend.d -of/dev/null

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

Available versions

0.0.1 ~master