Compile with ECL, and compile time templates with SBCL
This commit is contained in:
+18
-3
@@ -135,9 +135,14 @@
|
||||
`((format ,stream-sym "~&||#~%~%")))))))
|
||||
|
||||
(defmethod license-generate-writer ((license <license>) &optional commented)
|
||||
(uiop:if-let (template (license-read-template license))
|
||||
(setf (license-writer license)
|
||||
(compile nil (template-generate-writer template commented)))))
|
||||
(format *error-output* "~&Loading template ~S... " (license-find-template license))
|
||||
(finish-output *error-output*)
|
||||
(let ((template (license-read-template license)))
|
||||
(unless (null template)
|
||||
(setf (license-writer license)
|
||||
(compile nil (template-generate-writer template commented)))
|
||||
(format *error-output* "ok~%")
|
||||
(license-writer license))))
|
||||
|
||||
(defmethod license-ensure-writer ((license <license>) &optional commented)
|
||||
(with-slots (writer) license
|
||||
@@ -145,3 +150,13 @@
|
||||
writer
|
||||
(license-generate-writer license commented))))
|
||||
|
||||
(defun templates-keywords-list ()
|
||||
(loop :for key :being :the :hash-keys :of *licenses*
|
||||
:collect key))
|
||||
|
||||
(defun load-templates (&optional (templates (templates-keywords-list)))
|
||||
(loop :for key :in templates
|
||||
:do (license-ensure-writer (get-license key))
|
||||
(let ((notice (get-notice key)))
|
||||
(unless (null notice)
|
||||
(license-ensure-writer notice)))))
|
||||
|
||||
+2
-1
@@ -2,4 +2,5 @@
|
||||
(:use :cl)
|
||||
(:export #:start
|
||||
#:*default-author*
|
||||
#:*default-license*))
|
||||
#:*default-license*
|
||||
#:load-templates))
|
||||
|
||||
Reference in New Issue
Block a user