Last active
January 8, 2016 09:40
-
-
Save crisptrutski/8d84c702bd7145fddb1b to your computer and use it in GitHub Desktop.
from-lein extensions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def boot-version | |
(get (boot.App/config) "BOOT_VERSION" "2.5.5")) | |
(deftask from-lein | |
"Use project.clj as source of truth as far as possible" | |
[] | |
(let [lein-proj (let [l (-> "project.clj" slurp read-string)] | |
(merge (->> l (drop 3) (partition 2) (map vec) (into {})) | |
{:project (second l) :version (nth l 2)}))] | |
(merge-env! :repositories (:repositories lein-proj)) | |
(set-env! | |
:certificates (:certificates lein-proj) | |
:source-paths (or (:source-paths lein-proj) #{"src"}) | |
:resource-paths (or (:resource-paths lein-proj) #{}) | |
:dependencies (into (:dependencies lein-proj) | |
`[[boot/core ~boot-version :scope "provided"] | |
[adzerk/bootlaces "0.1.13" :scope "test"]])) | |
(require '[adzerk.bootlaces :refer :all]) | |
((resolve 'bootlaces!) (:version lein-proj)) | |
(task-options! | |
repl (:repl-options lein-proj {}) | |
aot {:namespace (:aot lein-proj) :all (not (:aot lein-proj))} | |
pom {:project (symbol (:project lein-proj)) | |
:version (:version lein-proj) | |
:description (:description lein-proj) | |
:url (:url lein-proj) | |
:scm {:url "https://github.com/martinklepsch/boot-gzip"} | |
:license (get lein-proj :licence {"EPL" "http://www.eclipse.org/legal/epl-v10.html"})})) | |
identity) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment