Last active
February 23, 2016 13:55
-
-
Save darioghilardi/36d009e3c1f43407f872 to your computer and use it in GitHub Desktop.
clojure_002: Boot build file
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
(set-env! | |
:source-paths #{"sass" "src/cljs"} | |
:resource-paths #{"resources"} | |
:dependencies '[...]) | |
(require | |
'[adzerk.boot-cljs :refer [cljs]] | |
'[adzerk.boot-cljs-repl :refer [cljs-repl start-repl]] | |
'[adzerk.boot-reload :refer [reload]] | |
'[pandeiro.boot-http :refer [serve]] | |
'[crisptrutski.boot-cljs-test :refer [test-cljs]] | |
'[mathias.boot-sassc :refer [sass]]) | |
(deftask build [] | |
(comp (speak) | |
(cljs) | |
(sass :output-dir "css"))) | |
(deftask run [] | |
(comp (serve) | |
(watch) | |
(cljs-repl) | |
(reload) | |
(build))) | |
(deftask production [] | |
(task-options! cljs {:optimizations :advanced} | |
sass {:output-style "compressed"}) | |
identity) | |
(deftask development [] | |
(task-options! cljs {:optimizations :none :source-map true} | |
reload {:on-jsload 'project-name.app/init} | |
sass {:line-numbers true | |
:source-maps true}) | |
identity) | |
(deftask dev | |
"Simple alias to run application in development mode" | |
[] | |
(comp (development) | |
(run))) | |
(deftask testing [] | |
(set-env! :source-paths #(conj % "test/cljs")) | |
identity) | |
;;; This prevents a name collision WARNING between the test task and | |
;;; clojure.core/test, a function that nobody really uses or cares | |
;;; about. | |
(ns-unmap 'boot.user 'test) | |
(deftask test [] | |
(comp (testing) | |
(test-cljs :js-env :phantom | |
:exit? true))) | |
(deftask auto-test [] | |
(comp (testing) | |
(watch) | |
(test-cljs :js-env :phantom))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment