Created
January 14, 2020 09:39
-
-
Save windymelt/655de5ccec4e08a161d4c7a8f1870b72 to your computer and use it in GitHub Desktop.
provides package which links to all files under the named directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; inside your ASD file | |
(in-package :cl-user) | |
(defpackage foo-asd | |
(:use :cl :asdf) | |
(:export :define-dependency-aggregator-package)) | |
(in-package :foo-asd) | |
(ql:quickload :alexandria) | |
(defparameter *dependency-source-dir* (merge-pathnames #P"src/" (uiop:getcwd))) | |
(defun define-dependency-aggregator-package (name) | |
(let ((file-names-without-ext | |
(mapcar #'pathname-name | |
(uiop:directory-files | |
(merge-pathnames (pathname (format nil "~A/" (string-downcase (subseq (symbol-name name) (1+ (position #\/ (symbol-name name) :from-end t)))))) *dependency-source-dir*))))) | |
`(defpackage ,name | |
(:use :cl) | |
,@(mapcar #'(lambda (f) (list :import-from (alexandria:make-keyword (string-upcase (format nil "~A/~A" name f))))) file-names-without-ext)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(in-package :cl-user) | |
#.(foo-asd:define-dependency-aggregator-package :foo/features) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment