-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.toml
132 lines (112 loc) · 3.44 KB
/
Makefile.toml
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
[config]
default_to_workspace = false
skip_core_tasks = true
[tasks.format]
ignore_errors = true
command = "cargo"
args = ["fmt"]
[tasks.clean]
command = "cargo"
args = ["clean"]
[tasks.check]
dependencies = ["format", "lint", "build", "test"]
[tasks.build]
command = "cargo"
args = ["build", "--workspace", "${@}"]
[tasks.lint]
command = "cargo"
args = ["clippy", "--tests", "--workspace", "${@}", "--", "-D", "warnings"]
[tasks.doc]
env = { RUSTDOCFLAGS = "--cfg docsrs -D warnings" }
toolchain = "nightly"
command = "cargo"
args = ["doc", "--workspace", "--no-deps"]
[tasks.test]
dependencies = ["test-lib", "test-doc"]
[tasks.test-lib]
command = "cargo"
args = ["nextest", "run", "--workspace", "${@}"]
[tasks.test-doc]
command = "cargo"
args = ["test", "--doc", "--workspace", "${@}"]
[tasks.miri]
env = { MIRIFLAGS = "-Zmiri-disable-isolation", CARGO_TOOLCHAIN = { value = "nightly", condition = { env_not_set = ["CARGO_TOOLCHAIN"] } } }
toolchain = "${CARGO_TOOLCHAIN}"
command = "cargo"
args = ["miri", "nextest", "run", "unsafe"]
[tasks.run]
run_task = [{ name = "run-debug", condition = { profiles = ["debug"] } }, { name = "run-release" }]
[tasks.run-release]
command = "cargo"
args = ["run", "--bin", "${@}", "--no-default-features", "--features", "${@}", "--release"]
[tasks.run-debug]
command = "cargo"
args = ["run", "--bin", "${@}", "--no-default-features", "--features", "${@}"]
[tasks.cov]
dependencies = ["cov-build", "cov-test", "cov-grcov", "cov-cleanup"]
[tasks.cov-build]
env = { RUSTFLAGS = "-Cinstrument-coverage", LLVM_PROFILE_FILE = "${CARGO_MAKE_WORKING_DIRECTORY}/%m-%p.profraw" }
command = "cargo"
args = ["build", "--features", 'remote', "--features", "async", "--workspace", "--exclude", "autd3-examples"]
[tasks.cov-test]
env = { RUSTFLAGS = "-Cinstrument-coverage", LLVM_PROFILE_FILE = "${CARGO_MAKE_WORKING_DIRECTORY}/%m-%p.profraw" }
command = "cargo"
args = ["test", "--features", 'remote', "--features", "async", "--workspace", "--exclude", "autd3-examples"]
[tasks.cov-grcov]
command = "grcov"
args = [
".",
"-s",
".",
"--binary-path",
"./target/debug",
"--llvm",
"--branch",
"--ignore-not-existing",
"-o",
"./coverage",
"-t",
"${@}",
"--excl-line",
"GRCOV_EXCL_LINE|^\\s*\\.await\\??[,;]?$|#\\[derive|#\\[error|#\\[bitfield_struct|unreachable!|unimplemented!|tracing::(debug|trace|info|warn|error)!\\([\\s\\S]*\\);",
"--keep-only",
"autd3/src/**/*.rs",
"--keep-only",
"autd3-core/src/**/*.rs",
"--keep-only",
"autd3-driver/src/**/*.rs",
"--keep-only",
"autd3-firmware-emulator/src/**/*.rs",
"--keep-only",
"autd3-gain-holo/src/**/*.rs",
"--keep-only",
"autd3-modulation-audio-file/src/**/*.rs",
"--keep-only",
"autd3-protobuf/src/**/*.rs",
"--ignore",
"autd3-protobuf/src/pb/*.rs",
"--excl-start",
"GRCOV_EXCL_START",
"--excl-stop",
"GRCOV_EXCL_STOP",
]
[tasks.cov-cleanup]
ignore_errors = true
script_runner = "@shell"
script = '''
rm ./*.profraw
'''
[tasks.update-version]
script_runner = "python"
script_extension = "py"
script = '''
import sys
import re
from pathlib import Path
version = sys.argv[1]
file = Path("Cargo.toml")
content = file.read_text(encoding="utf-8")
content = re.sub(r'^version = "(.*?)"', f'version = "{version}"', content, flags=re.MULTILINE)
content = re.sub(r'^autd3(.*)version = "(.*?)"', f'autd3\\1version = "{version}"', content, flags=re.MULTILINE)
file.write_text(content, encoding="utf-8")
'''