-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.lisp
44 lines (36 loc) · 1.46 KB
/
build.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
(in-package :asdf-tools)
(deftestcmd build-asdf ()
"make sure asdf.lisp is built"
(load-system :asdf)
(success))
(deftestcmd build-asdf-tools ()
"build a binary for asdf-tools"
(asdf:operate :program-op :asdf-tools)
(success))
;;; Documentation
(deftestcmd doc ()
"build documentation in doc/ directory"
(with-failure-context (:name "in doc/ directory")
(run* '(make) :directory (pn "doc/"))))
(deftestcmd website ()
"publish documentation onto the public website"
(with-failure-context (:name "in doc/ directory")
(run* '(make website) :directory (pn "doc/"))))
;;; Line counting
(deftestcmd wc ()
"count lines of lisp code in asdf and uiop"
(with-asdf-dir ()
(flet ((lisp-only (x) (remove "lisp" x :test-not 'equal :key 'pathname-type)))
(let ((uiop-files (mapcar #'(lambda (x) (subpathname "uiop/" x)) (lisp-only (uiop-files))))
(defsystem-files (remove "build/asdf.lisp"
(lisp-only (asdf-defsystem-files)) :test 'equal)))
(run* `(pipe (wc ,@uiop-files) (sort -n)))
(terpri)
(run* `(pipe (wc ,@defsystem-files) (sort -n)))
(terpri)
(run* `(pipe (wc ,@uiop-files ,@defsystem-files) (tail -n 1)))))))
;;; debug the source registry that is being used to execute these tools.
(deftestcmd list-source-registry ()
"Display the source-registry cache"
(writeln (sort (alexandria:hash-table-alist asdf::*source-registry*)
'string< :key 'car)))