-
-
Notifications
You must be signed in to change notification settings - Fork 27
/
bb.edn
65 lines (60 loc) · 2.81 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
{:paths ["src" "dev" "test"]
:pods {org.babashka/fswatcher {:version "0.0.3"}}
:deps {org.babashka/neil {:local/root "."}}
:bbin/bin {neil {:main-opts ["-f" "neil"]}}
:tasks
{:requires ([babashka.fs :as fs]
[clojure.string :as str]
[selmer.parser :as p]
[selmer.util :refer [without-escaping]])
dev {:doc "Starts watcher to auto-build neil script"
:requires ([babashka.neil.dev :as dev])
:task (dev/dev)}
ci {:doc "Run all CI tasks locally"
:requires ([taoensso.timbre :as log])
:task (do
(log/info "bb run lint")
(run 'lint)
(log/info "bb run test:bb")
(run 'test:bb)
(log/info "bb run test:clj")
(run 'test:clj)
(log/info "bb run test:emacs")
(run 'test:emacs))}
lint (shell "clj-kondo --lint .")
gen-script {:doc "Build the neil script"
:requires ([babashka.neil.gen-script :as gen-script])
:task (gen-script/gen-script)}
bump-version {:requires ([babashka.neil :as neil]
[clojure.edn :as edn])
:task (let [version (-> (slurp "deps.edn") edn/read-string
:aliases :neil :project :version)
[major minor patch] (str/split version (re-pattern "\\."))
version (str/join "." [major minor (inc (Integer/parseInt patch))])]
(binding [*command-line-args* ["version" "set" version "--no-tag"]]
(neil/-main)))}
update-readme {:depends [gen-script]
:task (let [help (:out (shell {:out :string} "./neil"))]
(without-escaping
(->> (p/render (slurp "README.template.md")
{:help (str/trim help)})
(spit "README.md"))))}
test:bb {:depends [gen-script]
:requires ([babashka.neil.test-runner])
:task (exec 'babashka.neil.test-runner/run-tests)}
test:clj {:task (apply clojure "-M:test" *command-line-args*)}
test:emacs {:extra-paths ["."]
:requires ([tests-emacs :as te])
:task (te/run-tests)}
publish {:requires ([clojure.edn :as edn])
:doc "Pushes tag"
:task
(do
(run 'update-readme)
(shell {:continue true} "git add .")
(let [version (-> (slurp "deps.edn") edn/read-string
:aliases :neil :project :version)]
(shell {:continue true} (format "git commit -m 'Bump version %s'" version))
(shell {:continue true} (str "git tag v" version))
(shell "git push --atomic origin main"
(str "v" version))))}}}