common lisp asdf

use asdf/ detail

environment: linux/sbcl/gvim/slimv

[root @archlinux asdf]# pwd
/home/root/test/cl/asdf

[root @archlinux asdf]# ls -l
-rw-r--r-- 1 root root 214 11月 10 00:33 config.lisp
-rw-r--r-- 1 root root 343 11月 10 00:36 demo-control.asd
-rw-r--r-- 1 root root   72 11月   9 23:47 packages.lisp
-rw-r--r-- 1 root root 184 11月 10 00:49 source.lisp

*****demo-control.asd *****
(defpackage :asdf-control (:use #:cl #:asdf))
(in-package :asdf-control)

(defsystem :demo-control
  :description "asdf test"
  :version "0.1"
  :author "tskshy"
  :depends-on ()
  :components (
               (:file "packages")
               (:file "config" :depends-on ("packages"))
               (:file "source" :depends-on ("config"))))

*****packages.lisp*****
(defpackage :demo.asdf
  (:use :cl)
  (:export
    :print-config-info))

*****config.lisp*****
(in-package :demo.asdf)

;;next is test info
(defvar *username* "test name")
(defparameter *config-path* "/etc")
(defparameter *config-name* "file-name")
(defparameter *information* "OK, ASDF test successfully!")

*****source.lisp*****
(in-package :demo.asdf)

(defun print-config-info ()
  (progn
    (format t "myconfig information ~A | ~A | ~A ~%~%~%~A~%~%~%" *username* *config-path* *config-name* *information*)))

*****test code*****
;;;;test asdf ok?
(require :asdf)
(progn
  (format t "asdf version: ~A~%" (asdf:asdf-version))
 
  (if (eql asdf:*central-registry* nil)
    (progn
      (format t "Now, set asdf path~%")
      (push #p"/home/root/test/cl/asdf/" asdf:*central-registry*)))
 
  (format t "asdf config ok~%")
  (format t "load begin ... ~%")
  (asdf:load-system :demo-control))
(demo.asdf:print-config-info)








你可能感兴趣的:(common lisp asdf)