Quickproject Revisions

Sun Oct 15, 2017

So I did some ribbit/cl-fds prototyping a little while ago1.

But in preparation, hacked a bit on Xach's pretty decent quickproject library. I've been using it to create project skeletons for Common Lisp for quite a while, but it's unsatisfying in a few ways I thought I'd fix up.

Its default output is ... minimal

In particular

It's possible that the reason I find this unsatisfactory is that I've been writing a lot of Clojure lately, and the fantastic lein utility there takes care of all of this and then some, but I still want the functionality.

It's hard to change that default output

quickproject theoretically has a template-capable subsystem that lets you point it at a directory somewhere and generate from that place instead. Which is a fine thing to have, except that most of its internals are not template based. There's a specific function that outputs the README.txt file for instance, which means that even if you work up a template directory with a README.md, the .txt will be output regardless, and you'll presumably delete it by hand.

Also, because of the templating approach, it's extremely hard to make an output file named after the project. Which you'd need in order to effectively override the <your-project>.asd and <your-project>.lisp files generated by default.

There isn't an easily available example template directory

The template engine used here is html-template, but quickproject messes with the template delimiters somewhat, which means that html-template documentation is almost helpful, but doesn't give you something you could cut/paste to work up a new project template. Which isn't a huge deal, but docs are nice, and since quickproject is the defacto default Common Lisp project generation tool, it'd be nice if those docs were present and as simple as possible to use.

Fixing It

My edits resolve all of the above, and can be found here, just in case I didn't throw enough links at you already.

In terms of interface, it's transparent. So if you're used to using quickproject:make-project yourself, there are absolutely no changes to internalize from the activation perspective. However

  1. There is a default-template directory available that shows you what the base template looks like, and conveniently can be copied out and cut up for your own nefarious purposes.
  2. The internals of the library have been modified so that it automatically uses the template directory for everything, including README and asd generation. This way you can easily remove pieces, not just add or replace them
  3. The output machinery looks for two specific files named system.asd and application.lisp which get output as <your-project>.asd and <your-project>.lisp rather than naively. This lets you generate your projects' asd and lisp files trivially, at the admitted cost that you can't have files literally named "system.asd" and "application.lisp" in your project tree.

I've already used a branch of my version to generate the cl-fds project (which includes a generated test harness using test-utils, quickcheck and prove).

There's an open PR, so hopefully, this gets merged into the mainline quickproject at some point. Given how busy Xach is, I wouldn't hold my breath, but you can still clone and use mine if you like.

EDIT: As of October 27, 2017, it has been merged. So, presumably, at this point you can get all this functionality out of the main quickproject project.

Creative Commons License

all articles at langnostic are licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License

Reprint, rehost and distribute freely (even for profit), but attribute the work and allow your readers the same freedoms. Here's a license widget you can use.

The menu background image is Jewel Wash, taken from Dan Zen's flickr stream and released under a CC-BY license