-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbb.edn
259 lines (178 loc) · 9.79 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
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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
{:deps
{protosens.local/task {:local/root "module/task"}}
:min-bb-version
"0.8.0"
;; Required so that the `genesis` task can run on a freshly cloned repo.
;;
:paths
["module/maestro/src/main/clj"
"module/string/src/main/clj"]
;; Required by the `doc:module` task.
;;
:pods
{clj-kondo/clj-kondo {:version "2022.09.08"}}
;;;;;
:tasks
{aliases
{:doc "Print all required aliases"
:protosens/doc "Given an alias or a vector of aliases and profiles, prints all necessary
aliases, following `:maestro/require` in `deps.edn`.
bb aliases :module/maestro
bb aliases '[dev :module/maestro]'
Based on `protosens.maestro/task`.
Also accepts a mode, see available ones in `deps.edn`:
bb aliases :dev :module/maestro"
:requires ([protosens.maestro])
:task (protosens.maestro/main)}
api
{:doc "Generate documentation for modules"
:protosens/doc "Generate a markdown file for each module specifying a path via
`:maestro.plugin.quickdoc.path/output`.
It will contain a full description of all namespaces belonging to the module,
with vars and usage."
:requires ([protosens.maestro.plugin.quickdoc])
:task (protosens.maestro.plugin.quickdoc/module+)}
api:bundle
{:doc "Bundle the given vector of aliases and generate a single documentation"
:protosens/doc "Similar to the `api` task but all the `:extra-paths` of the input aliases
will be merged and only one markdown file will be generated under `./API.md`."
:requires ([protosens.maestro.plugin.quickdoc])
:task (protosens.maestro.plugin.quickdoc/bundle)}
build
{:doc "Build the given module"
:protosens/doc "Based on information located in the alias data in `deps.edn`.
See the `$.maestro.plugin.build` namespace."
:requires ([protosens.maestro.plugin.build])
:task (protosens.maestro.plugin.build/main :module/maestro.plugin.build)}
changelog+
{:doc "Template all changelogs with the last stable tag"
:protosens/doc "Changelogs use `{{ next-release }}` as a placeholder for the next
stable tag."
:requires ([protosens.task.changelog])
:task (protosens.task.changelog/main)}
dev
{:doc "Starts dev mode with the given module(s)"
:protosens/doc "Shortcut for launching dev mode given an alias or a vector of aliases and profiles.
For instance, this:
bb dev :module/maestro
Is equivalent to:
clojure -M$( bb aliases :dev :module/maestro )"
:requires ([protosens.maestro.process])
:task (protosens.maestro.process/run {:maestro/mode :dev
:maestro.process/command ["clj" "-M__"]})}
expose
{:doc "Expose modules meant to be consumed as Git libraries"
:protosens/doc "By generating a custom `deps.edn` file in the `:meastro/root` of aliases that
have a `:maestro.git.lib/name`.
Consumers can then require the repository as a Git dependency and point to a
particular module using `:deps/root`."
:requires ([protosens.maestro.module.expose])
:task (protosens.maestro.module.expose/deploy)}
expose:local
{:doc "Like `expose` but Git URL will point to the repository directory"
:protosens/doc "Only for testing.
Allows testing exposition and running tasks like `req:verify` without having
to push commits."
:requires ([protosens.maestro.module.expose])
:task (protosens.maestro.module.expose/deploy-local)}
expose:req
{:doc "Generate requirer namespaces for exposed modules"
:protosens/doc "Each relevant module has an autogenerated namespace that requires all its
production namespaces.
It must be run prior to the `req:verify` task and refreshed when those modules
are changed."
:requires ([protosens.maestro.module.expose])
:task (protosens.maestro.module.expose/requirer+)}
expose:verify
{:doc "Verify exposed modules"
:protosens/doc "By executing their requirer namespaces on their `:maestro/platform+`.
Ensures that they can be consumed in production (e.g. no missing dependency).
See the `req:gen` task."
:requires ([protosens.maestro.module.expose])
:task (protosens.maestro.module.expose/verify)}
genesis
{:doc "Run before using any of these tasks"
:protosens/doc "Syncs dependencies and paths between `bb.edn` and `deps.edn`.
It is important running this after cloning the repository and
after modifying dependencies or source paths needed by these
Babashka tasks."
:requires ([protosens.maestro.module.uber])
:task (protosens.maestro.module.uber/generate :module/task)}
help
{:doc "Print documentation for the given task"
:protosens/doc "If there is any."
:requires ([protosens.bb.help])
:task (-> (protosens.bb.help/task)
(protosens.bb.help/print))}
help:missing
{:doc "Print tasks that do no have extra documentation"
:requires ([protosens.bb.help])
:task (-> (protosens.bb.help/undocumented-task+)
(protosens.bb.help/print))}
module:listing
{:doc "Generate `./module/README.md`"
:protosens/doc "Lists all exposed and private modules."
:requires ([protosens.maestro.idiom.listing])
:task (protosens.maestro.idiom.listing/main "module/README.md")}
module:readme
{:doc "Generate READMEs for all modules"
:protosens/doc "For each module, writes a header composed of the root and relevant information (link to
API, Git dependency info, etc).
If `./doc/README.md` exists relative to the root, its content is appended."
:requires ([protosens.maestro.idiom.readme])
:task (protosens.maestro.idiom.readme/main)}
mtempl
{:doc "Execute a shell command with computed required aliases"
:protosens/doc "The `aliases` task prints required aliases and this is typically useful in
combination with Clojure CLI. For instance:
clojure -M$( bb aliases :test :module/maestro )
However, some shells or some environments do not understand such substitutions
with `$()` (or similar). This task replaces `__` with the printed required
aliases.
For instance:
bb mtempl :test :module/maestro -- clojure -M__
Before `--` is what would have been provided to the `aliases`, after is the command
to template."
:requires ([protosens.maestro.process])
:task (protosens.maestro.process/run)}
lint
{:doc "Lint Clojure code throughout the whole repository"
:protosens/doc "Using `clj-kondo` which must be accessible in the terminal.
See the `lint:prepare` task which is necessary for initialization."
:requires ([protosens.maestro.plugin.clj-kondo])
:task (protosens.maestro.plugin.clj-kondo/lint)}
lint:prepare
{:doc "Prepare for `lint`"
:protosens/doc "Must be called prior to using the `lint` task and ideally when dependencies are
updated. This will lint and cache dependencies as well as copying configuration
files."
:requires ([protosens.maestro.plugin.clj-kondo])
:task (protosens.maestro.plugin.clj-kondo/prepare)}
pprint-cp
{:doc "Pretty-print the classpath received from STDIN"
:protosens/doc "Useful in combination with `-Spath`. For instance:
clojure -Spath -A$( bb aliases :module/maestro ) | bb pprint-cp
In reality, it will pretty print any string where items are separated by `:`.
bb aliases :module/maestro | bb pprint-cp"
:requires ([protosens.classpath])
:task (protosens.classpath/pprint)}
stable:tag
{:doc "Tag the last commit as a stable release"
:requires ([protosens.maestro.idiom.stable])
:task (println (protosens.maestro.idiom.stable/tag-add))}
test
{:doc "Tests the given module(s)"
:protosens/doc "Shortcut for launching tests given an alias or a vector of aliases and profiles.
For instance, this:
bb test :module/maestro
Is equivalent to:
clojure -M$( bb aliases :test :module/maestro )"
:requires ([protosens.maestro.process])
:task (protosens.maestro.process/run {:maestro/mode :test
:maestro.process/command ["clojure" "-M__"]})}
test-upstream
{:doc "Like `test` but also test transitively required aliases"
:requires ([protosens.maestro.process])
:task (protosens.maestro.process/run {:maestro/mode :test-upstream
:maestro.process/command ["clojure" "-M__"]})}
}}