-
Notifications
You must be signed in to change notification settings - Fork 2
/
bb.edn
33 lines (28 loc) · 1.27 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
{:paths ["src"]
:tasks
{:requires [[babashka.deps :as deps]
[babashka.fs :as fs]
[babashka.process :as p]
[clojure.string :as str]]
lint {:doc "Run linter."
:task (do (when-not (fs/exists? ".clj-kondo")
;; Prep linter. The `:test` alias has main as dep.
(let [cp (with-out-str (deps/clojure ["-A:test" "-Spath"]))]
(fs/create-dir ".clj-kondo")
(p/shell "clj-kondo" "--lint" cp "--dependencies" "--copy-configs")))
(doseq [dir ["src" "test"]]
(println :linting dir "...")
(p/shell "clj-kondo" "--lint" dir)
(println)))}
lint-clean {:doc "Clean linter cache."
:task (fs/delete-tree ".clj-kondo")}
test {:doc "Run all tests."
:task
(-> (deps/clojure ["-M:test:runner"] {:inherit true})
p/check)}}}
tj {:doc "Exec bb in test/test-jar."
:task (let [dir "test/test-jar"
bb (str \" (.get (.command (.info (java.lang.ProcessHandle/current)))) \")
args (or *command-line-args* ["tasks"])]
(println (str "in " dir "...\n"))
(p/shell {:dir dir} (str/join " " (into [bb] args))))}