-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add default member description in virtual workspace
- Loading branch information
Showing
1 changed file
with
10 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,16 +39,15 @@ To create a workspace, you add the `[workspace]` table to a `Cargo.toml`: | |
# ... | ||
``` | ||
|
||
The directory where the workspace's Cargo.toml is located then becomes so-called the workspace root. | ||
|
||
At minimum, a workspace has to have a member, either with a root package or as | ||
a virtual manifest. | ||
|
||
### Root package | ||
|
||
If the [`[workspace]` section](#the-workspace-section) is added to a | ||
`Cargo.toml` that already defines a `[package]`, the package is | ||
the *root package* of the workspace. | ||
the *root package* of the workspace. The *workspace root* is the directory | ||
where the workspace's `Cargo.toml` is located. | ||
|
||
Example: | ||
```toml | ||
|
@@ -60,12 +59,13 @@ version = "0.1.0" # the current version, obeying semver | |
authors = ["Alice <[email protected]>", "Bob <[email protected]>"] | ||
``` | ||
|
||
Under [workspace](#the-workspace-section), you can specify which members the workspace has through | ||
[workspace.members filed](#the-members-and-exclude-fields) . | ||
In the [worksapce section](#the-workspace-section), you can specify the members of | ||
the workspace by [workspace.members filed](#the-members-and-exclude-fields). | ||
|
||
If no other members are specified in [workspace.members filed](#the-members-and-exclude-fields) | ||
in `Cargo.toml` in the workspace root directory, the root package will | ||
become the default workspace member. | ||
become the default workspace member. In addition, you can also specify the default | ||
workspace members through [workspace.default-members](#the-default-members-field). | ||
|
||
### Virtual workspace | ||
|
||
|
@@ -90,6 +90,10 @@ edition = "2021" # the edition, will have no effect on a resolver used in th | |
authors = ["Alice <[email protected]>", "Bob <[email protected]>"] | ||
``` | ||
|
||
In a virtual workspace, at least one member needed be included and if | ||
[workspace.default-member](#the-default-members-field) is empty, all members of | ||
the workspace are default members. | ||
|
||
Note that in a virtual manifest the [`resolver = "2"`](resolver.md#resolver-versions) | ||
should be specified manually. It is usually deduced from the [`package.edition`][package-edition] | ||
field which is absent in virtual manifests and the edition field of a member | ||
|