Skip to content
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

[vcpkg] Add semantic handling for nuget_version with two-segment versions #1549

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/vcpkg/commands.export.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,13 @@ namespace
if (opts.nuget)
{
const auto nuget_id = opts.maybe_nuget_id.value_or(raw_exported_dir_path.filename().to_string());
const auto nuget_version = opts.maybe_nuget_version.value_or("1.0.0");
std::string template_nuget_version = opts.maybe_nuget_version.value_or("1.0.0");
if (std::count(template_nuget_version.begin(), template_nuget_version.end(), '.') == 1)
{
// If the version is in the format "X.Y", make it "X.Y.0" for NuGet's semantic versioning.
template_nuget_version += ".0";
}
const auto nuget_version = template_nuget_version;
const auto nuget_description = opts.maybe_nuget_description.value_or("Vcpkg NuGet export");

msg::println(msgCreatingNugetPackage);
Expand Down