-
-
Notifications
You must be signed in to change notification settings - Fork 31
/
bb.edn
85 lines (64 loc) · 2.23 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
{:paths
["src/tasks"]
:tasks
{:requires
([babashka.fs :as fs]
[cheshire.core :as json]
[tasks])
:init
(do
(def source-paths ["src" "test"]))
-lib:artifact
(tasks/artifact-path)
lib:build
{:depends [-lib:artifact]
:task (clojure (str "-X:jar :jar " -lib:artifact " :version '\"" (tasks/current-version) "\"'"))}
lib:install
{:depends [lib:build -lib:artifact]
:task (shell (str "mvn install:install-file -Dfile=" -lib:artifact " -DpomFile=pom.xml"))}
lib:deploy
{:task (if (tasks/released?)
(println "Version" (tasks/current-version) "is already released (tag for it exists). Bump with bb version:bump and try again.")
(do
(run 'test)
(tasks/artifact-build)
(tasks/artifact-deploy)
(tasks/create-tag! (tasks/version-tag))
(tasks/push-with-tags)
(println "Deployed version" (tasks/current-version) "to Clojars!")))}
; region snapshot
-lib:snapshot-version
(str (tasks/current-version) "-SNAPSHOT")
-lib:snapshot
{:depends [-lib:snapshot-version]
:task (str "target/pathom3-" -lib:snapshot-version ".jar")}
lib:snapshot:build
{:depends [-lib:snapshot -lib:snapshot-version]
:task (clojure (str "-X:jar :jar " -lib:snapshot " :version '\"" -lib:snapshot-version "\"'"))}
lib:snapshot:deploy
{:depends [lib:snapshot:build -lib:snapshot]
:task (clojure (str "-X:deploy :artifact '\"" -lib:snapshot "\"'"))}
; endregion
format-check
{:task (apply tasks/cljstyle "check" source-paths)}
format-fix
{:task (apply tasks/cljstyle "fix" source-paths)}
lint
{:task (tasks/clj-kondo-lint source-paths)}
version:bump
{:doc "Bump version to current date."
:task (let [version (tasks/bump!)]
(shell (str "git commit -m '" (tasks/version-tag) "' -- CHANGELOG.md VERSION"))
(println "Bumped to" version))}
setup-hooks
tasks/setup-git-hooks
test
(shell "clojure" "-A:test:test-deps")
test-gr
(shell "clojure" "-A:test:test-deps" "-J-Dguardrails.enabled")
test-cljs
(shell "shadow-cljs" "watch" "test" "-A:test-deps:test-cljs")
test-cljs-once
(do
(shell "shadow-cljs" "compile" "ci")
(shell "karma" "start" "--single-run"))}}