Skip to content

Instantly share code, notes, and snippets.

Created September 14, 2017 11:21
Show Gist options
  • Save anonymous/e588ef18d5265d1749f85b338ef98da2 to your computer and use it in GitHub Desktop.
Save anonymous/e588ef18d5265d1749f85b338ef98da2 to your computer and use it in GitHub Desktop.
(set-env!
:dependencies '[[adzerk/boot-cljs "2.1.0-SNAPSHOT" :scope "test"]
[adzerk/boot-cljs-repl "0.3.3" :scope "test"]
[adzerk/boot-test "1.2.0" :scope "test"]
[clj-time "0.14.0"]
[com.h2database/h2 "1.4.193"]
[compojure "1.6.0"]
[conman "0.6.7"]
[cprop "0.1.10"]
[crisptrutski/boot-cljs-test "0.3.2-SNAPSHOT" :scope "test"]
[funcool/struct "1.0.0"]
[luminus-immutant "0.2.3"]
[luminus-migrations "0.3.9"]
[luminus-nrepl "0.1.4"]
[luminus/boot-cprop "1.0.0" :scope "test"]
[luminus/ring-ttl-session "0.3.2"]
[markdown-clj "0.9.99"]
[metosin/muuntaja "0.3.2"]
[metosin/ring-http-response "0.9.0"]
[mount "0.1.11"]
[org.clojure/clojure "1.8.0"]
[org.clojure/clojurescript "1.9.854" :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.2"]
[ring/ring-defaults "0.3.1"]
[selmer "1.11.0"]]
:source-paths #{"src/cljs" "src/cljc" "src/clj"}
:resource-paths #{"resources"})
(require '[adzerk.boot-test :refer [test]]
'[luminus.boot-cprop :refer [cprop]])
(require '[adzerk.boot-cljs :refer [cljs]]
'[adzerk.boot-cljs-repl :refer [cljs-repl start-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"]
[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.11"]
[org.clojure/clojurescript cljs-version :scope "test"]
[org.clojure/tools.nrepl "0.2.12" :scope "test"]
[powerlaces/boot-figreload "0.1.1-SNAPSHOT" :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))
(cprop :profile :profiles/dev))
(deftask testing
"Enables configuration for testing."
[]
(dev)
(set-env! :resource-paths #(conj % "env/test/resources"))
(merge-env! :source-paths ["src/cljc" "src/cljs" "test/cljs"])
(cprop :profile :profiles/test))
(deftask prod
"Enables configuration for production building."
[]
(merge-env! :source-paths #{"env/prod/clj" "env/prod/cljs"}
:resource-paths #{"env/prod/resources"})
(cprop :profile :profiles/prod))
(deftask start-server
"Runs the project without building class files.
This does not pause execution. Combine with a wait task or use the \"run\"
task."
[]
(require 'boot.core)
(let [m (resolve 'boot.core/-main)]
(with-pass-thru _
(apply m *args*))))
(deftask run
"Starts the server and causes it to wait."
[]
(comp
(apply start-server *args*)
(wait)))
(require '[clojure.java.io :as io])
(require '[crisptrutski.boot-cljs-test :refer [test-cljs]])
(deftask figwheel
"Runs figwheel and enables reloading."
[]
(dev)
(require '[powerlaces.boot-figreload :refer [reload]])
(let [reload (resolve 'powerlaces.boot-figreload/reload)]
(comp
(reload :client-opts {:debug true})
(cljs-repl)
(cljs)
(start-server)
(wait))))
(deftask run-cljs-tests
"Runs the doo tests for ClojureScript."
[]
(comp
(testing)
(test-cljs :cljs-opts {:output-to "target/test.js", :main "boot.doo-runner", :optimizations :whitespace, :pretty-print true})))
(deftask uberjar
"Builds an uberjar of this project that can be run with java -jar"
[]
(comp
(prod)
(aot :namespace #{'boot.core})
(cljs :optimizations :advanced)
(uber)
(jar :file "boot.jar" :main 'boot.core)
(sift :include #{#"boot.jar"})
(target)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment