Skip to content

Commit fa3711b

Browse files
authored
[build] Update NuGet package versions (#196)
Context: https://dev.azure.com/xamarin/public/_componentGovernance/115226/alert/3150206?typeId=5477311 Context: https://dev.azure.com/xamarin/public/_componentGovernance/115226/alert/6875331?typeId=5477311 Context: dotnet/java-interop@5318261 [Component Governance][0] is a Microsoft internal tool which checks for known security issues in product dependencies. It is currently reporting a defects in xamarin-android-tools due to use of older `System.Net.Http` packages ([CVE-2018-8292][0]) and older `System.Security.Cryptography.X509Certificates` packages ([CVE-2017-11770][1]): > **Location** > > * /s/packages/system.net.http/4.1.0/system.net.http.4.1.0.nupkg > * /s/packages/system.net.http/4.1.0/system.net.http.nuspec > * /s/packages/system.security.cryptography.x509certificates/4.1.0/system.security.cryptography.x509certificates.4.1.0.nupkg > * /s/packages/system.security.cryptography.x509certificates/4.1.0/system.security.cryptography.x509certificates.nuspec The "odd" thing is that xamarin-android-tools doesn't *use* either of these dependencies! They appear to be pulled in via package dependencies. Rework how we use `@(PackageReference)` so that `Directory.Build.targets` uses [the `Update` attribute][2] to centralize package version specification, except within `MSBuildReferences.projitems` as it's `<Import/>`ed by xamarin-android. Update most NuGet package versions to the latest versions provided by `dotnet-public` or `dotnet-eng` (which may not be the latest versions on NuGet.org). While stable versions are generally preferred, we use Microsoft.NET.Test.Sdk version 17.5.0-preview-20221003-04 to ensure that we avoid Newtonsoft.Json 9.0.1 issues a'la dotnet/java-interop@53182615. NuGet Package Version Bumps: * Microsoft.Build : `16.10.0` -> `17.3.2` * Microsoft.Build.Framework : `16.10.0` -> `17.3.2` * Microsoft.Build.Tasks.Core : `16.10.0` -> `17.3.2` * Microsoft.Build.Utilities.Core : `16.10.0` -> `17.3.2` * Microsoft.NET.Test.Sdk : `16.5.0` -> `17.5.0-preview-20221003-04` * nunit : `3.12.0` -> `3.13.2` * NUnit3TestAdapter : `3.16.1` -> `4.0.0` [0]: https://nvd.nist.gov/vuln/detail/CVE-2018-8292 [1]: https://nvd.nist.gov/vuln/detail/CVE-2017-11770 [2]: https://learn.microsoft.com/en-us/visualstudio/msbuild/item-element-msbuild?view=vs-2022#attributes-and-elements
1 parent 59cac90 commit fa3711b

File tree

5 files changed

+14
-9
lines changed

5 files changed

+14
-9
lines changed

Directory.Build.targets

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,13 @@
1919
Condition=" Exists('$([System.IO.Path]::GetDirectoryName($(MSBuildThisFileDirectory))).override.targets') "
2020
/>
2121

22+
<!-- NuGet Dependencies -->
2223
<ItemGroup>
23-
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.1.1" />
24+
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.5.0-preview-20221003-04" />
25+
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.1.1" />
26+
<PackageReference Update="Microsoft.VisualStudioEng.MicroBuild.Core" Version="1.0.0" />
27+
<PackageReference Update="nunit" Version="3.13.2" />
28+
<PackageReference Update="NUnit3TestAdapter" Version="4.0.0" />
2429
</ItemGroup>
2530

2631
</Project>

src/Microsoft.Android.Build.BaseTasks/MSBuildReferences.projitems

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<Project>
55
<!--Import this file in projects needing to reference Microsoft.Build.*.dll -->
66
<PropertyGroup>
7-
<MSBuildPackageReferenceVersion>16.10.0</MSBuildPackageReferenceVersion>
7+
<MSBuildPackageReferenceVersion>17.3.2</MSBuildPackageReferenceVersion>
88
<LibZipSharpVersion Condition=" '$(LibZipSharpVersion)' == '' " >2.0.7</LibZipSharpVersion>
99
<MonoUnixVersion>7.1.0-final.1.21458.1</MonoUnixVersion>
1010
</PropertyGroup>

src/Xamarin.Android.Tools.AndroidSdk/Xamarin.Android.Tools.AndroidSdk.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
</PropertyGroup>
2727

2828
<ItemGroup>
29-
<PackageReference Include="Microsoft.VisualStudioEng.MicroBuild.Core" Version="1.0.0">
29+
<PackageReference Include="Microsoft.VisualStudioEng.MicroBuild.Core">
3030
<PrivateAssets>all</PrivateAssets>
3131
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
3232
</PackageReference>

tests/Microsoft.Android.Build.BaseTasks-Tests/Microsoft.Android.Build.BaseTasks-Tests.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
<Import Project="..\..\src\Microsoft.Android.Build.BaseTasks\MSBuildReferences.projitems" />
1515

1616
<ItemGroup>
17-
<PackageReference Include="NUnit" Version="3.12.0" />
18-
<PackageReference Include="NUnit3TestAdapter" Version="3.16.1" />
19-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0"/>
17+
<PackageReference Include="NUnit" />
18+
<PackageReference Include="NUnit3TestAdapter" />
19+
<PackageReference Include="Microsoft.NET.Test.Sdk" />
2020
</ItemGroup>
2121

2222
<ItemGroup>

tests/Xamarin.Android.Tools.AndroidSdk-Tests/Xamarin.Android.Tools.AndroidSdk-Tests.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
</PropertyGroup>
1414

1515
<ItemGroup>
16-
<PackageReference Include="NUnit" Version="3.12.0" />
17-
<PackageReference Include="NUnit3TestAdapter" Version="3.16.1" />
18-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0"/>
16+
<PackageReference Include="NUnit" />
17+
<PackageReference Include="NUnit3TestAdapter" />
18+
<PackageReference Include="Microsoft.NET.Test.Sdk" />
1919
</ItemGroup>
2020

2121
<ItemGroup>

0 commit comments

Comments
 (0)