From 68ed15490146135778737c155364a58cb4ad52b0 Mon Sep 17 00:00:00 2001 From: Martijn Date: Mon, 14 Oct 2024 12:54:03 +0200 Subject: [PATCH] Add metadata to environment context --- src/context.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/context.rs b/src/context.rs index ed06778f..ea9e495b 100644 --- a/src/context.rs +++ b/src/context.rs @@ -241,6 +241,9 @@ pub struct EnvironmentContext { /// a file path like `Cargo.toml` or `Cargo.lock`. pub root_crate_path: Utf8PathBuf, + /// Metadata + pub metadata: cargo_metadata::Metadata, + /// Resolved workspace pub workspace_packages: WorkspacePackages, } @@ -284,10 +287,12 @@ impl<'shared_opts> TryFrom<&'shared_opts SharedOpts> for EnvironmentContext { let workspace = opts.workspace.partition_packages(&metadata); let workspace_packages = WorkspacePackages::from_iter(workspace.0.into_iter().cloned()); + info!(?metadata); info!(?workspace_packages, workspace_packages_excluded = ?workspace.1); Ok(Self { root_crate_path, + metadata, workspace_packages, }) }