-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbb.edn
77 lines (58 loc) · 2.01 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
{:tasks
{:requires
([clojure.edn :as edn]
[clojure.string :as str]
[babashka.fs :as fs])
:init
(do
(defn cli-args-map
[]
(->> *command-line-args*
(map (comp edn/read-string str/trim))
(apply hash-map))))
clean
{:doc "Cleans up any build artifacts"
:task (shell "clojure -T:build clean")}
compile:java
{:doc "Compiles the java files"
:task (if (seq (fs/modified-since "target/classes" "src/java"))
(shell "clojure -T:build compile-java")
(println "Skipped java compile. `src/java` is not modified"))}
compile:clj
{:doc "Compiles the Clojure files"
:task (shell "clojure -T:build compile-clj")}
build:check
{:doc "Checks that source compiles."
:depends [clean compile:java compile:clj]}
build:jar
{:doc "Builds a jar file"
:task (shell "clojure -T:build jar")}
install
{:doc "Install into local Maven repo cache"
:task (shell "clojure -T:build install")}
deploy
{:doc "Deploy to clojars."
:depends [clean build:check test build:jar]
:task (shell "clojure -T:build deploy")}
cider
{:doc "Runs the repl"
:task (shell "clj -M:dev:test:debug:cider")}
test
{:doc "Runs clojure tests"
:depends [compile:java]
:task (shell "clojure -M:dev:test default")}
test:ff
{:doc "Runs clojure tests stopping on first failure."
:task (shell "clojure -M:dev:test default --fail-fast")}
test:focus
{:doc "Runs a specific clojure tests referenced by namespace or fully qualified var."
:task (let [named-test (first *command-line-args*)]
(when-not named-test
(lib/sys-exit 1 "no namespace or fully qualified var specified"))
(shell (str "clojure -M:dev:test --focus " named-test)))}
outdated
{:doc "Lists outdated dependencies"
:task (let [{:keys [upgrade]} (cli-args-map)
upgrade-flags (if upgrade "--upgrade --force --download" "")
cmd (format "clojure -M:outdated %s" upgrade-flags)]
(shell {:continue true} cmd))}}}