Skip to content

Boot for Leiningen Users

micha edited this page Dec 25, 2014 · 21 revisions

All of the different abstractions used to control how Leiningen works (plugins, profiles, middleware, injections, etc.) can all be implemented as boot tasks. This document shows some of the common patterns Leiningen users will be accustomed to and their boot equivalents.

Profiles, Middleware

The equivalent of Leiningen profiles and middleware in boot are tasks that modify the environment and return clojure.core/identity, the no-op task middleware.

For example, a task to add the test directory to the :source-paths when running tests, similar to the test profile in Leiningen:

(deftask testing
  "Profile setup for running tests."
  []
  (set-env! :source-paths #(conj % "test"))
  identity)

Profiles are "activated" simply by adding them to the pipeline, for example:

$ boot testing run-tests

This is equivalent to Lein's

$ lein with-profile testing run-tests

Lein Pprint

The equivalent of lein pprint in boot is:

boot show -e
Clone this wiki locally