/build.boot Secret
Created
July 6, 2017 11:14
Star
You must be signed in to star a gist
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
(let [target-cljsbuild (java.io.File. "target/cljsbuild")] | |
(if (not (.exists target-cljsbuild)) | |
(.mkdirs target-cljsbuild))) | |
(set-env! | |
:dependencies '[[adzerk/boot-cljs "2.1.0-SNAPSHOT" :scope "test"] | |
[adzerk/boot-cljs-repl "0.3.3" :scope "test"] | |
[clj-time "0.13.0"] | |
[compojure "1.6.0"] | |
[cprop "0.1.10"] | |
[funcool/struct "1.0.0"] | |
[luminus-immutant "0.2.3"] | |
[luminus-nrepl "0.1.4"] | |
[luminus/ring-ttl-session "0.3.2"] | |
[markdown-clj "0.9.99"] | |
[metosin/muuntaja "0.3.1"] | |
[metosin/ring-http-response "0.9.0"] | |
[mount "0.1.11"] | |
[org.clojure/clojure "1.8.0"] | |
[org.clojure/clojurescript "1.9.671" :scope "provided"] | |
[org.clojure/tools.cli "0.3.5"] | |
[org.clojure/tools.logging "0.4.0"] | |
[org.webjars.bower/tether "1.4.0"] | |
[org.webjars/bootstrap "4.0.0-alpha.5"] | |
[org.webjars/font-awesome "4.7.0"] | |
[ring-webjars "0.2.0"] | |
[ring/ring-core "1.6.1"] | |
[ring/ring-defaults "0.3.0"] | |
[selmer "1.10.7"]] | |
:source-paths #{"src/cljc" "src/clj"} | |
:resource-paths #{"target/cljsbuild" "resources"}) | |
(require '[adzerk.boot-cljs :refer [cljs]] | |
'[adzerk.boot-cljs-repl :refer [cljs-repl]]) | |
(deftask dev | |
"Enables configuration for a development setup." | |
[] | |
(set-env! | |
:source-paths #(conj % "env/dev/clj" "src/cljs" "src/cljc" "env/dev/cljs" ) | |
:resource-paths #(conj % "env/dev/resources") | |
:dependencies #(concat % '[[prone "1.1.4"] | |
[ring/ring-mock "0.3.0"] | |
[ring/ring-devel "1.6.1"] | |
[pjstadig/humane-test-output "0.8.2"] | |
[adzerk/boot-reload "0.5.1" :scope "test"] | |
[binaryage/devtools "0.9.4"] | |
[com.cemerick/piggieback "0.2.2"] | |
[crisptrutski/boot-cljs-test "0.3.2-SNAPSHOT" :scope "test"] | |
[doo "0.1.7"] | |
[figwheel-sidecar "0.5.10"] | |
[org.clojure/clojurescript cljs-version :scope "test"] | |
[org.clojure/tools.nrepl "0.2.12" :scope "test"] | |
[pandeiro/boot-http "0.7.6" :scope "test"] | |
[weasel "0.7.0" :scope "test"]])) | |
(task-options! repl {:init-ns 'user}) | |
(require 'pjstadig.humane-test-output) | |
(let [pja (resolve 'pjstadig.humane-test-output/activate!)] | |
(pja)) | |
identity) | |
(deftask testing | |
"Enables configuration for testing." | |
[] | |
(dev) | |
(set-env! :resource-paths #(conj % "env/test/resources")) | |
identity) | |
(deftask run | |
"Runs the project without building class files." | |
[] | |
(require 'test.core) | |
(let [m (resolve 'test.core/-main)] | |
(with-pass-thru _ | |
(m)))) | |
(deftask build | |
"Builds an uberjar of this project that can be run with java -jar" | |
[] | |
(set-env! | |
:source-paths #(conj % "env/prod/clj") | |
:resource-paths #(conj % "env/prod/resources")) | |
(comp | |
(aot :namespace #{'test.core}) | |
(uber) | |
(jar :file "test.jar" :main 'test.core) | |
(sift :include #{#"test.jar"}) | |
(target))) | |
(require '[clojure.java.io :as io]) | |
(deftask figwheel | |
"Runs figwheel and enables reloading." | |
[] | |
(dev) | |
(require '[adzerk.boot-reload :refer [reload]] | |
'[pandeiro.boot-http :refer [serve]]) | |
(let [reload (resolve 'adzerk.boot-reload/reload) | |
serve (resolve 'pandeiro.boot-http/serve)] | |
(comp | |
(watch) | |
(reload) | |
(cljs-repl) | |
(cljs)))) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment