Skip to content

Conversation

Copy link

Copilot AI commented Sep 15, 2025

This PR implements a new cargo-nuspec crate that provides a cargo subcommand for generating .nuspec files from Rust package metadata.

Features

The cargo-nuspec tool can be installed as a cargo subcommand and used to generate NuGet package specification files:

cargo install cargo-nuspec
cargo nuspec <package-name>

The tool automatically maps Cargo.toml metadata to NuGet package specifications:

  • Package name → NuGet package id
  • Version → NuGet package version
  • Description → NuGet package description
  • Authors → NuGet package authors
  • Homepage → NuGet project URL
  • License → NuGet license expression
  • Repository → NuGet repository URL
  • Keywords → NuGet tags

Usage Examples

Generate a .nuspec file for a package in your workspace:

cargo nuspec my-package

Specify a custom output directory:

cargo nuspec my-package -o /path/to/output

Use with a different workspace:

cargo nuspec my-package -m /path/to/workspace/Cargo.toml

Implementation Details

  • Built using clap for CLI argument parsing and cargo_metadata for reading package information
  • Integrates with the existing nuspec crate for XML generation
  • Includes comprehensive error handling and unit tests
  • Follows cargo subcommand conventions for seamless integration

The generated .nuspec files can be used directly with nuget pack to create NuGet packages from Rust projects.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits September 15, 2025 17:37
Co-authored-by: SVilgelm <523825+SVilgelm@users.noreply.github.com>
Co-authored-by: SVilgelm <523825+SVilgelm@users.noreply.github.com>
Copilot AI changed the title [WIP] create cargo-nuspec crate. A user should be able to install is as a cargo tool (cargo install cargo-nuspec) and accept a package name as a first parameter to generate .nuspec file for given package. Create a pull request Add cargo-nuspec crate - CLI tool to generate .nuspec files Sep 15, 2025
Copilot AI requested a review from SVilgelm September 15, 2025 17:38
Copilot finished work on behalf of SVilgelm September 15, 2025 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants