Skip to content

Commit 37a7ed8

Browse files
committed
Only define a single context
1 parent 6097d07 commit 37a7ed8

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

text/0000-erfc-post-build-contexts.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,9 @@ that may use the same attributes. (We could change this by asking
152152
attributes to be registered in Cargo.toml, but we don't find this
153153
necessary)
154154

155+
156+
A crate may only define a single post-build context.
157+
155158
## Cargo integration
156159

157160
Alternative post-build contexts need to integrate with cargo.
@@ -191,23 +194,22 @@ contexts are defined:
191194

192195
```toml
193196
[post-build.context.test]
194-
provider = { test = "1.0", context = "test" }
197+
provider = { test = "1.0" }
195198
folders = ["tests/"]
196199

197200
[post-build.context.bench]
198-
provider = { test = "1.0", context = "bench" }
199-
folders = ["benchmarks/"]
201+
provider = { ?? = "1.0" }
202+
folders = ["benches/"]
203+
204+
[post-build.context.examples]
205+
provider = { ?? = "1.0" }
206+
folders = ["examples/"]
200207
```
201208

202209
There's also an `example` context defined that just runs the `main()` of
203210
any files given.
204211

205-
These can be overridden by a crate's `Cargo.toml`. The `context`
206-
property is used to disambiguate when a single crate has multiple
207-
functions tagged `#[post_build_context]` (if we were using the example
208-
post-build context further up as a provider, we'd give `mytest` here).
209-
`test` here is `libtest`, though note that it could be maintained
210-
out-of-tree, and shipped with rustup.
212+
These can be overridden by a crate's `Cargo.toml`.
211213

212214
To invoke a particular post-build context, a user invokes `cargo context
213215
<context>`. `cargo test` and `cargo bench` are aliases for `cargo

0 commit comments

Comments
 (0)