Add version management commands (check, list, update)#46
Open
jfversluis wants to merge 2 commits intomainfrom
Open
Add version management commands (check, list, update)#46jfversluis wants to merge 2 commits intomainfrom
jfversluis wants to merge 2 commits intomainfrom
Conversation
Port functionality from jfversluis/maui-version into the maui CLI as subcommands of 'maui version': - maui version check: inspect MAUI package versions in a project, resolve $(MauiVersion) via workload info, detect version mismatches - maui version list: query available versions from stable or nightly NuGet feeds with prerelease filtering - maui version update: switch MAUI packages to latest stable, latest nightly, or a specific version (e.g. PR builds); optional --nuget-config to set up the nightly feed New services: - NuGetVersionService: queries nuget.org and maui-nightly AzDO feed using NuGet.Protocol - ProjectVersionService: csproj XML parsing, version replacement, dotnet add package integration, NuGet.config management Adds NuGet.Protocol 6.13.1 dependency. All 119 existing tests pass. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds maui version subcommands to the CLI to inspect and manage .NET MAUI package versions in a project, including querying NuGet feeds and updating project references.
Changes:
- Introduces
maui version check,maui version list, andmaui version updatecommands under a newVersionCommandscommand group. - Adds
NuGetVersionService(NuGet feed querying) andProjectVersionService(project parsing/updating + dotnet operations). - Updates CLI docs and central package management to include
NuGet.Protocol.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Cli/README.md | Documents the new maui version subcommands and examples. |
| src/Cli/Microsoft.Maui.Cli/Services/ProjectVersionService.cs | New service to detect/update MAUI package versions and manage NuGet.config. |
| src/Cli/Microsoft.Maui.Cli/Services/NuGetVersionService.cs | New service to query stable/nightly feeds for MAUI package versions. |
| src/Cli/Microsoft.Maui.Cli/ServiceConfiguration.cs | Registers the new version services with DI. |
| src/Cli/Microsoft.Maui.Cli/Program.cs | Switches root command registration to VersionCommands. |
| src/Cli/Microsoft.Maui.Cli/Microsoft.Maui.Cli.csproj | Adds NuGet.Protocol package reference. |
| src/Cli/Microsoft.Maui.Cli/Commands/VersionCommands.Update.cs | Implements maui version update behavior/options. |
| src/Cli/Microsoft.Maui.Cli/Commands/VersionCommands.List.cs | Implements maui version list behavior/options. |
| src/Cli/Microsoft.Maui.Cli/Commands/VersionCommands.Check.cs | Implements maui version check behavior/options. |
| src/Cli/Microsoft.Maui.Cli/Commands/VersionCommand.cs | Converts existing maui version into a command group + subcommands. |
| eng/Versions.props | Adds NuGetProtocolVersion property. |
| Directory.Packages.props | Pins NuGet.Protocol via central package management. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Handle implicit versions (no Version attribute) in check/update - Check process exit codes and throw on failure - Make EnsureNuGetConfig idempotent (list sources, update if exists) - Preserve file content (split on \n, write back raw) - Dispose SourceCacheContext with using - Sort versions explicitly with OrderBy - Resolve services from DI instead of direct instantiation - Add new services to CreateTestServiceProvider - Validate --channel (stable/nightly only) - Validate --take > 0 - Only update Compatibility package if already referenced - Track HasControlsReference/HasCompatibilityReference in version info Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ports functionality from jfversluis/maui-version into the
mauiCLI as subcommands ofmaui version.New Commands
maui version check$(MauiVersion)maui version listmaui version update --latest$(MauiVersion))maui version update --latest-nightlymaui version update --version <v>Examples
Implementation
NuGet.Protocoldotnet restore, manages NuGet.configAndroidCommands),IOutputFormatterfor JSON/Spectre output, global--json/--dry-runsupportmaui version(bare) still shows CLI version info as beforeDependencies
NuGet.Protocol 6.13.1to the CLI projectTests
All 119 existing tests pass. New service tests to follow.