Skip to content

Instantly share code, notes, and snippets.

@bartojs
Last active December 3, 2015 00:34
Show Gist options
  • Save bartojs/b247f426e4425e912ee1 to your computer and use it in GitHub Desktop.
Save bartojs/b247f426e4425e912ee1 to your computer and use it in GitHub Desktop.
boot-clj task to generate project.clj for cursive clojure
;; add to build.boot to generate project.clj for cursiveclojure
;; adds clojurescript if boot-cljs is used
(deftask lein []
(let [coords [(symbol (or (get-env :project) "boot-project")) (or (get-env :version) "0.1.0-SNAPSHOT")]
proj (into {} (keep #(if-let [x (get-env %)] [% x])
[:url :licence :description :dependencies]))
cljs? (.matches (pr-str (:dependencies proj)) ".*adzerk/boot-cljs .*")
projcljs (update-in proj [:dependencies] conj '[org.clojure/clojurescript "1.7.170"])]
(spit "project.clj" (cons 'defproject (apply concat coords (if cljs? projcljs proj))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment