Skip to content

Commit c46e47c

Browse files
authored
Merge pull request #1391 from dotnet/fix-1390
Avoid writing server.json multiple times in a single pack
2 parents ec01c11 + 28a98ad commit c46e47c

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/Nerdbank.GitVersioning.Tasks/build/Nerdbank.GitVersioning.targets

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,9 +311,11 @@
311311
</PropertyGroup>
312312
</Target>
313313

314-
<!-- Support for MCP servers: stamp version in server.json -->
314+
<!-- Support for MCP servers: stamp version in server.json
315+
Set the Condition to NOT run when RIDs and RID are both set and RID-specific packages are being created
316+
(indicating an inner build which would share the output file with the outer build). -->
315317
<Target Name="NBGV_StampMcpServerJson"
316-
Condition="'$(PackageType)' == 'McpServer'"
318+
Condition="'$(PackageType)' == 'McpServer' and ('$(RuntimeIdentifiers)'=='' or '$(RuntimeIdentifier)'=='' or '$(CreateRidSpecificToolPackages)' != 'true')"
317319
BeforeTargets="GenerateNuspec;_GetPackageFiles"
318320
DependsOnTargets="GetBuildVersion">
319321
<ItemGroup>

0 commit comments

Comments
 (0)