Project template for Common Lisp

After some time it becomes tedious to bootstrap a new project, and for that reason I’ve decided to create my personal project template for Common Lisp.

The project template for Common Lisp, which I’m using provides ASDF system definitions for the core system and the respective test system. It also comes with scripts for running the test suite, Dockerfiles for SBCL, ECL and CCL implementations, as well as Github Actions for building Docker images and running the test suite.

I am well aware of Cookiecutter, which has been designed to solve that particular problem, but at the same time I wanted to have something simple and with no dependencies.

The project template for Common Lisp, which I’m currently using can be found in the dnaeon/cl-skeleton repo.

In order to create a new project simply clone the repo, edit the project-vars.env file and run the build-skeleton.sh script, e.g.

$ ./build-skeleton.sh expand ~/Projects/lisp/cl-foobar
[build-skeleton.sh] INFO: Creating new project in /home/dnaeon/Projects/lisp/cl-foobar ...
[build-skeleton.sh] INFO: Copying directory docs/ into /home/dnaeon/Projects/lisp/cl-foobar/
[build-skeleton.sh] INFO: Copying directory src/ into /home/dnaeon/Projects/lisp/cl-foobar/
[build-skeleton.sh] INFO: Copying directory scripts/ into /home/dnaeon/Projects/lisp/cl-foobar/
[build-skeleton.sh] INFO: Copying directory examples/ into /home/dnaeon/Projects/lisp/cl-foobar/
[build-skeleton.sh] INFO: Copying directory tests/ into /home/dnaeon/Projects/lisp/cl-foobar/
[build-skeleton.sh] INFO: Copying directory .github/ into /home/dnaeon/Projects/lisp/cl-foobar/
[build-skeleton.sh] INFO: Copying file cl-skeleton.test.asd.tmpl into /home/dnaeon/Projects/lisp/cl-foobar/
[build-skeleton.sh] INFO: Copying file README.org into /home/dnaeon/Projects/lisp/cl-foobar/
[build-skeleton.sh] INFO: Copying file CHANGELOG.org.tmpl into /home/dnaeon/Projects/lisp/cl-foobar/
[build-skeleton.sh] INFO: Copying file .gitignore into /home/dnaeon/Projects/lisp/cl-foobar/
[build-skeleton.sh] INFO: Copying file cl-skeleton.asd.tmpl into /home/dnaeon/Projects/lisp/cl-foobar/
[build-skeleton.sh] INFO: Copying file Dockerfile.sbcl into /home/dnaeon/Projects/lisp/cl-foobar/
[build-skeleton.sh] INFO: Copying file Dockerfile.ecl into /home/dnaeon/Projects/lisp/cl-foobar/
[build-skeleton.sh] INFO: Copying file Dockerfile.ccl into /home/dnaeon/Projects/lisp/cl-foobar/
[build-skeleton.sh] INFO: Copying file LICENSE.tmpl into /home/dnaeon/Projects/lisp/cl-foobar/
[build-skeleton.sh] INFO: Copying file Makefile into /home/dnaeon/Projects/lisp/cl-foobar/
[build-skeleton.sh] INFO: Copying file README.org.tmpl into /home/dnaeon/Projects/lisp/cl-foobar/
[build-skeleton.sh] INFO: Expanding template ./README.org.tmpl into ./README.org ...
[build-skeleton.sh] INFO: Deleting template ./README.org.tmpl ...
[build-skeleton.sh] INFO: Expanding template ./LICENSE.tmpl into ./LICENSE ...
[build-skeleton.sh] INFO: Deleting template ./LICENSE.tmpl ...
[build-skeleton.sh] INFO: Expanding template ./cl-skeleton.asd.tmpl into ./cl-foobar.asd ...
[build-skeleton.sh] INFO: Deleting template ./cl-skeleton.asd.tmpl ...
[build-skeleton.sh] INFO: Expanding template ./CHANGELOG.org.tmpl into ./CHANGELOG.org ...
[build-skeleton.sh] INFO: Deleting template ./CHANGELOG.org.tmpl ...
[build-skeleton.sh] INFO: Expanding template ./cl-skeleton.test.asd.tmpl into ./cl-foobar.test.asd ...
[build-skeleton.sh] INFO: Deleting template ./cl-skeleton.test.asd.tmpl ...
[build-skeleton.sh] INFO: Expanding template ./.github/FUNDING.yml.tmpl into ./.github/FUNDING.yml ...
[build-skeleton.sh] INFO: Deleting template ./.github/FUNDING.yml.tmpl ...
[build-skeleton.sh] INFO: Expanding template ./.github/workflows/docker-image.yaml.tmpl into ./.github/workflows/docker-image.yaml ...
[build-skeleton.sh] INFO: Deleting template ./.github/workflows/docker-image.yaml.tmpl ...
[build-skeleton.sh] INFO: Expanding template ./.github/workflows/run-tests.yaml.tmpl into ./.github/workflows/run-tests.yaml ...
[build-skeleton.sh] INFO: Deleting template ./.github/workflows/run-tests.yaml.tmpl ...
[build-skeleton.sh] INFO: Expanding template ./tests/test-suite.lisp.tmpl into ./tests/test-suite.lisp ...
[build-skeleton.sh] INFO: Deleting template ./tests/test-suite.lisp.tmpl ...
[build-skeleton.sh] INFO: Expanding template ./scripts/run-tests.sh.tmpl into ./scripts/run-tests.sh ...
[build-skeleton.sh] INFO: Deleting template ./scripts/run-tests.sh.tmpl ...
[build-skeleton.sh] INFO: Expanding template ./src/package.lisp.tmpl into ./src/package.lisp ...
[build-skeleton.sh] INFO: Deleting template ./src/package.lisp.tmpl ...
[build-skeleton.sh] INFO: Expanding template ./src/core.lisp.tmpl into ./src/core.lisp ...
[build-skeleton.sh] INFO: Deleting template ./src/core.lisp.tmpl ...
[build-skeleton.sh] INFO: Done

Your new Common Lisp project is now ready to use and located in ~/Projects/cl-foobar.

Written on January 3, 2023