Skip to content

Initialize the ASDF source registry with all projects in ~/dev/lisp/, excluding specific project directories #44

Description

@vindarel

Initialize the ASDF source registry with all projects in ~/dev/lisp/, excluding specific project directories (asdf/ and old/).

  • In the source registry, :EXCLUDE overrides any previous exclusion. Really not the right name for what it does. Also see :ALSO-EXCLUDE.
  • :EXCLUDE and :ALSO-EXCLUDE take "EXCLUSION-PATTERNS". Which are not patterns. They must be directory names, or they will never ever match anything.
  • Due to how it's implemented, if you ignore "foo", you will ignore all "foo" subdirectories in any directory previous added. Just give me path globs!
  • Finally, :EXCLUDE and :ALSO-EXCLUDE do not seem to do anything, COMPUTE-SOURCE-REGISTRY is always called with the default exclusion list even though PROCESS-SOURCE-REGISTRY processed the :EXCLUDE form.

source: https://gist.github.com/galdor/059db07a20748f3b86247387d2dcf8eb && https://framapiaf.org/@[email protected]/112542427965071262

(let* ((initialize-source-registry
         (intern "INITIALIZE-SOURCE-REGISTRY" (find-package "ASDF")))
       (project-root-directory
         (merge-pathnames #p"dev/lisp/" (user-homedir-pathname)))
       (blacklisted-directories
         (mapcar (lambda (subpath)
                   (merge-pathnames subpath project-root-directory))
                 '(#p"asdf/"
                   #p"old/")))
       (project-directories
         (delete-if (lambda (path)
                      (member path blacklisted-directories :test #'equal))
                    (directory (make-pathname :defaults project-root-directory
                                              :type :wild :name :wild)))))
  (asdf:clear-source-registry)
  (funcall initialize-source-registry
           `(:source-registry
             :ignore-inherited-configuration
             ,@(mapcar (lambda (path)
                         `(:tree ,path))
                       project-directories))))

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions