Repository navigation
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adjusts how .NET SDK tool packages are packed when producing multiple RID-specific tool packages, including changes to MSBuild targets that orchestrate RID builds and updates to the tool configuration schema/consumer to no longer track per-RID package versions.
Changes:
- Gate
Microsoft.NET.PackTool.targetsimport onPackAsTool=trueand update MSBuild logic to orchestrate RID-specific tool package creation. - Shift multi-RID tool package selection from item-based
@(ToolPackageRuntimeIdentifier)to property-based$(ToolPackageRuntimeIdentifiers). - Update tool settings generation and CLI deserialization/downloading to remove RID-package version metadata and rely on the base package version.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.targets | Imports tool-pack targets only when packing as a tool. |
| src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.Common.targets | Switches RID tool package type detection to $(ToolPackageRuntimeIdentifiers). |
| src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.PackTool.targets | Major rework of tool packing logic: publish dependencies, package layout, and RID package orchestration. |
| src/Tasks/Microsoft.NET.Build.Tasks/ResolveToolPackagePaths.cs | Removes the MSBuild task previously used to map publish outputs to package paths. |
| src/Tasks/Microsoft.NET.Build.Tasks/GenerateToolsSettingsFile.cs | Removes RID-package version emission from the generated tool settings XML. |
| src/Tasks/Microsoft.NET.Build.Tasks.UnitTests/GivenAPublishRelativePathToPackPackagePath.cs | Removes unit tests tied to the deleted ResolveToolPackagePaths task. |
| src/Cli/dotnet/ToolPackage/ToolPackageDownloaderBase.cs | Downloads RID-specific packages using the base tool package version. |
| src/Cli/dotnet/ToolPackage/ToolConfigurationDeserializer.cs | Deserializes RID-specific packages without requiring a per-RID version. |
| src/Cli/dotnet/ToolPackage/ToolConfigurationDeserialization/DotNetCliToolRuntimeIdentifierPackage.cs | Removes the Version attribute from the RID-package schema model. |
|
|
||
| <Target Name="_GenerateToolsSettingsFileInputCache"> | ||
| <ItemGroup> | ||
| <_ToolPackageRuntimeIdentifier Include="$(ToolRuntimeIdentifiers)" /> |
| <Target Name="PackToolImplementation"> | ||
|
|
||
| <ItemGroup> | ||
| <_GeneratedFiles Include="$(PublishDepsFilePath)" Condition="'$(GenerateDependencyFile)' != 'true' or '$(_UseBuildDependencyFile)' == 'true'" /> | ||
| <_GeneratedFiles Include="$(PublishRuntimeConfigFilePath)"/> | ||
| </ItemGroup> |
| <!-- inner builds need publish content--> | ||
| <_PackToolPublishDependency Condition=" '$(RuntimeIdentifier)' != '' and '$(GeneratePackageOnBuild)' != 'true' and $(IsPublishable) == 'true' ">Publish</_PackToolPublishDependency> | ||
| <!-- outer build needs to generate RID-specific tool packages, but only if we're not AOT-ing (because we can't do xplat AOT). --> |
| <_PublishFilesRaw Condition="'$(RuntimeIdentifier)' != ''" Include="$(PublishDir)/**/*" /> | ||
| <_PublishFiles Condition="'$(RuntimeIdentifier)' != ''" Include="@(_PublishFilesRaw)"> | ||
| <RelativePath>$([System.IO.Path]::GetRelativePath($(PublishDir), %(Identity)))</RelativePath> | ||
| </_PublishFiles> |
| <ToolEntryPoint>$(TargetFileName)</ToolEntryPoint> | ||
| <!-- TODO: What property to use for single file (non AOT) or other modes? --> | ||
| <ToolEntryPoint Condition=" '$(PublishAot)' == 'true' ">$([System.IO.Path]::GetFileName($(NativeBinary)))</ToolEntryPoint> | ||
| <ToolEntryPoint Condition="'$(RuntimeIdentifier)' != '' and '$(UseAppHost)' == 'true' ">$(AssemblyName)$(_NativeExecutableExtension)</ToolEntryPoint> | ||
| </PropertyGroup> |
Default Copilot Code Review vs. Code-Review Skill — Category #2 (MSBuild path/target semantics)This PR faithfully reproduces dotnet/sdk#49288 ("Multi-RID tool packages usability tweaks") at the exact commit Copilot reviewed ( On the real PR, default Copilot Code Review produced 0 inline findings. With the skill, Copilot produced 5 findings, all in
These aren't speculative. The final merged version of dotnet#49288 fixes exactly these areas: the |
Demo reproduction of dotnet#49288 (
Multi-RID tool packages usability tweaks) at the exact commit Copilot reviewed (89f3885), to compare default Copilot Code Review vs. the code-review skill. Category #2 (MSBuild property/item/target/path semantics).