Skip to content

Commit aa17ae3

Browse files
committed
Adds support for packaging workspaces.
Takes local dependencies into account when packaging a workspace. Builds a temporary package registry to provide local dependencies, and overlays it on the upstream registry.
1 parent 2fed360 commit aa17ae3

File tree

7 files changed

+534
-115
lines changed

7 files changed

+534
-115
lines changed

src/bin/cargo/commands/package.rs

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ use cargo::ops::{self, PackageOpts};
55
pub fn cli() -> Command {
66
subcommand("package")
77
.about("Assemble the local package into a distributable tarball")
8+
.arg_index("Registry index URL to prepare the package for")
9+
.arg_registry("Registry to prepare the package for")
810
.arg(
911
flag(
1012
"list",
@@ -41,6 +43,7 @@ pub fn cli() -> Command {
4143
}
4244

4345
pub fn exec(gctx: &mut GlobalContext, args: &ArgMatches) -> CliResult {
46+
let reg_or_index = args.registry_or_index(gctx)?;
4447
let ws = args.workspace(gctx)?;
4548
if ws.root_maybe().is_embedded() {
4649
return Err(anyhow::format_err!(
@@ -64,6 +67,7 @@ pub fn exec(gctx: &mut GlobalContext, args: &ArgMatches) -> CliResult {
6467
jobs: args.jobs()?,
6568
keep_going: args.keep_going(),
6669
cli_features: args.cli_features()?,
70+
reg_or_index,
6771
},
6872
)?;
6973

0 commit comments

Comments
 (0)