Skip to content

feat(nuspec): include license file in docs and track files list #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 20, 2025

Conversation

SVilgelm
Copy link
Member

Add logic to copy the license file into the docs directory and include it
in the package metadata when CARGO_PKG_LICENSE_FILE is set. Introduce a
files vector to track additional files to be included in the package.
This ensures license files are properly packaged and accessible in docs.

@Copilot Copilot AI review requested due to automatic review settings July 18, 2025 17:33
Copilot

This comment was marked as outdated.

@SVilgelm SVilgelm force-pushed the feat-include-license-file-docs branch 2 times, most recently from a15fcbd to 19e6c0c Compare July 18, 2025 17:37
Add logic to copy the license file into the docs directory and include it
in the package metadata when CARGO_PKG_LICENSE_FILE is set. Introduce a
files vector to track additional files to be included in the package.
This ensures license files are properly packaged and accessible in docs.
@SVilgelm SVilgelm force-pushed the feat-include-license-file-docs branch from 19e6c0c to a2d7fa2 Compare July 18, 2025 17:38
@SVilgelm SVilgelm requested a review from Copilot July 20, 2025 05:12
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for including license files in NuGet packages by copying them to a docs directory and tracking them in the package metadata. The implementation handles the CARGO_PKG_LICENSE_FILE environment variable to automatically package license files.

  • Introduces a files vector to track additional files that need to be included in the package
  • Adds logic to copy license files to the docs directory when CARGO_PKG_LICENSE_FILE is set
  • Improves error message formatting for both license and readme file name extraction
Comments suppressed due to low confidence (2)

crates/nuspec/src/generate.rs:145

  • [nitpick] The error message format is inconsistent with typical Rust error handling patterns. Consider using a static string or a proper error type instead of formatted strings for better performance and consistency.
                    let license_file_name = Path::new(&license_path).file_name().ok_or(format!(

crates/nuspec/src/generate.rs:182

  • [nitpick] Similar to the license file error handling, this formatted error message is inconsistent with the previous implementation that used a static string. Consider maintaining consistency in error message patterns.
                    let readme_file_name = Path::new(&readme_path).file_name().ok_or(format!(

@SVilgelm SVilgelm merged commit 51eda60 into main Jul 20, 2025
11 checks passed
@SVilgelm SVilgelm deleted the feat-include-license-file-docs branch July 20, 2025 05:13
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.

1 participant