Skip to content

Instantly share code, notes, and snippets.

@FossiFoo
Created Feb 11, 2017
Embed
What would you like to do?
(set-env!
:source-paths #{"foo/cljs"}
:resource-paths #{"resources"}
:dependencies '[[adzerk/boot-cljs "2.0.0-SNAPSHOT" :scope "test"]
[adzerk/boot-cljs-repl "0.3.3" :scope "test"]
[adzerk/boot-reload "0.5.1" :scope "test"]
[boot-deps "0.1.6" :scope "test"]
[pandeiro/boot-http "0.7.6" :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"]
[adzerk/boot-test "1.2.0" :scope "test"]
[clj-webdriver "0.7.2" :scope "test"]
[org.seleniumhq.selenium/selenium-server "2.52.0" :scope "test"]
[io.aviso/taxi-toolkit "0.2.12" :scope "test"]
[crisptrutski/boot-cljs-test "0.3.0" :scope "test"]
[org.slf4j/slf4j-nop "1.7.22" :scope "test"]
[org.martinklepsch/boot-garden "1.3.2-0" :scope "compile"]
[garden "1.3.2" :scope "compile"]
[org.clojure/clojure "1.9.0-alpha14"]
[org.clojure/clojurescript "1.9.473"]
[re-frame "0.9.2"]
[re-com "2.0.0"]
[bidi "2.0.16"]
[io.replikativ/geheimnis "0.1.0"]
[com.cemerick/url "0.1.1"]
[com.pupeno/free-form "0.4.1"]
[com.taoensso/timbre "4.8.0"]
[cljsjs/google-analytics "2015.04.13-0"]
[binaryage/devtools "0.9.0"]])
(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)))
(deftask prod
[]
(comp (production)
(build)
(serve)
(wait)))
;;; 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