If Quicklisp is installed, you can use the built-in Quickproject function.
(ql:quickload "quickproject") (quickproject:make-project "~/src/lisp/swatchblade/" :depends-on '(vecto hunchentoot))
This creates 4 files:
- package.lisp
- swatchblade.lisp
- swatchblade.asd
- README.txt
package.lisp defines package namespaces:
(defpackage #:swatchblade (:use #:cl) (:shadowing-import-from #:vecto #:with-canvas #:rounded-rectangle #:set-rgb-fill #:save-png-stream))
swatchblade.asd defines the system / project, source files, dependencies, etc.
(asdf:defsystem #:swatchblade :serial t :depends-on (#:vecto #:hunchentoot #:cl-colors) :components ((:file "package") (:file "swatchblade")))
swatchblade.lisp is the source code.
You can download the project via QuickLisp quickload:
* (ql:quickload "swatchblade") loading output * (swatchblade:start-web-server :port 8080) Server started on port 8080.
If you then create another project that depends on the swatchblade system:
quickproject:make-project "~/src/lisp/whimsytron/" :depends-on '(swatchblade))
As for the tests, you can add another namespace to package.lisp for your tests:
(defpackage #:swatchblade-tests (:use #:cl #:swatchblade))
Create a test file, write the code and add the file to the system definition:
(asdf:defsystem #:swatchblade :serial t :depends-on (#:vecto #:hunchentoot #:cl-colors) :components ((:file "package") (:file "swatchblade") (:file "swatchglade-tests")))
Download the swatchblade-tests namespace to run the tests.
Example project with tests here
If you want Quicklisp to not install all the dependencies on the system, you will need to install the dependencies and load the system manually, as far as I know.
The author of Quicklisp, Zach Beane, has a more detailed post on using quickproject .