Next: , Previous: , Up: Issues with using and extending ASDF to define systems   [Contents][Index]


13.6.5 How do I create a system definition where all the source files have a .cl extension?

Starting with ASDF 2.014.14, you may just pass the builtin class cl-source-file.cl as the :default-component-class argument to defsystem:

(defsystem my-cl-system
  :default-component-class cl-source-file.cl
  ...)

Another builtin class cl-source-file.lsp is offered for files ending in .lsp.

If you want to use a different extension for which ASDF doesn’t provide builtin support, or want to support versions of ASDF earlier than 2.014.14 (but later than 2.000), you can define a class as follows:

;; Prologue: make sure we're using a sane package.
(defpackage :my-asdf-extension
   (:use :asdf :common-lisp)
   (:export #:cl-source-file.lis))
(in-package :my-asdf-extension)

(defclass cl-source-file.lis (cl-source-file)
  ((type :initform "lis")))

Then you can use it as follows:

(defsystem my-cl-system
  :default-component-class my-asdf-extension:cl-source-file.lis
  ...)

Of course, if you’re in the same package, e.g. in the same file, you won’t need to use the package qualifier before cl-source-file.lis. Actually, if all you’re doing is defining this class and using it in the same file without other fancy definitions, you might skip package complications:

(in-package :asdf)
(defclass cl-source-file.lis (cl-source-file)
   ((type :initform "lis")))
(defsystem my-cl-system
  :default-component-class cl-source-file.lis
  ...)