Repository navigation
Expand file tree
/
Copy pathbb.edn
More file actions
31 lines (31 loc) · 1.5 KB
/
Copy pathbb.edn
File metadata and controls
31 lines (31 loc) · 1.5 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
{:tasks
{:requires [[babashka.fs :as fs]
[clojure.string :as str]]
:init (do (defn release-tag []
(->> (shell {:out :string}
"git tag -l --sort=v:refname")
:out
str/split-lines
(filter (fn [s]
(re-find (re-pattern "^v\\d+\\.\\d+\\.\\d+$") s)))
last
str/trim))
(defn version []
(apply str (drop-while #{\v} (release-tag))))
(defn version-dotfile []
(let [f (fs/file ".version")]
(when-not (fs/exists? f)
(fs/create-file f)
(fs/delete-on-exit f))
(fs/update-file f (fn [& _] (version))))))
install (shell "npm install")
test {:doc "Compile and run shadow-cljs browser tests, using headless chrome."
:depends [install]
:task (do
(shell "clojure -M:test -m shadow.cljs.devtools.cli compile browser-test")
(apply shell "clojure -X:test" *command-line-args*))}
clojars {:depends [install]
:task (do (version-dotfile)
(shell "clojure -M:clein deploy"))}
watch-test {:doc "Run a hot-reloading shadow-cljs browser-test"
:task (shell "clojure -M '-m shadow.cljs.devtools.cli watch browser-test")}}}