-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathbb.edn
More file actions
175 lines (146 loc) · 5.76 KB
/
bb.edn
File metadata and controls
175 lines (146 loc) · 5.76 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
{:paths ["src/bb"
"libraries/sdk/src/main"
"libraries/sdk-http-kit/src/main/"
"libraries/sdk-http-kit-malli-schemas/src/main"
"libraries/sdk-malli-schemas/src/main"
"./src/test/core-sdk"
"./src/test/malli-schemas"]
:deps {borkdude/rewrite-edn {:mvn/version "0.5.9"}
io.github.noahtheduke/lazytest {:mvn/version "2.0.0"}
metosin/malli {:mvn/version "0.20.1"}}
:tasks
{:requires ([tasks :as t]
[tasks.build :as build]
[tasks.cljdoc :as cljdoc])
;; ---------------------------------------------------------------------------
;; Dev tasks
;; ---------------------------------------------------------------------------
dev
{:doc "Starts a dev repl. Additional deps aliases can be passed as arguments."
:task (t/dev :aleph :http-kit :ring-jetty :malli-schemas)}
dev:rj9a
{:doc "Same as `dev` with ring-jetty replaced with rj9a."
:task (t/dev :http-kit :ring-rj9a :malli-schemas)}
dev:empty
{:doc "Dev repl with no adapters."
:task (t/dev :malli-schemas)}
dev:bb
{:doc "Start a babashka nrepl server. An addr like `localhost:1234` can be passed as argument."
:task (t/dev-bb)}
;; ---------------------------------------------------------------------------
;; Test Tasks
;; ---------------------------------------------------------------------------
test:all
{:doc "Run all tests once."
:task (t/lazytest [:aleph
:http-kit
:ring-jetty
:malli-schemas
:sdk-brotli]
[:test.paths/core-sdk
:test.paths/malli-schemas
:test.paths/brotli
:test.paths/adapter-aleph
:test.paths/adapter-ring
:test.paths/adapter-http-kit
:test.paths/adapter-ring-jetty])}
test:all-w
{:doc "Watch all tests."
:task (t/lazytest [:aleph
:http-kit
:ring-jetty
:malli-schemas
:sdk-brotli]
[:test.paths/core-sdk
:test.paths/malli-schemas
:test.paths/brotli
:test.paths/adapter-aleph
:test.paths/adapter-ring
:test.paths/adapter-ring-jetty
:test.paths/adapter-http-kit]
"--watch"
"--delay 1000")}
test:rj9a
{:doc "Same as `test:all` with ring-jetty replaced by rj9a."
:task (t/lazytest [:http-kit
:ring-rj9a]
[:test.paths/core-sdk
:test.paths/adapter-ring
:test.paths/adapter-rj9a])}
test:bb
{:doc "Run core unit tests with babashka."
:task (t/bb-lazytest [:test.paths/core-sdk
:test.paths/malli-schemas])}
test:sdk-common
{:doc "Run the server used for the SDKs' common tests."
:task (t/start-test-server)}
test:sdk-common-go
{:doc "Run the server used for the SDKs' common tests."
:task (t/run-go-tests)}
;; ---------------------------------------------------------------------------
;; Build tasks
;; ---------------------------------------------------------------------------
jar:sdk
{:doc "Build jar for the common sdk"
:task (build/lib-jar! build/sdk-dir)}
jar:sdk-adapter-ring
{:doc "Build jar for the adapter-ring"
:task (build/lib-jar! build/sdk-adapter-ring-dir)}
jar:sdk-adapter-http-kit
{:doc "Build jar for the adapter-http-kit"
:task (build/lib-jar! build/sdk-adapter-http-kit-dir)}
jar:sdk-brotli
{:doc "Build jar for the Brotli library"
:task (build/lib-jar! build/sdk-brotli-dir)}
jar:sdk-malli-schemas
{:doc "Build jar for the malli-schemas"
:task (build/lib-jar! build/sdk-malli-schemas-dir)}
jar:all
{:doc "Build the jar for all the libs"
:depends [clean
jar:sdk
jar:sdk-adapter-ring
jar:sdk-adapter-http-kit
jar:sdk-brotli
jar:sdk-malli-schemas]}
install:clean
{:doc "Deletes all datastar libs from the local maven repository."
:task (build/clean-maven-dir!)}
install:all
{:doc "Install all libraries locally."
:depends [clean]
:task (doseq [dir build/sdk-lib-dirs]
(build/lib-install! dir))}
clean
{:doc "Clean build artifacts in each library directory."
:task (doseq [dir build/sdk-lib-dirs]
(println "----------------")
(println "Cleaning: " dir)
(println "----------------")
(clojure {:dir dir} "-T:build clean"))}
set-version
{:doc "Set the version in all libs"
:task (doseq [dir build/sdk-lib-dirs]
(build/lib-set-version! dir (first *command-line-args*)))}
bump-version
{:doc "Bump the version component in all libs. First argument must be one of: major, minor, patch"
:task (doseq [dir build/sdk-lib-dirs]
(let [component (first *command-line-args*)]
(build/lib-bump! dir component)))}
publish:all
{:doc "Publish the clojure sdk libs to clojars"
:depends [jar:all]
:task (doseq [dir build/sdk-lib-dirs]
(build/lib-publish! dir))}
;; ---------------------------------------------------------------------------
;; Cljdoc tasks
;; ---------------------------------------------------------------------------
cljdoc:clean
{:doc "Clean local cljdoc data."
:task (cljdoc/clean!)}
cljdoc:server
{:doc "Start a local cljdoc server."
:task (cljdoc/start-server!)}
cljdoc:ingest
{:doc "Tell local cljdoc server to ingest a library. Needs a argument (:sdk, :http-kit, :ring, ...)"
:task (cljdoc/ingest! (first *command-line-args*))}}}