Skip to content

Commit

Permalink
Adds support for packaging workspaces.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jneem committed Jun 13, 2024
1 parent 2fed360 commit aa17ae3
Show file tree
Hide file tree
Showing 7 changed files with 534 additions and 115 deletions.
4 changes: 4 additions & 0 deletions src/bin/cargo/commands/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ use cargo::ops::{self, PackageOpts};
pub fn cli() -> Command {
subcommand("package")
.about("Assemble the local package into a distributable tarball")
.arg_index("Registry index URL to prepare the package for")
.arg_registry("Registry to prepare the package for")
.arg(
flag(
"list",
Expand Down Expand Up @@ -41,6 +43,7 @@ pub fn cli() -> Command {
}

pub fn exec(gctx: &mut GlobalContext, args: &ArgMatches) -> CliResult {
let reg_or_index = args.registry_or_index(gctx)?;
let ws = args.workspace(gctx)?;
if ws.root_maybe().is_embedded() {
return Err(anyhow::format_err!(
Expand All @@ -64,6 +67,7 @@ pub fn exec(gctx: &mut GlobalContext, args: &ArgMatches) -> CliResult {
jobs: args.jobs()?,
keep_going: args.keep_going(),
cli_features: args.cli_features()?,
reg_or_index,
},
)?;

Expand Down
Loading

0 comments on commit aa17ae3

Please sign in to comment.