RFE: :initially-do and :finally-do
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ASDF |
Opinion
|
Wishlist
|
Unassigned |
Bug Description
mk:defsystem in clocc has options :initially-do and :finally-do which allow executing code before and after compiling.
it also offers mk:system-
this allows me to do regression testing after each compilation on the modified files only.
this also allows me to regenerate autoload files only after compilation.
see clocc/src/
(let (tbc) ; To Be Compiled
(mk:defsystem cllib
:depends-on (port metering)
:components
((:file "animals" :depends-on
("base" "string" "miscprint" "fileio" "closio" "symb"))
..
(:file "xml" :depends-on
("base" "string" "withtype" "closio" "log" "fileio" "url")))
:initially-do
(progn (mk:system-
(setq tbc (mk:files-in-system :cllib :new-source-
:finally-do
(when tbc
(in-package :cllib)
(when (member "tests" tbc :test #'string= :key #'pathname-name)
(funcall (intern "TEST-ALL" :cllib) :what
(let ((auto (translate-
(funcall (intern "AUTOLOAD-GENERATE" :cllib)
) ; tbc
Request: Please break this unitary ticket into two "bite-sized" tickets that can be individually checked off (or possibly three). Otherwise, if we were to add FINALLY-DO, e.g., but not add FILES-IN-SYSTEM, this would hang around forever.
The things you want (IIUC) are:
1. INITIALLY-DO -- ASDF already has DO-FIRST for this purpose, but this may not work well (it's somewhat poorly understood), and may not be fully supported going forward. I'd regard it as "not exported" for now.
2. FINALLY-DO
Both of the above need refinement. I don't see how they work in MK-DEFSYSTEM because I don't know what they are relative to in ASDF terms. LOAD-OP? COMPILE-OP? TEST-OP? DOC-OP?
Looks like the FINALLY-DO example might be partially replaceable simply by defining TEST-OP. I think autoload generation could probably be handled by a PERFORM method, as well.
3. Addition of FILES-IN-SYSTEM. This should /definitely/ be pushed to another ticket. Also we need more semantics for it. Are the FASLs part of FILES-IN-SYSTEM? Only the source-files? What about STATIC-FILES? C-SOURCE-FILES?