Replace 'project' with 'package' in many strings and comments.

This commit is contained in:
Zach Lute 2018-09-20 23:47:09 -07:00
parent 57ac39287b
commit 3492a3905c
36 changed files with 86 additions and 86 deletions

View File

@ -178,18 +178,18 @@ OPTIONS:
{unified}
Some common cargo commands are (see all commands with --list):
build Compile the current project
check Analyze the current project and report errors, but don't build object files
build Compile the current package
check Analyze the current package and report errors, but don't build object files
clean Remove the target directory
doc Build this project's and its dependencies' documentation
new Create a new cargo project
init Create a new cargo project in an existing directory
doc Build this package's and its dependencies' documentation
new Create a new cargo package
init Create a new cargo package in an existing directory
run Build and execute src/main.rs
test Run the tests
bench Run the benchmarks
update Update dependencies listed in Cargo.lock
search Search registry for crates
publish Package and upload this project to the registry
publish Package and upload this package to the registry
install Install a Rust binary
uninstall Uninstall a Rust binary

View File

@ -4,7 +4,7 @@ use cargo::ops;
pub fn cli() -> App {
subcommand("generate-lockfile")
.about("Generate the lockfile for a project")
.about("Generate the lockfile for a package")
.arg_manifest_path()
}

View File

@ -14,6 +14,6 @@ pub fn exec(config: &mut Config, args: &ArgMatches) -> CliResult {
ops::init(&opts, config)?;
config
.shell()
.status("Created", format!("{} project", opts.kind))?;
.status("Created", format!("{} package", opts.kind))?;
Ok(())
}

View File

