-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbb.edn
45 lines (43 loc) · 2.09 KB
/
bb.edn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{:deps {com.escherize/huff {:local/root "."}}
:tasks
{clean {:doc "Clean up"
:task (do
(println "Cleaning up...")
(clojure "-T:build clean"))}
uber {:doc "Build uberjar"
:task (do
(run 'clean)
(println "Building uberjar...")
(clojure "-T:build jar"))}
deploy {:doc "Deploy to Clojars"
:task (do
(println "Deploying to clojars")
(clojure "-T:build deploy"))}
-bb-tests {:requires ([clojure.string :as str]
[clojure.test :as t]
[babashka.classpath :as cp]
[babashka.fs :as fs])
:task (do
(cp/add-classpath "src:test")
(let [test-nss (for [test-file (fs/glob "test" "**.clj")
:let [test-ns (-> test-file
str
(->> (re-matches (re-pattern "test/(.*).clj")))
second
(str/replace "_" "-" )
(str/replace "/" ".")
symbol)]]
(do (require test-ns) test-ns))
results (apply t/run-tests test-nss)]
(when (pos? (+ (:fail results) (:error results)))
(System/exit 1))))}
tests {:doc "Run tests in bb and Clj."
:task (do
(println "+---------------------------+")
(println "| Running tests in Babashka |")
(println "+---------------------------+")
(run '-bb-tests)
(println "+--------------------------+")
(println "| Running tests in Clojure |")
(println "+--------------------------+")
(clojure "-M:test"))}}}