3 :ID: a072a011-0808-490b-b4ee-c665f68e4033 7 :ID: 2ab70bb9-4f1e-4ba2-ad72-b2a32dacbd5b 10 + forge :: [[https://lab.rwest.io/ellis/skel][Heptapod]] 11 + mirror :: [[https://github.com/richardwesthaver/skel][Github]] 13 This system provides functions and macros for building and deploying
14 project skeletons.
/This is not a general purpose templating 15 system/. It is specifically for my software stack.
19 :ID: 7881a92f-7406-4862-bf89-39970731f37d 21 - vaporize boilerplate code and docs
22 - integrate reasonably well with my tools (Emacs/etc)
23 - object-oriented project management
26 :ID: d0dd3e94-8c9e-4eac-847e-33a039beadbe 28 - [[https://www.gnu.org/software/emacs/manual/html_node/autotype/Skeleton-Language.html][skeleton-lanaguage (emacs)]] 29 - [[https://github.com/emacs-mirror/emacs/tree/master/lisp/cedet/ede][cedet/ede (emacs)]] 30 - [[https://www.gnu.org/software/make/manual/make.html][GNU make]] 31 - [[https://docs.factorcode.org/content/article-vocabularies.html][Factor (forth) definitions]] 34 :ID: 183bbf4c-bb3c-44f6-a4c1-49c548e0eab2 36 Make sure you have sbcl installed:
37 #+begin_src shell :results pp :eval never 44 Then compile the program. This command produces a binary called
=skel= 46 #+begin_src shell :results raw silent 47 sbcl --noinform --non-interactive --eval '(ql:quickload :app/cli/skel)' --eval '(asdf:make :app/cli/skel)'
50 Run the binary without any args, which will print a skeleton of the
51 current project directory (
=*skel-project*=).
53 #+begin_src shell :results output replace :eval never 60 usage: skel [global] <command> [<arg>]
62 A hacker's project compiler and build tool.
64 -h/--help* : print this message
65 -v/--version* : print version
66 -d/--debug* : set log level (debug,info,trace,warn)
67 -c/--config* : set a custom skel user config
68 -i/--input : input source
69 -o/--output : output target
71 init : initialize a skelfile in the current directory
72 -n/--name : project name
74 show : describe the project skelfile
75 -f/--file : path to skelfile
77 inspect : inspect the project skelfile
78 -f/--file : path to skelfile
80 make : build project targets
81 -t/--target : target to build
83 run : run a script or command
85 push : push the current project upstream
87 pull : pull the current project from remote
89 clone : clone a remote project
91 commit : commit changes to the project vc
93 edit : edit a project file
95 shell : open the sk-shell interpreter
99 Here's skel's skelfile:
101 #+begin_src shell :results output replace :wrap src skel :exports results 107 ;;; skelfile @ 2023-10-08.02:37:25 -*- mode: skel; -*-
111 :description "a hacker's project compiler"
115 :rules ((build () (print (asdf:make :skel/cli)))
116 (clean () #$rm -rf */*.fasl$#))
117 :documents ((:org "readme"))
123 :maintainer "ellis <ellis@rwest.io>"
124 :bug-tracker "https://lab.rwest.io/ellis/skel/issues"
125 :class :package-inferred-system
126 :defsystem-depends-on (:asdf-package-system)
127 :depends-on (:uiop :asdf :sb-posix :sb-bsd-sockets :sb-concurrency :cl-ppcre :std :organ :skel/pkg)
128 :in-order-to ((test-op (test-op skel/tests)))
129 :perform (test-op (op c) (uiop:symbol-call '#:rt '#:do-tests))))
130 :stash "~/dev/comp/stash"
131 :shed "~/dev/comp/shed"
134 ((autogen #$sbcl --eval '(ql:quickload :app/cli/skel)' --eval '(asdf:make :app/cli/skel)'$#))
137 This is just a form without the top-level parentheses - you're free to
138 omit them in a skelfile.
142 :ID: 9ae1fe7b-c373-4101-88d3-439793eb38f3 144 The
=describe= command can be used to check the currently active
145 skelfile, printing any errors and the parsed object.
147 #+begin_src shell :results output replace :eval never 153 #<SKEL:SK-PROJECT :ID 1e61-38b1-c5fe-7eac>
156 Slots with :INSTANCE allocation:
158 PATH = #P"/home/ellis/dev/skel/skelfile"
162 DESCRIPTION = "a hacker's project compiler"
165 ID = 2189093230060928684
167 RULES = ((BUILD NIL (PRINT (ASDF/OPERATE:MAKE :SKEL/CLI)))..
168 DOCUMENTS = ((:ORG "readme"))
169 COMPONENTS = ((:ELISP "sk")..
171 SNIPPETS = ((AUTOGEN "sbcl --eval '(asdf:make :skel/cli)'"))
180 :ID: e43b7a81-c2f9-4dc9-8a09-66259602f91b 182 Skelfiles can be compiled to produce a new project skeleton or update
185 Try compiling skel's skelfile:
187 #+begin_src shell :results output replace :exports code 191 You may also compile individual components of the project structure,
192 for example, to compile the rules into a makefile:
194 #+begin_src shell :results output replace :exports code 198 #+begin_src shell :results output :wrap src makefile :eval never 204 ### SKEL @ 2023-09-14.01:47:59 --- A hacker's project compiler -*- mode:makefile ; -*-
205 LISP=sbcl --noinform --non-interactive --eval "(asdf:load-asd \"skel.asd\")" --eval "(ql:quickload :skel)"
206 .PHONY: compile clean
207 compile:;$(LISP) --eval "(asdf:compile-system :skel)"
208 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)"
210 debug:compile;$(LISP) --eval "(start-repl)"
215 :ID: 61959899-98ec-4ee2-a862-7544674ffc7a 219 :ID: b9e5324c-059d-4416-a19a-3e5ffbac554e 221 When you run
=skel init= this is the basic skelfile that will be
222 generated in the current directory, depending on the following
224 - default user config
227 With no cli args or user config and an empty directory the output
230 ;;; examples @ 2023-10-09.23:38:23 -*- mode: skel; -*-
235 :ID: c7e2d0d9-8b0e-428d-aeb5-1b1447e2a1ed 239 :ID: d6b6bbff-7713-4f2c-9dc8-b8331497b5b4 243 :ID: 37821915-2584-4303-a929-3cf25727fa1b 245 The unit tests may also be a useful reference:
247 #+begin_src lisp :results output replace :wrap src lisp :eval never :package :skel.tests 248 (ql:quickload :skel/tests)
249 (in-package :skel.tests)
250 (setq *log-level* nil)
251 ;; (setq *catch-test-errors* nil)
252 (setq *compile-tests* t)
253 (list (multiple-value-list (do-tests :skel)) (test-results *test-suite*))
258 To load "skel/tests":
261 ; Loading "skel/tests"
262 ..................................................
263 [package skel.vc].................................
264 [package skel.virt]...............................
265 [package skel.comp.asd]...........................
266 [package skel.make]...............................
267 [package skel.ext.asdf]...........................
268 [package skel.tests].
269 in suite SKEL with 6/6 tests:
271 #<PASS MAKEFILE-TEST787>
272 #<PASS SKELRC-TEST786>
273 #<PASS SKELFILE-TEST785>
274 #<PASS HEADER-COMMENTS-TEST784>
275 #<PASS SANITY-TEST783>
281 :ID: ae46b723-6d1e-4855-9ec1-ad0eb7093960 283 - TODO :: CLOS-based core classes
284 - TODO :: EIEIO-based wrapper classes
286 #+begin_src dot :file api.svg :exports results 287 digraph { splines=true; label="CLOS API"; labelloc="t"; node [shape=record];
288 sk [label="(skel :ID :AST)"]
289 methods [label="(sk-compile sk-expand sk-build\nsk-run sk-init sk-new sk-save\nsk-tangle sk-weave sk-call sk-print)"]
290 skmet [label="(sk-meta :NAME :PATH :VERSION :DESCRIPTION)"]
291 skvcs [label="(sk-vc-meta :VC)"]
292 skcmd [label="(sk-command)"]
293 sktar [label="(sk-target)"]
294 sksrc [label="(sk-source)"]
295 skrec [label="(sk-recipe :COMMANDS)"]
296 skrul [label="(sk-rule :TARGET :SOURCE :RECIPE)"]
297 skdoc [label="(sk-document)"]
298 skscr [label="(sk-script)"]
299 skcfg [label="(sk-config)"]
300 sksni [label="(sk-snippet)"]
301 skabb [label="(sk-abbrev)"]
302 skpro [label="(sk-project\l:RULES\l:DOCUMENTS\l:SCRIPTS\l:SNIPPETS\l:ABBREVS)\l"]