-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathbb.edn
More file actions
54 lines (49 loc) · 2.38 KB
/
bb.edn
File metadata and controls
54 lines (49 loc) · 2.38 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
;; all tasks that run tests can also accept:
;; all - run tests against all supported Clojure versions
;; bench - run only benchmarks
;; stress - run only stress tests
;; 1.10/1.11/1.12 - run only against the specified Clojure version (defaults to 1.10)
;; jdk11/jdk17/jdk21/jdk25 - indicate which JDK you are using (defaults to jdk25)
{:tasks
{:requires [[clojure.string :as str]]
test {:doc "Run the test suite."
:task
(let [all? (some #{"all"} *command-line-args*) ; test all clojure versions?
bench? (some #{"bench"} *command-line-args*)
stress? (some #{"stress"} *command-line-args*)
versions (or (seq (filter (fn [v] (str/starts-with? v "1."))
*command-line-args*))
["1.10"])
base-jdk (first (filter (fn [v] (str/starts-with? v "jdk"))
*command-line-args*))
jdk (or base-jdk
;; sean's local default:
"jdk25")
test-selectors
(cond bench? ["-i" ":benchmark"]
stress? ["-i" ":stress"]
:else ["-e" ":benchmark"
"-e" ":stress"])]
(doseq [v (if all? ["1.10" "1.11" "1.12"] versions)]
(println "\nTesting Clojure" v)
(apply shell "clojure"
(str "-M"
(str ":" v)
":test:runner"
;; add jdk-specific alias if provided
":" jdk)
test-selectors)))}
test:all {:doc "Run the test suite for all Clojure versions."
: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: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))}}}