This small utility uses graphviz dot to visualise the dependencies
declared in a Common Lisp <system-name>.asd
file.
-
Linux OS
-
Graphviz (dot should be in
/usr/bin/dot
) -
A Common Lisp REPL (CCL or SBCL, tested)
-
Quicklisp
Load this file in a Common Lisp REPL (tested with CCL and SBCL), and if <file-name>
is the path (including the path to the file) to the <system-name>.asd
you would like to draw the graph of, then evaluate:
(asd-graph <file-name>)
optional keywords:
:output-dir <output-dir>
and :format <fmt>
This will create a dot and an svg (or <fmt>
if keyword :format was used) file in the same
directory as <file-name>
, or in <output-dir>
if keyword
:output-dir was used.
(asd-graph "~/quicklisp/local-projects/jeffrey/jeffrey.asd")
(asd-graph "~/quicklisp/local-projects/jeffrey/jeffrey.asd" :format "pdf")
<fmt>
can take one of the following values:
canon, dot, fig, gd, gif, hpgl, imap, cmap, mif, mp, pcl, pic, plain (ascii), png, ps, ps2, svg, vrml, vtx, wbmp.
According to the graphviz dot manual: http://www.graphviz.org/Documentation/dotguide.pdf
For now, only the simplest .asd syntax is supported, e.g.:
(defsystem "hello-lisp"
:description "hello-lisp: a sample Lisp system."
:version "0.0.1"
:author "Joe User <joe@example.com>"
:licence "Public Domain"
:depends-on ("optima.ppcre" "command-line-arguments")
:components ((:file "packages")
(:file "macros" :depends-on ("packages"))
(:file "hello" :depends-on ("macros"))))
This example is from the ASDF Manual
This utility visualises the part after :components
.
-
The well known alexandria package for common-lisp
-
My pet project, jeffrey, aka CGraph, the Choiceless Grapher