Skip to content

Instantly share code, notes, and snippets.

@FossiFoo
Created October 29, 2016 11:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FossiFoo/fe6883d697a10f752770c3dac34f36c3 to your computer and use it in GitHub Desktop.
Save FossiFoo/fe6883d697a10f752770c3dac34f36c3 to your computer and use it in GitHub Desktop.
(set-env!
:source-paths #{"src/cljs"}
:resource-paths #{"resources"}
:dependencies '[[adzerk/boot-cljs "1.7.228-1" :scope "test"]
[adzerk/boot-cljs-repl "0.3.0" :scope "test"]
[adzerk/boot-reload "0.4.8" :scope "test"]
[pandeiro/boot-http "0.7.2" :scope "test"]
[com.cemerick/piggieback "0.2.1" :scope "test"]
[org.clojure/tools.nrepl "0.2.12" :scope "test"]
[weasel "0.7.0" :scope "test"]
[clj-webdriver "0.7.2" :scope "test"]
[org.seleniumhq.selenium/selenium-server "2.52.0" :scope "test"]
[adzerk/boot-test "1.1.2" :scope "test"]
[org.clojure/clojurescript "1.7.228"]
[crisptrutski/boot-cljs-test "0.2.0-SNAPSHOT" :scope "test"]
[org.martinklepsch/boot-garden "1.2.5-3" :scope "compile"]
;; [garden "1.3.2" :scope "test"]
[re-frame "0.8.0"]
[re-com "0.8.3"]
[secretary "1.2.3"]
[org.slf4j/slf4j-nop "1.7.13" :scope "test"]])
(require
'[clojure.string :as s]
'[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]]
'[adzerk.boot-test :as t]
'[org.martinklepsch.boot-garden :refer [garden]])
(deftask gardening
[]
(set-env! :source-paths #(conj % "src/clj"))
identity)
(deftask build []
(comp (cljs)
(gardening)
(garden :styles-var 'tassenfinder.styles/screen
:output-to "css/screen.css")))
(deftask run []
(comp (serve)
(watch)
(cljs-repl)
(reload)
(build)))
(deftask production []
(task-options! cljs {:optimizations :advanced}
garden {:pretty-print false})
identity)
(deftask development []
(task-options! cljs {:optimizations :none :source-map true}
reload {:on-jsload 'tassenfinder.core/init})
identity)
(deftask dev
"Simple alias to run application in development mode"
[]
(comp (development)
(run)))
;;; 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 testing []
(set-env! :source-paths #(conj % "test/cljs"))
identity)
(deftask testing-e2e []
(set-env! :source-paths #(conj % "test/clj"))
identity)
(deftask test-unit []
(comp (testing)
(test-cljs :js-env :phantom
:exit? false)))
(def is-e2e-filter
'(let [n (str (ns-name (:ns (meta %))))
is-e2e (.startsWith n "end2end")]
is-e2e))
(deftask test-e2e []
(comp (testing-e2e)
(t/test :filters #{is-e2e-filter})))
(deftask run-e2e []
(comp (build)
(serve)
(test-e2e)))
(deftask test-all []
(comp (test-unit)
(run-e2e)))
(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