@ -19,7 +19,7 @@ pub fn exec(config: &mut Config, args: &ArgMatches) -> CliResult {
let root = root.to_str()
.ok_or_else(|| {
format_err!(
"your project path contains characters \
"your package path contains characters \
not representable in Unicode"
)
})

View File

@ -6,7 +6,7 @@ use cargo::print_json;
pub fn cli() -> App {
subcommand("metadata")
.about(
"Output the resolved dependencies of a project, \
"Output the resolved dependencies of a package, \
the concrete used versions including overrides, \
in machine-readable format",
)

View File

@ -14,13 +14,13 @@ pub fn exec(config: &mut Config, args: &ArgMatches) -> CliResult {
ops::new(&opts, config)?;
let path = args.value_of("path").unwrap();
let project_name = if let Some(name) = args.value_of("name") {
let package_name = if let Some(name) = args.value_of("name") {
name
} else {
path
};
config
.shell()
.status("Created", format!("{} `{}` project", opts.kind, project_name))?;
.status("Created", format!("{} `{}` package", opts.kind, package_name))?;
Ok(())
}

View File

@ -23,7 +23,7 @@ pub fn cli() -> App {
.arg_message_format()
.after_help(
"\
If neither `--bin` nor `--example` are given, then if the project only has one
If neither `--bin` nor `--example` are given, then if the package only has one
bin target it will be run. Otherwise `--bin` specifies the bin target to run,
and `--example` specifies the example target to run. At most one of `--bin` or
`--example` can be provided.

View File

@ -1,4 +1,4 @@
//! A graph-like structure used to represent the rustc commands to build the project and the
//! A graph-like structure used to represent the rustc commands to build the package and the
//! interdependencies between them.
//!
//! The BuildPlan structure is used to store the dependency graph of a dry run so that it can be

View File

@ -31,8 +31,8 @@ use self::compilation_files::CompilationFiles;
/// All information needed to define a Unit.
///
/// A unit is an object that has enough information so that cargo knows how to build it.
/// For example, if your project has dependencies, then every dependency will be built as a library
/// unit. If your project is a library, then it will be built as a library unit as well, or if it
/// For example, if your package has dependencies, then every dependency will be built as a library
/// unit. If your package is a library, then it will be built as a library unit as well, or if it
/// is a binary with `main.rs`, then a binary will be output. There are also separate unit types
/// for `test`ing and `check`ing, amongst others.
///
@ -462,7 +462,7 @@ impl<'a, 'cfg> Context<'a, 'cfg> {
// `CARGO_INCREMENTAL`.
// * `profile.dev.incremental` - in `Cargo.toml` specific profiles can
// be configured to enable/disable incremental compilation. This can
// be primarily used to disable incremental when buggy for a project.
// be primarily used to disable incremental when buggy for a package.
// * Finally, each profile has a default for whether it will enable
// incremental compilation or not. Primarily development profiles
// have it enabled by default while release profiles have it disabled

View File

@ -220,7 +220,7 @@ impl<'a> JobQueue<'a> {
// maximum number of parallel jobs we have tokens for). A local queue
// is maintained separately from the main dependency queue as one
// dequeue may actually dequeue quite a bit of work (e.g. 10 binaries
// in one project).
// in one package).
//
// After a job has finished we update our internal state if it was
// successful and otherwise wait for pending work to finish if it failed

View File

@ -658,8 +658,8 @@ fn rustdoc<'a, 'cfg>(cx: &mut Context<'a, 'cfg>, unit: &Unit<'a>) -> CargoResult
// actually invoke rustc.
//
// In general users don't expect `cargo build` to cause rebuilds if you change
// directories. That could be if you just change directories in the project or
// if you literally move the whole project wholesale to a new directory. As a
// directories. That could be if you just change directories in the package or
// if you literally move the whole package wholesale to a new directory. As a
// result we mostly don't factor in `cwd` to this calculation. Instead we try to
// track the workspace as much as possible and we update the current directory
// of rustc/rustdoc where appropriate.

View File

@ -389,9 +389,9 @@ impl<'cfg> Workspace<'cfg> {
}
// Don't walk across `CARGO_HOME` when we're looking for the
// workspace root. Sometimes a project will be organized with
// workspace root. Sometimes a package will be organized with
// `CARGO_HOME` pointing inside of the workspace root or in the
// current project, but we don't want to mistakenly try to put
// current package, but we don't want to mistakenly try to put
// crates.io crates into the workspace by accident.
if self.config.home() == path {
break;

View File

@ -215,7 +215,7 @@ pub fn version() -> VersionInfo {
// There are two versions at play here:
// - version of cargo-the-binary, which you see when you type `cargo --version`
// - version of cargo-the-library, which you download from crates.io for use
// in your projects.
// in your packages.
//
// We want to make the `binary` version the same as the corresponding Rust/rustc release.
// At the same time, we want to keep the library version at `0.x`, because Cargo as

View File

@ -22,7 +22,7 @@ pub struct CleanOptions<'a> {
pub doc: bool,
}
/// Cleans the project from build artifacts.
/// Cleans the package's build artifacts.
pub fn clean(ws: &Workspace, opts: &CleanOptions) -> CargoResult<()> {
let target_dir = ws.target_dir();
let config = ws.config();

View File

@ -229,13 +229,13 @@ fn install_one(
match pkg.manifest().edition() {
Edition::Edition2015 => config.shell().warn(
"Using `cargo install` to install the binaries for the \
project in current working directory is deprecated, \
package in current working directory is deprecated, \
use `cargo install --path .` instead. \
Use `cargo build` if you want to simply build the package.",
)?,
Edition::Edition2018 => bail!(
"Using `cargo install` to install the binaries for the \
project in current working directory is no longer supported, \
package in current working directory is no longer supported, \
use `cargo install --path .` instead. \
Use `cargo build` if you want to simply build the package."
),

View File

@ -27,7 +27,7 @@ pub enum VersionControl {
pub struct NewOptions {
pub version_control: Option<VersionControl>,
pub kind: NewProjectKind,
/// Absolute path to the directory for the new project
/// Absolute path to the directory for the new package
pub path: PathBuf,
pub name: Option<String>,
pub edition: Option<String>,
@ -109,14 +109,14 @@ fn get_name<'a>(path: &'a Path, opts: &'a NewOptions) -> CargoResult<&'a str> {
let file_name = path.file_name().ok_or_else(|| {
format_err!(
"cannot auto-detect project name from path {:?} ; use --name to override",
"cannot auto-detect package name from path {:?} ; use --name to override",
path.as_os_str()
)
})?;
file_name.to_str().ok_or_else(|| {
format_err!(
"cannot create project with a non-unicode name: {:?}",
"cannot create package with a non-unicode name: {:?}",
file_name
)
})
@ -174,12 +174,12 @@ fn check_name(name: &str, opts: &NewOptions) -> CargoResult<()> {
}
fn detect_source_paths_and_types(
project_path: &Path,
project_name: &str,
package_path: &Path,
package_name: &str,
detected_files: &mut Vec<SourceFileInformation>,
) -> CargoResult<()> {
let path = project_path;
let name = project_name;
let path = package_path;
let name = package_name;
enum H {
Bin,
@ -233,12 +233,12 @@ fn detect_source_paths_and_types(
let sfi = match i.handling {
H::Bin => SourceFileInformation {
relative_path: pp,
target_name: project_name.to_string(),
target_name: package_name.to_string(),
bin: true,
},
H::Lib => SourceFileInformation {
relative_path: pp,
target_name: project_name.to_string(),
target_name: package_name.to_string(),
bin: false,
},
H::Detect => {
@ -246,7 +246,7 @@ fn detect_source_paths_and_types(
let isbin = content.contains("fn main");
SourceFileInformation {
relative_path: pp,
target_name: project_name.to_string(),
target_name: package_name.to_string(),
bin: isbin,
}
}
@ -276,7 +276,7 @@ cannot automatically generate Cargo.toml as the main target would be ambiguous",
} else {
if let Some(plp) = previous_lib_relpath {
bail!(
"cannot have a project with \
"cannot have a package with \
multiple libraries, \
found both `{}` and `{}`",
plp,
@ -290,17 +290,17 @@ cannot automatically generate Cargo.toml as the main target would be ambiguous",
Ok(())
}
fn plan_new_source_file(bin: bool, project_name: String) -> SourceFileInformation {
fn plan_new_source_file(bin: bool, package_name: String) -> SourceFileInformation {
if bin {
SourceFileInformation {
relative_path: "src/main.rs".to_string(),
target_name: project_name,
target_name: package_name,
bin: true,
}
} else {
SourceFileInformation {
relative_path: "src/lib.rs".to_string(),
target_name: project_name,
target_name: package_name,
bin: false,
}
}
@ -330,7 +330,7 @@ pub fn new(opts: &NewOptions, config: &Config) -> CargoResult<()> {
mk(config, &mkopts).chain_err(|| {
format_err!(
"Failed to create project `{}` at `{}`",
"Failed to create package `{}` at `{}`",
name,
path.display()
)
@ -342,7 +342,7 @@ pub fn init(opts: &NewOptions, config: &Config) -> CargoResult<()> {
let path = &opts.path;
if fs::metadata(&path.join("Cargo.toml")).is_ok() {
bail!("`cargo init` cannot be run on existing Cargo projects")
bail!("`cargo init` cannot be run on existing Cargo packages")
}
let name = get_name(path, opts)?;
@ -356,7 +356,7 @@ pub fn init(opts: &NewOptions, config: &Config) -> CargoResult<()> {
src_paths_types.push(plan_new_source_file(opts.kind.is_bin(), name.to_string()));
} else {
// --bin option may be ignored if lib.rs or src/lib.rs present
// Maybe when doing `cargo init --bin` inside a library project stub,
// Maybe when doing `cargo init --bin` inside a library package stub,
// user may mean "initialize for library, but also add binary target"
}
@ -407,7 +407,7 @@ pub fn init(opts: &NewOptions, config: &Config) -> CargoResult<()> {
mk(config, &mkopts).chain_err(|| {
format_err!(
"Failed to create project `{}` at `{}`",
"Failed to create package `{}` at `{}`",
name,
path.display()
)

View File

@ -17,7 +17,7 @@ pub struct OutputMetadataOptions {
pub version: u32,
}
/// Loads the manifest, resolves the dependencies of the project to the concrete
/// Loads the manifest, resolves the dependencies of the package to the concrete
/// used versions - considering overrides - and writes all dependencies in a JSON
/// format to stdout.
pub fn output_metadata(ws: &Workspace, opt: &OutputMetadataOptions) -> CargoResult<ExportInfo> {

View File

@ -61,7 +61,7 @@ pub fn run(
)
} else {
bail!(
"`cargo run` requires that a project only have one \
"`cargo run` requires that a package only have one \
executable; use the `--bin` option to specify which one \
to run\navailable binaries: {}",
names.join(", ")

View File

@ -69,7 +69,7 @@ fn compile_tests<'a>(
Ok(compilation)
}
/// Run the unit and integration tests of a project.
/// Run the unit and integration tests of a package.
fn run_unit_tests(
options: &TestOptions,
test_args: &[String],

View File

@ -85,7 +85,7 @@ fn check_version_control(opts: &FixOptions) -> CargoResult<()> {
}
let config = opts.compile_opts.config;
if !existing_vcs_repo(config.cwd(), config.cwd()) {
bail!("no VCS found for this project and `cargo fix` can potentially \
bail!("no VCS found for this package and `cargo fix` can potentially \
perform destructive changes; if you'd like to suppress this \
error pass `--allow-no-vcs`")
}
@ -137,7 +137,7 @@ fn check_version_control(opts: &FixOptions) -> CargoResult<()> {
files_list.push_str(" (staged)\n");
}
bail!("the working directory of this project has uncommitted changes, and \
bail!("the working directory of this package has uncommitted changes, and \
`cargo fix` can potentially perform destructive changes; if you'd \
like to suppress this error pass `--allow-dirty`, `--allow-staged`, \
or commit the changes to these files:\n\

View File

@ -7,7 +7,7 @@ use util::{process, CargoResult};
// Check if we are in an existing repo. We define that to be true if either:
//
// 1. We are in a git repo and the path to the new project is not an ignored
// 1. We are in a git repo and the path to the new package is not an ignored
// path in that repo.
// 2. We are in an HG repo.
pub fn existing_vcs_repo(path: &Path, cwd: &Path) -> bool {

View File

@ -426,20 +426,20 @@ esac
_cargo_cmds(){
local -a commands;commands=(
'bench:execute all benchmarks of a local package'
'build:compile the current project'
'check:check the current project without compiling'
'build:compile the current package'
'check:check the current package without compiling'
'clean:remove generated artifacts'
'doc:build package documentation'
'fetch:fetch package dependencies'
'generate-lockfile:create lockfile'
'git-checkout:git checkout'
'help:get help for commands'
'init:create new project in current directory'
'init:create new package in current directory'
'install:install a Rust binary'
'locate-project:print "Cargo.toml" location'
'login:login to remote server'
'metadata:the metadata for a project in json'
'new:create a new project'
'metadata:the metadata for a package in json'
'new:create a new package'
'owner:manage the owners of a crate on the registry'
'package:assemble local package into a distributable tarball'
'pkgid:print a fully qualified package specification'

View File

@ -2,7 +2,7 @@
.hy
.SH NAME
.PP
cargo\-build \- Compile the current project
cargo\-build \- Compile the current package
.SH SYNOPSIS
.PP
\f[I]cargo build\f[] [OPTIONS]

View File

@ -2,7 +2,7 @@
.hy
.SH NAME
.PP
cargo\-check \- Check the current project
cargo\-check \- Check the current package
.SH SYNOPSIS
.PP
\f[I]cargo check\f[] [OPTIONS]

View File

@ -2,7 +2,7 @@
.hy
.SH NAME
.PP
cargo\-generate-lockfile \- Generate the lockfile for a project
cargo\-generate-lockfile \- Generate the lockfile for a package
.SH SYNOPSIS
.PP
\f[I]cargo generate-lockfile\f[] [OPTIONS]

View File

@ -2,13 +2,13 @@
.hy
.SH NAME
.PP
cargo\-metadata \- Machine-readable metadata about the current project
cargo\-metadata \- Machine-readable metadata about the current package
.SH SYNOPSIS
.PP
\f[I]cargo metadata\f[] [OPTIONS]
.SH DESCRIPTION
.PP
Output the resolved dependencies of a project, the concrete used versions
Output the resolved dependencies of a package, the concrete used versions
including overrides, in machine-readable format.
.SH OPTIONS
.TP

View File

@ -2,7 +2,7 @@
.hy
.SH NAME
.PP
cargo\-run \- Run the current project
cargo\-run \- Run the current package
.SH SYNOPSIS
.PP
\f[I]cargo run\f[] [OPTIONS] [\-\-] [<ARGS>...]
@ -11,7 +11,7 @@ cargo\-run \- Run the current project
Run the main binary of the local package (src/main.rs).
.PP
If neither \f[B]\-\-bin\f[] nor \f[B]\-\-example\f[] are given, then if
the project only has one bin target it will be run.
the package only has one bin target it will be run.
Otherwise \f[B]\-\-bin\f[] specifies the bin target to run, and
\f[B]\-\-example\f[] specifies the example target to run.
At most one of \f[B]\-\-bin\f[] or \f[B]\-\-example\f[] can be provided.

View File

@ -47,7 +47,7 @@ To get extended information about commands, run \f[I]cargo help
<command>\f[] or \f[I]man cargo\-command\f[]
.TP
.B cargo\-build(1)
Compile the current project.
Compile the current package.
.RS
.RE
.TP
@ -57,12 +57,12 @@ Remove the target directory with build output.
.RE
.TP
.B cargo\-doc(1)
Build this project\[aq]s and its dependencies\[aq] documentation.
Build this package\[aq]s and its dependencies\[aq] documentation.
.RS
.RE
.TP
.B cargo\-init(1)
Create a new cargo project in the current directory.
Create a new cargo package in the current directory.
.RS
.RE
.TP
@ -72,7 +72,7 @@ Install a Rust binary.
.RE
.TP
.B cargo\-new(1)
Create a new cargo project.
Create a new cargo package.
.RS
.RE
.TP
@ -97,7 +97,7 @@ Update dependencies in Cargo.lock.
.RE
.TP
.B cargo\-rustc(1)
Compile the current project, and optionally pass additional rustc parameters
Compile the current package, and optionally pass additional rustc parameters
.RS
.RE
.TP
@ -107,7 +107,7 @@ Generate a source tarball for the current package.
.RE
.TP
.B cargo\-publish(1)
Package and upload this project to the registry.
Package and upload this package to the registry.
.RS
.RE
.TP
@ -170,7 +170,7 @@ $\ cargo\ test\ \-\-target\ i686\-unknown\-linux\-gnu
\f[]
.fi
.PP
Create a new project that builds an executable
Create a new package that builds an executable
.IP
.nf
\f[C]
@ -178,7 +178,7 @@ $\ cargo\ new\ \-\-bin\ foobar
\f[]
.fi
.PP
Create a project in the current directory
Create a package in the current directory
.IP
.nf
\f[C]

View File

@ -93,7 +93,7 @@ fn bad4() {
.with_status(101)
.with_stderr(
"\
[ERROR] Failed to create project `foo` at `[..]`
[ERROR] Failed to create package `foo` at `[..]`
Caused by:
error in [..]config: `cargo-new.name` expected a string, but found a boolean

View File

@ -697,7 +697,7 @@ fn warns_if_no_vcs_detected() {
.with_status(101)
.with_stderr(
"\
error: no VCS found for this project and `cargo fix` can potentially perform \
error: no VCS found for this package and `cargo fix` can potentially perform \
destructive changes; if you'd like to suppress this error pass `--allow-no-vcs`\
",
).run();
@ -721,7 +721,7 @@ fn warns_about_dirty_working_directory() {
.with_status(101)
.with_stderr(
"\
error: the working directory of this project has uncommitted changes, \
error: the working directory of this package has uncommitted changes, \
and `cargo fix` can potentially perform destructive changes; if you'd \
like to suppress this error pass `--allow-dirty`, `--allow-staged`, or \
commit the changes to these files:
@ -755,7 +755,7 @@ fn warns_about_staged_working_directory() {
.with_status(101)
.with_stderr(
"\
error: the working directory of this project has uncommitted changes, \
error: the working directory of this package has uncommitted changes, \
and `cargo fix` can potentially perform destructive changes; if you'd \
like to suppress this error pass `--allow-dirty`, `--allow-staged`, or \
commit the changes to these files:

View File

@ -15,7 +15,7 @@ fn cargo_process(s: &str) -> Execs {
fn simple_lib() {
cargo_process("init --lib --vcs none --edition 2015")
.env("USER", "foo")
.with_stderr("[CREATED] library project")
.with_stderr("[CREATED] library package")
.run();
assert!(paths::root().join("Cargo.toml").is_file());
@ -32,7 +32,7 @@ fn simple_bin() {
cargo_process("init --bin --vcs none --edition 2015")
.env("USER", "foo")
.cwd(&path)
.with_stderr("[CREATED] binary (application) project")
.with_stderr("[CREATED] binary (application) package")
.run();
assert!(paths::root().join("foo/Cargo.toml").is_file());
@ -146,7 +146,7 @@ fn confused_by_multiple_lib_files() {
.unwrap();
cargo_process("init --vcs none").env("USER", "foo").cwd(&path).with_status(101).with_stderr(
"[ERROR] cannot have a project with multiple libraries, found both `src/lib.rs` and `lib.rs`",
"[ERROR] cannot have a package with multiple libraries, found both `src/lib.rs` and `lib.rs`",
)
.run();

View File

@ -698,7 +698,7 @@ fn installs_from_cwd_by_default() {
p.cargo("install")
.with_stderr_contains(
"warning: Using `cargo install` to install the binaries for the \
project in current working directory is deprecated, \
package in current working directory is deprecated, \
use `cargo install --path .` instead. \
Use `cargo build` if you want to simply build the package.",
).run();
@ -732,7 +732,7 @@ fn installs_from_cwd_with_2018_warnings() {
.with_status(101)
.with_stderr_contains(
"error: Using `cargo install` to install the binaries for the \
project in current working directory is no longer supported, \
package in current working directory is no longer supported, \
use `cargo install --path .` instead. \
Use `cargo build` if you want to simply build the package.",
).run();

View File

@ -16,7 +16,7 @@ fn create_empty_gitconfig() {
fn simple_lib() {
cargo_process("new --lib foo --vcs none --edition 2015")
.env("USER", "foo")
.with_stderr("[CREATED] library `foo` project")
.with_stderr("[CREATED] library `foo` package")
.run();
assert!(paths::root().join("foo").is_dir());
@ -49,7 +49,7 @@ mod tests {
fn simple_bin() {
cargo_process("new --bin foo --edition 2015")
.env("USER", "foo")
.with_stderr("[CREATED] binary (application) `foo` project")
.with_stderr("[CREATED] binary (application) `foo` package")
.run();
assert!(paths::root().join("foo").is_dir());
@ -452,7 +452,7 @@ fn explicit_invalid_name_not_suggested() {
fn explicit_project_name() {
cargo_process("new --lib foo --name bar")
.env("USER", "foo")
.with_stderr("[CREATED] library `bar` project")
.with_stderr("[CREATED] library `bar` package")
.run();
}

View File

@ -1092,7 +1092,7 @@ fn run_default_multiple_required_features() {
.with_status(101)
.with_stderr(
"\
error: `cargo run` requires that a project only have one executable; \
error: `cargo run` requires that a package only have one executable; \
use the `--bin` option to specify which one to run\navailable binaries: foo1, foo2",
).run();
}

View File

@ -141,7 +141,7 @@ fn too_many_bins() {
p.cargo("run")
.with_status(101)
.with_stderr(
"[ERROR] `cargo run` requires that a project only \
"[ERROR] `cargo run` requires that a package only \
have one executable; use the `--bin` option \
to specify which one to run\navailable binaries: [..]\n",
).run();
@ -990,7 +990,7 @@ fn run_workspace() {
.with_status(101)
.with_stderr(
"\
[ERROR] `cargo run` requires that a project only have one executable[..]
[ERROR] `cargo run` requires that a package only have one executable[..]
available binaries: a, b",
).run();
p.cargo("run --bin a")

View File

@ -920,7 +920,7 @@ workspace: [..]
this may be fixable by ensuring that this crate is depended on by the workspace \
root: [..]
[CREATED] library `bar` project
[CREATED] library `bar` package
",
).run();
}