-
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathbb.edn
More file actions
65 lines (58 loc) · 3.01 KB
/
Copy pathbb.edn
File metadata and controls
65 lines (58 loc) · 3.01 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
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
;; Babashka task runner for re-frame-debux. Mirrors re-frame's bb.edn
;; layout (rfd-iqz). bb tasks are the canonical entry-points for
;; tests + release; project.clj's lein equivalents stay live for one
;; cycle as a transitional shim.
{:min-bb-version "0.4.0"
:deps {day8/dev {:git/url "https://github.com/day8/dev.git"
:git/sha "f7617846597f411fd646a46b283777584a1a02bb"}}
:tasks
{:requires ([day8.dev :as dev])
:init (do
(require '[babashka.fs :as fs])
;; CHROME_BIN is the karma/shadow-cljs convention; CHROME_PATH
;; is honoured as an alias so a sticky local export keeps working.
(defn detect-chrome-path []
(or (not-empty (System/getenv "CHROME_BIN"))
(not-empty (System/getenv "CHROME_PATH"))
(some (fn [cmd]
(some-> (fs/which cmd) str))
["chromium"
"chromium-browser"
"chrome"
"google-chrome"
"google-chrome-stable"])
(let [windows-chrome "/mnt/c/Program Files/Google/Chrome/Application/chrome.exe"]
(when (fs/executable? windows-chrome)
windows-chrome))
"chromium")))
;; ---------------------------------------------------------------
;; Tests
;; ---------------------------------------------------------------
;;
;; `bb test` runs the Clojure-side macroexpansion test suite via
;; cognitect.test-runner — equivalent in scope to the legacy
;; `lein test` invocation. Most of re-frame-debux's coverage lives
;; here (dbgn zipper walker, wrap-handler! runtime API, the
;; loop+recur regression suite).
;;
;; `bb test-browser` runs the CLJC browser-test suite via
;; day8.chrome-shadow-test-runner — equivalent to the legacy
;; `lein ci` karma invocation. Requires a Chrome binary on PATH
;; (or pass :chrome-path '"<path>"' as a CLI kwarg).
test (clojure "-M:provided:test-clj")
test-browser (do (clojure "-M:provided:test" "compile" "browser-test")
(clojure "-X:provided:test" ":chrome-path" (pr-str (detect-chrome-path))))
watch-test (clojure "-M:provided:test" "watch" "browser-test")
;; ---------------------------------------------------------------
;; Release
;; ---------------------------------------------------------------
;;
;; Two coords ship from this repo: day8.re-frame/tracing (root)
;; and day8.re-frame/tracing-stubs (./tracing-stubs/). Each has
;; its own clein/build alias and ships independently — `bb clojars`
;; releases the root, `bb clojars-stubs` releases the stubs.
;;
;; The CD pipeline (.github/workflows/continuous-deployment-
;; workflow.yml) calls both.
clojars (clojure "-M:clein" "deploy")
clojars-stubs (shell {:dir "tracing-stubs"} "clojure -M:clein deploy")}}