Skip to content

Commit

Permalink
Introduce Lisp Development System
Browse files Browse the repository at this point in the history
  • Loading branch information
foretspaisibles committed Sep 23, 2023
1 parent 0a928ee commit 7754b8d
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 37 deletions.
22 changes: 17 additions & 5 deletions resource/template/LISP-ASDF/TEMPLATE-TEXT
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,34 @@
:description "${PROJECT_DESCRIPTION}"
:author "${COPYRIGHT_HOLDER}"
:license "${LICENSE_NAME}"
:depends-on (:alexandria)
:depends-on (#:alexandria)
:components
((:module "src"
:components ((:file "package")
(:file "utilities")
(:file "entrypoint")))))
:components ((:file "package")
(:file "utilities")
(:file "entrypoint")))))

(asdf:defsystem #:${LISP_TEST_SYSTEM_NAME}
:description "${PROJECT_DESCRIPTION}"
:author "${COPYRIGHT_HOLDER}"
:license "${LICENSE_NAME}"
:depends-on (:alexandria :org.melusina.confidence :${LISP_SYSTEM_NAME})
:depends-on (#:alexandria
#:org.melusina.confidence
#:${LISP_SYSTEM_NAME})
:components
((:module "testsuite"
:components ((:file "package")
(:file "utilities")
(:file "entrypoint")))))

(asdf:defsystem #:${LISP_SYSTEM_NAME}/development
:description "Development tools for ${PROJECT_NAME}"
:author "${COPYRIGHT_HOLDER}"
:license "${LICENSE_NAME}"
:depends-on (#:alexandria
#:org.melusina.atelier)
:components
((:module "libexec/lisp"
:components ((:file "development")))))

;;;; End of file `${FILENAME}'
1 change: 1 addition & 0 deletions resource/template/LISP-DEVELOPMENT/TEMPLATE-NAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Lisp development file
62 changes: 62 additions & 0 deletions resource/template/LISP-DEVELOPMENT/TEMPLATE-TEXT
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
;;;; ${FILENAME} — ${SUMMARY}

;;;; ${PROJECT_NAME} (${HOMEPAGE})
;;;; This file is part of ${PROJECT_NAME}.
;;;;
;;;; Copyright © ${COPYRIGHT_YEAR} ${COPYRIGHT_HOLDER}
;;;; All rights reserved.

;;;; ${LICENSE_HEADER}

(defpackage #:${LISP_SYSTEM_NAME}/development
(:use #:common-lisp)
(:export
#:lint
#+quicklisp
#:reload))

(in-package #:${LISP_SYSTEM_NAME}/development)

(defun system-relative-pathname (&rest pathnames)
(labels ((system-source-directory ()
(asdf:system-source-directory #.(string-downcase (package-name *package*))))
(merge-one (pathname)
(merge-pathnames pathname (system-source-directory))))
(mapcar #'merge-one pathnames)))

(defparameter *parameter-bindings*
'((:copyright-holder . "${COPYRIGHT_HOLDER}")
(:copyright-year . "${COPYRIGHT_YEAR}")
(:project-filename . "${PROJECT_FILENAME}")
(:project-name . "${PROJECT_NAME}")
(:project-description . "${PROJECT_DESCRIPTION}")
(:project-long-description . "${PROJECT_LONG_DESCRIPTION}")
(:homepage . "${HOMEPAGE}")
(:license . :${LICENSE_ID})))

(defun lint ()
(let ((atelier:*parameter-bindings* *parameter-bindings*))
(atelier:lint
(system-relative-pathname
#p"${PROJECT_FILENAME}.asd"
#p"development"
#p"doc"
#p"src"
#p"testsuite"
#p"libexec/lisp/development.lisp"))))

#+quicklisp
(defun reload ()
(ql:quickload '("${LISP_SYSTEM_NAME}"
"${LISP_SYSTEM_NAME}/testsuite"
"${LISP_SYSTEM_NAME}/development")))


;;;;
;;;; Command Stock
;;;;

#+nil
(${LISP_SYSTEM_NAME}/development:reload)

;;;; End of file `${FILENAME}'
1 change: 0 additions & 1 deletion resource/template/LISP-SETUP/TEMPLATE-NAME

This file was deleted.

29 changes: 0 additions & 29 deletions resource/template/LISP-SETUP/TEMPLATE-TEXT

This file was deleted.

4 changes: 2 additions & 2 deletions src/template.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,8 @@ and the testsuite: package definition, utilities and entrypoints."
:template-list
((:lisp-asdf #p"${PROJECT_FILENAME}.asd"
((:summary . "System definition for ${PROJECT_NAME}")))
(:lisp-setup #p"libexec/lisp/setup.lisp"
((:summary . "Project setup for ${PROJECT_NAME}")))
(:lisp-development #p"libexec/lisp/development.lisp"
((:summary . "Development System for ${PROJECT_NAME}")))
(:lisp-docstrings #p"libexec/lisp/docstrings.lisp")
(:lisp-package #p"src/package.lisp"
((:summary . "Package for ${PROJECT_NAME}")))
Expand Down

0 comments on commit 7754b8d

Please sign in to comment.