Skip to content

Instantly share code, notes, and snippets.

@bsima
Last active August 29, 2015 14:10
Show Gist options
  • Star 12 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bsima/88969126962803a6500f to your computer and use it in GitHub Desktop.
Save bsima/88969126962803a6500f to your computer and use it in GitHub Desktop.
Sometimes you want to use boot as a scripting platform on top of Leinengen. Paste this code at the top of your build.boot file. It reads in the project.clj file and stores it as a map named "project" which you can then use with `set-env!` to setup your environment.
(set-env! :dependencies '[[leiningen-core "2.5.0"]])
(use 'leiningen.core.project)
(eval (read-string (slurp "project.clj")))
(set-env!
:source-paths (:source-paths project)
:resource-paths (:resource-paths project)
:dependencies (:dependencies project))
;; Line 9 will replace the dependencies vector from line 1. If you want to merge them,
;; you might need to do #(into % (:dependencies project)) or something like that.
@martinklepsch
Copy link

I made this into a task and added it to the Boot wiki: https://github.com/boot-clj/boot/wiki/Using-Boot-in-a-Leiningen-Project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment