The Clojure Core team recently released a new Clojure library, tools.build, that is a culmination of thought around batteries-included build support for Clojure projects. I won’t go into detail around the history and contents of the library in this post because much of that is found elsewhere, including the announcement post, the tools.build guide, and the tools.build API docs. Instead, I’ll walk through adding tools.build support to a simple project that currently uses Leiningen for building and talk a little about how tools.build goes about the same tasks in a different way.
The project that I’ll work with is a small personal project called reinen-vernunft and it’s build needs are appropriate for the gentle introduction herein.
The batteries-included build story for Clojure is composed of an amalgam of complementary pieces, including: tools.deps with deps.edn, Clojure CLI, and tools.build. Therefore, enabling building in reinen-vernunft will require thinking about how these parts work in conjunction. However, to start let me show the existing project.clj file: