-
Notifications
You must be signed in to change notification settings - Fork 5
/
bb.edn
58 lines (51 loc) · 2.11 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
{:deps {io.github.matthewdowney/rich-comment-tests {:local/root "."}}
:paths ["bb"]
:tasks
{loc
{:extra-deps {io.github.matthewdowney/linesofcode-bb {:git/tag "v0.0.1" :git/sha "4dbee31"}}
:requires ([com.mjdowney.loc :as loc])
:task (loc/breakdown {:root ["src" "bb" "test"] :exclude ["src/dev"]})}
test-bb
{:doc "run tests for Babashka support"
:task test-rct-with-bb/main}
test-bb-run-tests-in-file-tree
{:doc "tests run directly with run-tests-in-file-tree!"
:requires ([com.mjdowney.rich-comment-tests.test-runner :as rct])
:task (rct/run-tests-in-file-tree! {:dirs #{"bb"}})}
test-clj
{:doc "run clj unit tests"
:task (clojure "-X:test")}
test
{:doc "run all tests"
:task (do
(println "Running Babashka tests...")
(run 'test-bb)
(run 'test-bb-run-tests-in-file-tree)
(println "\nRunning CLJ tests...")
(run 'test-clj))}
coords
{:doc "update the dependency coordinates in README.md"
:requires ([clojure.string :refer [split split-lines replace]]
[babashka.process :refer [sh shell]])
:task (let [tag (->> (sh "git" "tag") :out split-lines peek)
sha (-> (sh "bash -c 'git log | head -1'")
:out
(split (re-pattern " "))
second
(subs 0 7))
coords (str "{" (pr-str :git/tag tag :git/sha sha) "}")
dep "io.github.matthewdowney/rich-comment-tests"]
(spit "README.md"
(-> (slurp "README.md")
(replace
(re-pattern (format "(?s)%s \\{:git/tag \"[^\\}]+\\}" dep))
(format "%s %s" dep coords))))
(shell "git diff README.md"))}
uber {:doc "Build uberjar"
:task (do
(println "Building uberjar...")
(clojure "-T:build jar"))}
deploy {:doc "Deploy to Clojars"
:task (do
(println "Deploying to clojars")
(clojure "-T:build deploy"))}}}