Skip to content

Commit b57d60a

Browse files
author
Louis Seubert
committed
mark dependencies as private assets for msbuild
Chnage that all references of the msbuild package are marked as private assets, so they don't get added as dependency to the nuget package. The dependecies field of the nuspec before the change: ```xml <dependencies> <group targetFramework="net6.0"> <dependency id="System.Text.Json" version="8.0.1" exclude="Build,Analyzers" /> </group> <group targetFramework="net7.0"> <dependency id="System.Text.Json" version="8.0.1" exclude="Build,Analyzers" /> </group> <group targetFramework="net8.0"> <dependency id="System.Text.Json" version="8.0.1" exclude="Build,Analyzers" /> </group> </dependencies> ``` and afer the change the dependencies of the nuspec look like this: ```xml <dependencies> <group targetFramework="net6.0" /> <group targetFramework="net7.0" /> <group targetFramework="net8.0" /> </dependencies> ```
1 parent bb5e40a commit b57d60a

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/GitVersion.MsBuild/GitVersion.MsBuild.csproj

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,19 @@
1414
</PropertyGroup>
1515

1616
<ItemGroup>
17-
<PackageReference Include="Microsoft.Build.Utilities.Core" PrivateAssets="All" />
18-
<PackageReference Include="Microsoft.Win32.Registry" PrivateAssets="All" />
19-
<PackageReference Include="Microsoft.Extensions.DependencyInjection" PrivateAssets="All" />
17+
<PackageReference Include="Microsoft.Build.Utilities.Core" />
18+
<PackageReference Include="Microsoft.Win32.Registry" />
19+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" />
20+
<!-- Marks all packages as 'local only' so they don't end up in the nuspec. -->
21+
<PackageReference Update="@(PackageReference)" PrivateAssets="All"/>
2022
</ItemGroup>
2123

2224
<ItemGroup>
23-
<ProjectReference Include="..\GitVersion.BuildAgents\GitVersion.BuildAgents.csproj" PrivateAssets="All" />
24-
<ProjectReference Include="..\GitVersion.Configuration\GitVersion.Configuration.csproj" PrivateAssets="All" />
25-
<ProjectReference Include="..\GitVersion.Core\GitVersion.Core.csproj" PrivateAssets="All" />
26-
<ProjectReference Include="..\GitVersion.Output\GitVersion.Output.csproj" PrivateAssets="All" />
25+
<ProjectReference Include="..\GitVersion.BuildAgents\GitVersion.BuildAgents.csproj" />
26+
<ProjectReference Include="..\GitVersion.Configuration\GitVersion.Configuration.csproj" />
27+
<ProjectReference Include="..\GitVersion.Core\GitVersion.Core.csproj" />
28+
<ProjectReference Include="..\GitVersion.Output\GitVersion.Output.csproj" />
29+
<ProjectReference Update="@(ProjectReference)" PrivateAssets="All"/>
2730
</ItemGroup>
2831

2932
<ItemGroup>
@@ -38,7 +41,6 @@
3841
<None Include="$(ExePublishPath)/net6.0/publish/**/*;$(BinPath)/net6.0/GitVersion.MsBuild.*" Pack="true" PackagePath="tools/net6.0" />
3942
<None Include="$(ExePublishPath)/net7.0/publish/**/*;$(BinPath)/net7.0/GitVersion.MsBuild.*" Pack="true" PackagePath="tools/net7.0" />
4043
<None Include="$(ExePublishPath)/net8.0/publish/**/*;$(BinPath)/net8.0/GitVersion.MsBuild.*" Pack="true" PackagePath="tools/net8.0" />
41-
4244
</ItemGroup>
4345

4446
</Project>

0 commit comments

Comments
 (0)