-
-
Notifications
You must be signed in to change notification settings - Fork 173
Expand file tree
/
Copy pathbb.edn
More file actions
67 lines (56 loc) · 2.71 KB
/
bb.edn
File metadata and controls
67 lines (56 loc) · 2.71 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
{:paths ["src"]
:tasks
{:requires [[clojure.string :as str]]
-gen-doc-tests {:doc "Generate tests from documentation code blocks"
:task (shell "clojure -M:gen-doc-tests")}
-parse-args {:task
(let [cljs? (some #{"cljs"} *command-line-args*)
all? (some #{"all"} *command-line-args*)
versions (or (seq (filter (fn [v] (str/starts-with? v "1."))
*command-line-args*))
["1.10"])]
[cljs? (if all? ["elide" "1.11" "1.12" "cljs"] versions)])}
doc-test {:doc "Run documentation tests"
:depends [-gen-doc-tests]
:task
(let [[cljs? versions] (run '-parse-args)]
(doseq [v versions]
(println "\nDoc-Testing Clojure" v)
(shell (str "clojure -M:test:test-doc"
(str ":" v)
(if cljs?
":cljs:test-doc-cljs"
":test-doc-clj")))))}
doc-test:all {:doc "Run all documentation tests"
:task (binding [*command-line-args* (conj *command-line-args* "all")]
(run 'doc-test))}
eastwood {:doc "Run Eastwood linter"
:task (shell "clojure -M:eastwood")}
test {:doc "Run the test suite."
:task
(let [[cljs? versions] (run '-parse-args)]
(doseq [v versions]
(println "\nTesting Clojure" v)
(shell (str "clojure -M"
(str ":" v)
":test:"
(if cljs? "cljs" "runner")))))}
test:bb {:extra-paths ["test"]
:extra-deps {io.github.cognitect-labs/test-runner
{:git/tag "v0.5.1" :git/sha "dfb30dd"}}
:task (exec 'cognitect.test-runner.api/test)
:exec-args {:patterns ["^(?!honey.cache).*-test$"]}}
test:all {:doc "Run all tests for different Clojure versions and ClojureScript"
:task (binding [*command-line-args* (conj *command-line-args* "all")]
(run 'test))}
-snapshot {:doc "Return snapshot options, if requested."
:task (->> (if (some #{"snapshot"} *command-line-args*)
[:snapshot true]
[])
(map str))}
ci {:doc "Run the CI pipeline of tests and build the JAR."
:depends [test:bb eastwood doc-test:all test:all]
:task (apply shell "clojure -T:build jar" (run '-snapshot))}
ci:deploy {:doc "Deploy the JAR we just built to Clojars."
:depends [ci]
:task (apply shell "clojure -T:build deploy" (run '-snapshot))}}}