Browse code
Remove build artifacts add the dependency grapher
fiddlerwoaroof authored on 23/05/2016 23:42:40
Showing 2 changed files
Showing 2 changed files
1 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,36 @@ |
1 |
+(defpackage #:tempores.package-grapher |
|
2 |
+ (:use #:cl)) |
|
3 |
+ |
|
4 |
+(in-package #:tempores.package-grapher) |
|
5 |
+ |
|
6 |
+(defun get-dependencies (package) |
|
7 |
+ (let ((source-package-name package) |
|
8 |
+ (package (find-package package))) |
|
9 |
+ (remove-duplicates |
|
10 |
+ (stable-sort |
|
11 |
+ (loop for x being the symbols in package |
|
12 |
+ unless (eq package (symbol-package x)) |
|
13 |
+ collect (list source-package-name |
|
14 |
+ (alexandria:make-keyword (package-name (symbol-package x))))) |
|
15 |
+ #'string< |
|
16 |
+ :key #'cadr) |
|
17 |
+ :test 'equal))) |
|
18 |
+ |
|
19 |
+(defun get-all-dependencies (packages) |
|
20 |
+ (stable-sort |
|
21 |
+ (loop for package in packages |
|
22 |
+ nconc (get-dependencies package)) |
|
23 |
+ #'string< |
|
24 |
+ :key #'cadr)) |
|
25 |
+ |
|
26 |
+(defun make-graph-conns (conns) |
|
27 |
+ (format nil "~:{~4t~(\"~a\" -> \"~a\"~%~)~}" conns)) |
|
28 |
+ |
|
29 |
+(defun make-graph (conns) |
|
30 |
+ (format nil "digraph {~%~a~%}~%" (make-graph-conns conns))) |
|
31 |
+ |
|
32 |
+(defun graph-packages (packages) |
|
33 |
+ (make-graph (get-all-dependencies packages))) |
|
34 |
+ |
|
35 |
+(defun graph-tempores-packages () |
|
36 |
+ (graph-packages tempores.packages:*tempores-packages*)) |