forked from microsoft/windows-drivers-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.toml
140 lines (113 loc) · 3.87 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
133
134
135
136
137
138
139
140
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_CLIPPY_ARGS = "--all-targets -- -D warnings"
RUSTFLAGS = "-D warnings"
CARGO_MAKE_RUST_DEFAULT_TOOLCHAIN = "stable"
RUSTDOCFLAGS = "-D warnings"
[tasks.wdk-pre-commit-flow]
description = "Run pre-commit tasks and checks"
category = "Development"
workspace = false
dependencies = [
"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"
env = { CARGO_MAKE_CARGO_BUILD_TEST_FLAGS = "--features nightly" }
toolchain = "nightly"
[tasks.post-nightly-test]
extend = "post-test"
env = { CARGO_MAKE_CARGO_BUILD_TEST_FLAGS = { unset = true } }
[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"