-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile.toml
More file actions
436 lines (353 loc) · 10.7 KB
/
Makefile.toml
File metadata and controls
436 lines (353 loc) · 10.7 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
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
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
# Documentation: https://github.com/sagiegurari/cargo-make
env_files = [".env"]
## Git
[tasks.install-git-lfs]
condition = { env_true = ["CARGO_REQUIRE_GIT_LFS"] }
description = "Makes sure the git lfs hooks are enabled in the repository"
private = false
workspace = false
dependencies = ["enable-git-hooks"]
command = "git"
args = ["lfs", "install", "--force"]
### Git - Hooks
[tasks.enable-git-hooks]
condition = { platforms = [ # All hooks are shell scripts
"linux",
"mac",
], fail_message = "Git hooks are not available for Windows! Use a proper OS." }
description = "Enable git hooks by setting the hooksPath to scripts/hooks"
workspace = false
command = "git"
args = ["config", "core.hooksPath", "scripts/hooks"]
[tasks.pre-commit]
description = "Executed by the pre-commit hook."
workspace = false
dependencies = ["lint"]
### Git - Conventional Commits
[tasks.install-cocogitto]
description = "Install the cocogitto crate to handle conventional commit messages"
workspace = false
private = true
install_crate = { crate_name = "cocogitto", binary = "cog", test_arg = "--version" }
[tasks.install-koji]
condition = { env_not_set = ["NO_KOJI"] }
description = "Install the koji crate to generate conventional commit messages"
workspace = false
private = true
install_crate = { crate_name = "koji", binary = "koji", test_arg = "--version" }
## Build
[tasks.install-trunk]
condition = { env_true = ["CARGO_REQUIRE_WEB_SUPPORT"] }
description = "Install the trunk crate for WASM support"
workspace = false
private = true
install_crate = { crate_name = "trunk", binary = "trunk", test_arg = "--version" }
[tasks.install-target-wasm]
condition = { env_true = ["CARGO_REQUIRE_WEB_SUPPORT"] }
description = "Adds the wasm32 target"
workspace = false
private = true
command = "rustup"
args = ["target", "add", "wasm32-unknown-unknown"]
[tasks.install-web-support]
condition = { env_true = ["CARGO_REQUIRE_WEB_SUPPORT"] }
description = "Installs everything to be able to build for the web"
workspace = false
dependencies = ["install-target-wasm", "install-trunk"]
### Build - Extra Scripts
[tasks.script-link-assets]
condition = { files_exist = ["scripts/link_assets.sh"] }
description = "Run script link_assets.sh"
workspace = false
script = { file = "scripts/link_assets.sh" }
### Build - Tasks
[tasks.build]
description = "Builds the entire workspace"
workspace = false
category = "Build"
dependencies = ["setup"]
command = "cargo"
args = ["build", "--workspace", "--all-targets", "--all-features"]
[tasks.build-benchmark]
description = "Builds the entire workspace with timings enabled"
workspace = false
category = "Build"
dependencies = ["setup"]
command = "cargo"
args = ["build", "--workspace", "--all-targets", "--all-features", "--timings"]
## Test
[tasks.install-nextest]
description = "Install the nextest test runner"
workspace = false
private = true
install_crate = { crate_name = "cargo-nextest", binary = "cargo-nextest", test_arg = "--version" }
install_crate_args = ["--locked"]
[tasks.test-pre-build]
description = "Pre builds the tests without running them"
workspace = false
command = "cargo"
args = [
"test",
"--no-run",
"--locked",
"--workspace",
"--all-targets",
"--all-features",
]
[tasks.test-cargo]
description = "Test the entire workspace"
workspace = false
dependencies = ["setup"]
command = "cargo"
args = ["test", "--workspace", "--all-targets", "--all-features"]
[tasks.nextest]
description = "Running tests with nextest without llvm-cov"
workspace = false
dependencies = ["install-nextest"]
command = "cargo"
args = ["nextest", "run", "--workspace", "--all-targets", "--all-features"]
### Test - Coverage
[tasks.install-llvm-cov]
description = "Install llvm-cov"
workspace = false
private = true
install_crate = { crate_name = "cargo-llvm-cov", binary = "cargo-llvm-cov", test_arg = [
"llvm-cov",
"--version",
] }
install_crate_args = ["--locked"]
[tasks.test]
description = "Running tests with nextest and llvm-cov"
workspace = false
dependencies = ["install-llvm-cov", "install-nextest"]
command = "cargo"
args = [
"llvm-cov",
"nextest",
"--workspace",
"--all-targets",
"--all-features",
"--no-pager",
"--no-report",
] # Tip: Use either "--no-clean" or "--no-report" to prevent recompilation. See https://github.com/taiki-e/cargo-llvm-cov/pull/214
# llvm-cov reference: https://crates.io/crates/cargo-llvm-cov
#
# Ignore rationale:
# - Code coverage should indicate the coverage of what's being shipped, not
# local dev tools.
[tasks.test-coverage]
description = "Running tests with nextest and llvm-cov and generates reports"
workspace = false
dependencies = ["install-llvm-cov", "install-nextest", "test"]
command = "cargo"
args = [
"llvm-cov",
"report",
"--ignore-filename-regex",
"crates/(examples_common|xtask|mdbook_crate_links)/.*",
"--html",
]
[tasks.clean-llvm-cov]
description = "Cleans coverage artifacts that may affect coverage results."
workspace = false
dependencies = ["install-llvm-cov"]
command = "cargo"
args = ["llvm-cov", "clean", "--workspace"]
[tasks.validate-codecov-yml]
description = "Validates the codecov yml file. Only needed if the codecov.yml file is changed."
workspace = false
command = "curl"
args = [
"-X",
"POST",
"--data-binary",
"@codecov.yml",
"https://codecov.io/validate",
]
## Linting
### Linting - Formatting
[tasks.install-rustfmt]
description = "Install rustup component rustfmt"
workspace = false
private = true
install_crate = { rustup_component_name = "rustfmt" }
[tasks.format]
description = "Format checks the entire workspace"
workspace = false
dependencies = ["install-rustfmt"]
command = "cargo"
args = ["fmt", "--all", "--", "--check"]
[tasks.format-write]
description = "Formats the entire workspace"
workspace = false
dependencies = ["install-rustfmt"]
command = "cargo"
args = ["fmt", "--all", "--", "--emit=files"]
### Linting - Clippy
[tasks.install-clippy]
description = "Install rustup component clippy"
workspace = false
private = true
install_crate = { rustup_component_name = "clippy" }
[tasks.clippy]
description = "Lints the entire workspace"
workspace = false
dependencies = ["install-clippy"]
command = "cargo"
args = [
"clippy",
"--locked",
"--workspace",
"--all-targets",
"--all-features",
"--",
"-D",
"warnings",
]
### Linting - Machete
[tasks.install-cargo-machete]
description = "Install cargo-machete to check for unused crates"
workspace = false
private = true
install_crate = { crate_name = "cargo-machete", binary = "cargo-machete", test_arg = "--version" }
install_crate_args = ["--locked"]
[tasks.machete]
description = "Checks for unused dependencies"
workspace = false
dependencies = ["install-cargo-machete"]
command = "cargo"
args = ["machete"]
### Linting - Audit
[tasks.install-cargo-audit]
description = "Install the cargo-audit crate"
workspace = false
private = true
install_crate = { crate_name = "cargo-audit", binary = "cargo-audit", test_arg = "--version" }
install_crate_args = ["--locked"]
[tasks.audit]
description = "Runs cargo audit"
workspace = false
dependencies = ["install-cargo-audit"]
command = "cargo"
args = ["audit"]
### Linting - xtask lints
[tasks.xtask-lint-codecov]
description = "Checks that all creates have a codecov component"
workspace = false
command = "cargo"
args = ["run", "-p", "xtask", "--", "lint", "codecov"]
[tasks.xtask-lint-docs]
description = "Checks that all rx_* creates are part of the documentation"
workspace = false
command = "cargo"
args = ["run", "-p", "xtask", "--", "lint", "docs"]
[tasks.xtask-lint-aggregators]
description = "Checks that all rx_* creates are part of the aggregators correctly"
workspace = false
command = "cargo"
args = ["run", "-p", "xtask", "--", "lint", "aggregators"]
[tasks.xtask-lint-readme]
description = "Checks that all rx_* creates have their badges set up correctly"
workspace = false
command = "cargo"
args = ["run", "-p", "xtask", "--", "lint", "readme"]
[tasks.xtask-lint-release-plz]
description = "Checks that all rx_* creates are set up for release"
workspace = false
command = "cargo"
args = ["run", "-p", "xtask", "--", "lint", "release-plz"]
### Linting - Lint groups
[tasks.xtask-lint]
description = "Run custom xtask lints"
workspace = false
run_task = { name = [
"xtask-lint-codecov",
"xtask-lint-docs",
"xtask-lint-aggregators",
"xtask-lint-readme",
"xtask-lint-release-plz",
], parallel = true }
[tasks.lint]
description = "Run several linting steps that do not block eachother in parallel"
workspace = false
run_task = { name = [
"format",
"clippy",
"machete",
"xtask-lint",
], parallel = false } # Could be true, but that'd hide the failures
[tasks.lint-ad-hoc]
description = "Runs tasks that are not automatically run for various reasons. This task is mostly here to just highlight them."
workspace = false
dependencies = ["validate-codecov-yml", "audit"]
## Docs
### Docs - mdbook
[tasks.install-mdbook]
description = "Install the mdbook crate for building the documentation"
workspace = false
private = true
dependencies = ["install-mdbook-mermaid", "install-mdbook-crate-links"]
install_crate = { crate_name = "mdbook", binary = "mdbook", test_arg = "--version" }
[tasks.install-mdbook-mermaid]
description = "Install the mdbook-mermaid crate for mermaid support"
workspace = false
private = true
install_crate = { crate_name = "mdbook-mermaid", binary = "mdbook-mermaid", test_arg = "--version" }
[tasks.install-mdbook-crate-links]
description = "Install the mdbook-crate-links preprocessor from the workspace"
workspace = false
private = true
command = "cargo"
args = ["install", "--path", "crates/mdbook_crate_links"]
[tasks.book-build]
description = "Builds the book for the workspace."
workspace = false
dependencies = ["install-mdbook"]
command = "mdbook"
args = ["build"]
[tasks.book]
description = "Serves the book for editing"
workspace = false
dependencies = ["install-mdbook"]
command = "mdbook"
args = ["serve"]
## Miscellaneous
[tasks.install-cargo-expand]
description = "Install the cargo-expand crate for expanding and inspecting proc macros"
workspace = false
private = true
install_crate = { crate_name = "cargo-expand", binary = "cargo-expand", test_arg = "--version" }
install_crate_args = ["--locked"]
[tasks.print-env]
description = "Print the environment"
workspace = false
command = "env"
[tasks.clean]
description = "Cleans the workspace"
workspace = false
command = "cargo"
args = ["clean"]
## Flows
[tasks.setup]
description = "Prepares the workspace for development"
workspace = false
dependencies = [
"install-git-lfs",
"enable-git-hooks",
"install-cocogitto",
"install-koji",
"install-web-support",
"script-link-assets",
"install-nextest",
"install-llvm-cov",
"install-rustfmt",
"install-clippy",
"install-cargo-machete",
"install-cargo-audit",
"install-mdbook",
"install-cargo-expand",
]
[tasks.all]
description = "Run every task"
workspace = false
dependencies = ["lint", "build", "test-coverage", "book-build"]