#|

print-deps.lisp

Output dependency information extracted from the ASDF:DEFSYSTEM.

TODO Integrate this with the Dockerfile.

|#

(defparameter +extra-depends-on+
  '(:hunchentoot :woo :slynk/trace-dialog :slynk/profiler :slynk/mrepl :slynk/indentation
    :slynk/fancy-inspector :slynk/arglists :slynk))

(defun format-deps (system &optional (stream *standard-output*) extra-depends-on)
  (format stream "(ql:quickload (list ~{~s~^ ~}))~%" (system-deps system extra-depends-on)))

(defun system-deps (system &optional extra-depends-on)
  (mapcar (alexandria:compose #'alexandria:make-keyword #'string-upcase)
          (sort (remove-duplicates
                 (append extra-depends-on
                         (asdf:system-depends-on
                          (asdf:find-system system))))
                #'string<)))
