forked from krakenaut9/windows-drivers-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile.toml
More file actions
155 lines (127 loc) · 4.55 KB
/
Makefile.toml
File metadata and controls
155 lines (127 loc) · 4.55 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
extend = "./crates/wdk-build/rust-driver-makefile.toml"
[config]
min_version = "0.37.16"
additional_profiles = ["all-default-tasks"]
[env]
CARGO_MAKE_SKIP_SLOW_SECONDARY_FLOWS = false
CARGO_MAKE_CARGO_BUILD_TEST_FLAGS = "${CARGO_MAKE_CARGO_ALL_FEATURES}"
CARGO_MAKE_CLIPPY_ARGS = "--all-targets --all-features"
CARGO_MAKE_RUST_DEFAULT_TOOLCHAIN = "stable"
RUSTFLAGS = "-D warnings"
RUSTDOCFLAGS = "-D warnings"
[tasks.wdk-pre-commit-flow]
description = "Run pre-commit tasks and checks"
category = "Development"
workspace = false
dependencies = [
"sort-deps",
"format-flow",
"format-toml-conditioned-flow",
"build",
"package-driver-workspace-flow",
"test-flow",
"clippy-flow",
"audit-flow",
"unused-dependencies-flow",
"docs",
"nightly-test-flow",
"nightly-clippy-flow",
"nightly-docs",
"beta-test-flow",
"beta-clippy-flow",
"beta-docs",
]
[tasks.format]
toolchain = "nightly"
[tasks.package-driver-workspace-flow]
# by forking, a new cargo make invocation starts and by default detects it is a workspace and runs the package-driver task for each member crate
run_task = { name = "package-driver-flow", fork = true }
[tasks.pre-test]
# macrotest and trybuild tests will fail when switching between nightly and stable toolchains due to trybuild/macrotest caching artifacts built with the other toolchain. Deleting the tests directory is enough to purge all test artifacts created by trybuild/macrotest.
script = '''
#!@duckscript
success = rm -r ${CARGO_MAKE_CRATE_CUSTOM_TRIPLE_TARGET_DIRECTORY}/tests
assert ${success} "Failed to delete tests directory"
'''
[tasks.test]
install_crate = { crate_name = "cargo-expand", binary = "cargo", test_arg = [
"expand",
"--version",
], version = "1.0.85" }
[tasks.audit]
args = ["audit", "--deny", "warnings"]
[tasks.unused-dependencies]
workspace = false
condition = { env_true = ["CARGO_MAKE_CRATE_HAS_DEPENDENCIES"] }
args = ["machete", "--skip-target-dir"]
[tasks.nightly-test-flow]
extend = "test-flow"
dependencies = ["pre-nightly-test", "nightly-test", "post-nightly-test"]
[tasks.pre-nightly-test]
alias = "pre-test"
[tasks.nightly-test]
extend = "test"
toolchain = "nightly"
[tasks.post-nightly-test]
extend = "post-test"
[tasks.nightly-clippy-flow]
extend = "clippy-flow"
dependencies = [
"pre-nightly-clippy",
"nightly-clippy-router",
"post-nightly-clippy",
]
[tasks.pre-nightly-clippy]
extend = "pre-clippy"
# Proc-macro crates fail to trigger recompilation when switching toolchains due to bug in rustc resulting in "found invalid metadata files for crate" errors.
run_task = "clean"
[tasks.nightly-clippy-router]
extend = "clippy-router"
env = { CARGO_MAKE_CLIPPY_ARGS = "--features nightly ${CARGO_MAKE_CLIPPY_ARGS}", CARGO_MAKE_RUST_DEFAULT_TOOLCHAIN = "nightly" }
[tasks.post-nightly-clippy]
extend = "post-clippy"
env = { CARGO_MAKE_RUST_DEFAULT_TOOLCHAIN = "${CARGO_MAKE_RUST_DEFAULT_TOOLCHAIN}" }
[tasks.nightly-docs]
extend = "docs"
toolchain = "nightly"
args = ["doc", "--no-deps", "--features", "nightly"]
[tasks.beta-test-flow]
extend = "test-flow"
dependencies = ["pre-beta-test", "beta-test", "post-beta-test"]
[tasks.pre-beta-test]
alias = "pre-test"
[tasks.beta-test]
extend = "test"
toolchain = "beta"
[tasks.post-beta-test]
alias = "post-test"
[tasks.beta-clippy-flow]
extend = "clippy-flow"
dependencies = ["pre-beta-clippy", "beta-clippy-router", "post-beta-clippy"]
[tasks.pre-beta-clippy]
extend = "pre-clippy"
# Proc-macro crates fail to trigger recompilation when switching toolchains due to bug in rustc resulting in "found invalid metadata files for crate" errors.
run_task = "clean"
[tasks.beta-clippy-router]
extend = "clippy-router"
env = { CARGO_MAKE_RUST_DEFAULT_TOOLCHAIN = "beta" }
[tasks.post-beta-clippy]
extend = "post-clippy"
env = { CARGO_MAKE_RUST_DEFAULT_TOOLCHAIN = "${CARGO_MAKE_RUST_DEFAULT_TOOLCHAIN}" }
[tasks.beta-docs]
extend = "docs"
toolchain = "beta"
[tasks.sort-deps]
workspace = false # Run only at workspace level
# Installing cargo-sort from main branch since there is an unreleased fix
# Ref: https://github.com/DevinR528/cargo-sort/issues/67#issuecomment-2486868511
# Locking down to a specific commit (20th May 2025) until a new stable release is cut out on cargo-sort
install_script = "cargo install --git=https://github.com/DevinR528/cargo-sort cargo-sort --branch main --rev 4a1ecf093649b87fa610aec32a1bdaa4829d416b --locked --force"
description = "Sort dependencies in Cargo.toml using cargo-sort"
command = "cargo"
args = [
"sort",
"-w",
"-g",
"-n",
] # -w for every crate in workspace, -g for keeping blank lines when sorting groups of deps, -n do not run formatting