4 + forge :: [[https://lab.rwest.io/ellis/skel][Heptapod]] 5 + mirror :: [[https://github.com/richardwesthaver/skel][Github]] 7 This system provides functions and macros for building and deploying
8 project skeletons.
/This is not a general purpose templating 9 system/. It is specifically for my software stack.
12 - vaporize boilerplate code and docs
13 - integrate reasonably well with my tools (Emacs/etc)
14 - object-oriented project management
16 - [[https://www.gnu.org/software/emacs/manual/html_node/autotype/Skeleton-Language.html][skeleton-lanaguage (emacs)]] 17 - [[https://github.com/emacs-mirror/emacs/tree/master/lisp/cedet/ede][cedet/ede (emacs)]] 18 - [[https://www.gnu.org/software/make/manual/make.html][GNU make]] 19 - [[https://docs.factorcode.org/content/article-vocabularies.html][Factor (forth) definitions]] 21 Make sure you have sbcl installed:
22 #+begin_src shell :results pp :eval never 29 Then compile the program. This command produces a binary called
=skel= 31 #+begin_src shell :results raw silent 32 sbcl --noinform --non-interactive --eval '(ql:quickload :app/cli/skel)' --eval '(asdf:make :app/cli/skel)'
35 Run the binary without any args, which will print a skeleton of the
36 current project directory (
=*skel-project*=).
38 #+begin_src shell :results output replace :eval never 45 usage: skel [global] <command> [<arg>]
47 A hacker's project compiler and build tool.
49 -h/--help* : print this message
50 -v/--version* : print version
51 -d/--debug* : set log level (debug,info,trace,warn)
52 -c/--config* : set a custom skel user config
53 -i/--input : input source
54 -o/--output : output target
56 init : initialize a skelfile in the current directory
57 -n/--name : project name
59 show : describe the project skelfile
60 -f/--file : path to skelfile
62 inspect : inspect the project skelfile
63 -f/--file : path to skelfile
65 make : build project targets
66 -t/--target : target to build
68 run : run a script or command
70 push : push the current project upstream
72 pull : pull the current project from remote
74 clone : clone a remote project
76 commit : commit changes to the project vc
78 edit : edit a project file
80 shell : open the sk-shell interpreter
84 Here's skel's skelfile:
86 #+begin_src shell :results output replace :wrap src skel :exports results 92 ;;; skelfile @ 2023-10-08.02:37:25 -*- mode: skel; -*-
96 :description "a hacker's project compiler"
100 :rules ((build () (print (asdf:make :skel/cli)))
101 (clean () #$rm -rf */*.fasl$#))
102 :documents ((:org "readme"))
108 :maintainer "ellis <ellis@rwest.io>"
109 :bug-tracker "https://lab.rwest.io/ellis/skel/issues"
110 :class :package-inferred-system
111 :defsystem-depends-on (:asdf-package-system)
112 :depends-on (:uiop :asdf :sb-posix :sb-bsd-sockets :sb-concurrency :cl-ppcre :std :organ :skel/pkg)
113 :in-order-to ((test-op (test-op skel/tests)))
114 :perform (test-op (op c) (uiop:symbol-call '#:rt '#:do-tests))))
115 :stash "~/dev/comp/stash"
116 :shed "~/dev/comp/shed"
119 ((autogen #$sbcl --eval '(ql:quickload :app/cli/skel)' --eval '(asdf:make :app/cli/skel)'$#))
122 This is just a form without the top-level parentheses - you're free to
123 omit them in a skelfile.
126 The
=describe= command can be used to check the currently active
127 skelfile, printing any errors and the parsed object.
129 #+begin_src shell :results output replace :eval never 135 #<SKEL:SK-PROJECT :ID 1e61-38b1-c5fe-7eac>
138 Slots with :INSTANCE allocation:
140 PATH = #P"/home/ellis/dev/skel/skelfile"
144 DESCRIPTION = "a hacker's project compiler"
147 ID = 2189093230060928684
149 RULES = ((BUILD NIL (PRINT (ASDF/OPERATE:MAKE :SKEL/CLI)))..
150 DOCUMENTS = ((:ORG "readme"))
151 COMPONENTS = ((:ELISP "sk")..
153 SNIPPETS = ((AUTOGEN "sbcl --eval '(asdf:make :skel/cli)'"))
161 Skelfiles can be compiled to produce a new project skeleton or update
164 Try compiling skel's skelfile:
166 #+begin_src shell :results output replace :exports code 170 You may also compile individual components of the project structure,
171 for example, to compile the rules into a makefile:
173 #+begin_src shell :results output replace :exports code 177 #+begin_src shell :results output :wrap src makefile :eval never 183 ### SKEL @ 2023-09-14.01:47:59 --- A hacker's project compiler -*- mode:makefile ; -*-
184 LISP=sbcl --noinform --non-interactive --eval "(asdf:load-asd \"skel.asd\")" --eval "(ql:quickload :skel)"
185 .PHONY: compile clean
186 compile:;$(LISP) --eval "(asdf:compile-system :skel)"
187 test:compile;$(LISP) --eval "(ql:quickload :skel/tests)" --eval "(in-package :skel.tests)" --eval "(compile-file \"tests.lisp\")" --eval "(load-file \"tests.lisp\")" --eval "(do-tests :skel)"
189 debug:compile;$(LISP) --eval "(start-repl)"
194 When you run
=skel init= this is the basic skelfile that will be
195 generated in the current directory, depending on the following
197 - default user config
200 With no cli args or user config and an empty directory the output
203 ;;; examples @ 2023-10-09.23:38:23 -*- mode: skel; -*-
209 The unit tests may also be a useful reference:
211 #+begin_src lisp :results output replace :wrap src lisp :eval never :package :skel.tests 212 (ql:quickload :skel/tests)
213 (in-package :skel.tests)
214 (setq *log-level* nil)
215 ;; (setq *catch-test-errors* nil)
216 (setq *compile-tests* t)
217 (list (multiple-value-list (do-tests :skel)) (test-results *test-suite*))
222 To load "skel/tests":
225 ; Loading "skel/tests"
226 ..................................................
227 [package skel.vc].................................
228 [package skel.virt]...............................
229 [package skel.comp.asd]...........................
230 [package skel.make]...............................
231 [package skel.ext.asdf]...........................
232 [package skel.tests].
233 in suite SKEL with 6/6 tests:
235 #<PASS MAKEFILE-TEST787>
236 #<PASS SKELRC-TEST786>
237 #<PASS SKELFILE-TEST785>
238 #<PASS HEADER-COMMENTS-TEST784>
239 #<PASS SANITY-TEST783>
244 - TODO :: CLOS-based core classes
245 - TODO :: EIEIO-based wrapper classes
247 #+begin_src dot :file api.svg :exports results 248 digraph { splines=true; label="CLOS API"; labelloc="t"; node [shape=record];
249 sk [label="(skel :ID :AST)"]
250 methods [label="(sk-compile sk-expand sk-build\nsk-run sk-init sk-new sk-save\nsk-tangle sk-weave sk-call sk-print)"]
251 skmet [label="(sk-meta :NAME :PATH :VERSION :DESCRIPTION)"]
252 skvcs [label="(sk-vc-meta :VC)"]
253 skcmd [label="(sk-command)"]
254 sktar [label="(sk-target)"]
255 sksrc [label="(sk-source)"]
256 skrec [label="(sk-recipe :COMMANDS)"]
257 skrul [label="(sk-rule :TARGET :SOURCE :RECIPE)"]
258 skdoc [label="(sk-document)"]
259 skscr [label="(sk-script)"]
260 skcfg [label="(sk-config)"]
261 sksni [label="(sk-snippet)"]
262 skabb [label="(sk-abbrev)"]
263 skpro [label="(sk-project\l:RULES\l:DOCUMENTS\l:SCRIPTS\l:SNIPPETS\l:ABBREVS)\l"]