From 157de59d479f2ed179b9b777eaf2b769871e3bf6 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Sat, 23 Oct 2021 16:41:24 -0700 Subject: [PATCH] Remove uneeded source build patches and re-patch --- build/common.project.props | 16 ++++++---------- build/packages.targets | 3 ++- .../NuGet.Build.Tasks.Pack.csproj | 4 ++-- .../NuGet.CommandLine.XPlat.csproj | 2 +- .../SignCommand/CertificateProvider.cs | 4 ++-- src/NuGet.Core/NuGet.Common/NuGet.Common.csproj | 1 - .../NuGet.Configuration.csproj | 3 +-- .../NuGet.Frameworks/NuGet.Frameworks.csproj | 3 +-- .../NuGet.PackageManagement.csproj | 2 +- .../Signing/Authoring/SignPackageRequest.cs | 2 ++ .../NuGet.Packaging/Signing/Cms/NativeUtility.cs | 2 ++ .../HttpSource/HttpRequestMessageExtensions.cs | 6 +++--- .../HttpSource/HttpRetryHandler.cs | 2 +- .../HttpSourceAuthenticationHandler.cs | 2 +- .../NuGet.Versioning/NuGet.Versioning.csproj | 1 - 15 files changed, 25 insertions(+), 28 deletions(-) diff --git a/build/common.project.props b/build/common.project.props index 79a935391..65e482b83 100644 --- a/build/common.project.props +++ b/build/common.project.props @@ -10,24 +10,20 @@ - $(DotNetBuildFromSource) PackageReference v4.7.2 net472 - netcoreapp2.1 - net6.0 + net6.0 netcoreapp5.0 - netstandard2.0 - net6.0 + $(DotNetBuildFromSource) + netstandard2.0;net6.0 $(NETFXTargetFramework);$(NETCoreTargetFramework) $(NETCoreTargetFramework) - $(TargetFrameworksExe);netcoreapp5.0 - $(NETCoreTargetFramework);netcoreapp5.0 - $(TargetFrameworksExe);net6.0 + $(TargetFrameworksExe);net6.0 + $(NETCoreTargetFramework);net6.0 $(NETFXTargetFramework);$(NetStandardVersion) $(NetStandardVersion) - $(TargetFrameworksLibrary);netcoreapp5.0 - $(TargetFrameworksLibrary);net6.0 + $(TargetFrameworksLibrary);net6.0 $(NETFXTargetFramework);netcoreapp5.0 $([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'README.md'))\ $(RepositoryRootDirectory)build\ diff --git a/build/packages.targets b/build/packages.targets index c11557248..0e7dd7861 100644 --- a/build/packages.targets +++ b/build/packages.targets @@ -10,6 +10,7 @@ 5.0.0 2.14.0-rtm-832 17.0.0-beta1-10402-05 + 5.0.1-rtm.21063.7 @@ -33,7 +34,7 @@ - + diff --git a/src/NuGet.Core/NuGet.Build.Tasks.Pack/NuGet.Build.Tasks.Pack.csproj b/src/NuGet.Core/NuGet.Build.Tasks.Pack/NuGet.Build.Tasks.Pack.csproj index c94acffd8..f4d083e52 100644 --- a/src/NuGet.Core/NuGet.Build.Tasks.Pack/NuGet.Build.Tasks.Pack.csproj +++ b/src/NuGet.Core/NuGet.Build.Tasks.Pack/NuGet.Build.Tasks.Pack.csproj @@ -177,7 +177,7 @@ ilmerge\ Desktop/ - CoreCLR/ + CoreCLR/ @@ -189,7 +189,7 @@ $(PackagePathDir) - + diff --git a/src/NuGet.Core/NuGet.CommandLine.XPlat/NuGet.CommandLine.XPlat.csproj b/src/NuGet.Core/NuGet.CommandLine.XPlat/NuGet.CommandLine.XPlat.csproj index 21015c00a..e306cdee4 100644 --- a/src/NuGet.Core/NuGet.CommandLine.XPlat/NuGet.CommandLine.XPlat.csproj +++ b/src/NuGet.Core/NuGet.CommandLine.XPlat/NuGet.CommandLine.XPlat.csproj @@ -18,7 +18,7 @@ - + diff --git a/src/NuGet.Core/NuGet.Commands/SignCommand/CertificateProvider.cs b/src/NuGet.Core/NuGet.Commands/SignCommand/CertificateProvider.cs index c6ea71243..beac41889 100644 --- a/src/NuGet.Core/NuGet.Commands/SignCommand/CertificateProvider.cs +++ b/src/NuGet.Core/NuGet.Commands/SignCommand/CertificateProvider.cs @@ -115,7 +115,7 @@ public static async Task GetCertificatesAsync(Certif return resultCollection; } - +#pragma warning disable CS1998 private static async Task LoadCertificateFromFileAsync(CertificateSourceOptions options) { X509Certificate2 cert; @@ -154,7 +154,7 @@ private static async Task LoadCertificateFromFileAsync(Certifi return cert; } - +#pragma warning restore CS1998 private static X509Certificate2Collection LoadCertificateFromStore(CertificateSourceOptions options) { X509Certificate2Collection resultCollection = null; diff --git a/src/NuGet.Core/NuGet.Common/NuGet.Common.csproj b/src/NuGet.Core/NuGet.Common/NuGet.Common.csproj index e30a079eb..c2b8fe241 100644 --- a/src/NuGet.Core/NuGet.Common/NuGet.Common.csproj +++ b/src/NuGet.Core/NuGet.Common/NuGet.Common.csproj @@ -5,7 +5,6 @@ Common utilities and interfaces for all NuGet libraries. $(TargetFrameworksLibrary) - $(TargetFrameworks);net45 $(NoWarn);CS1591;CS1574 true diff --git a/src/NuGet.Core/NuGet.Configuration/NuGet.Configuration.csproj b/src/NuGet.Core/NuGet.Configuration/NuGet.Configuration.csproj index bbc5ba480..18b597c74 100644 --- a/src/NuGet.Core/NuGet.Configuration/NuGet.Configuration.csproj +++ b/src/NuGet.Core/NuGet.Configuration/NuGet.Configuration.csproj @@ -6,7 +6,6 @@ NuGet's configuration settings implementation. $(NoWarn);CS1591 $(TargetFrameworksLibrary) - $(TargetFrameworks);net45 true true @@ -29,7 +28,7 @@ - + diff --git a/src/NuGet.Core/NuGet.Frameworks/NuGet.Frameworks.csproj b/src/NuGet.Core/NuGet.Frameworks/NuGet.Frameworks.csproj index b78b1f2ea..a89b516c6 100644 --- a/src/NuGet.Core/NuGet.Frameworks/NuGet.Frameworks.csproj +++ b/src/NuGet.Core/NuGet.Frameworks/NuGet.Frameworks.csproj @@ -4,8 +4,7 @@ NuGet's understanding of target frameworks. - $(TargetFrameworksLibrary);netstandard2.0 - $(TargetFrameworksLibrary);net40 + $(TargetFrameworksLibrary);netstandard2.0 $(NoWarn);CS1591;CS1574;CS1573 true diff --git a/src/NuGet.Core/NuGet.PackageManagement/NuGet.PackageManagement.csproj b/src/NuGet.Core/NuGet.PackageManagement/NuGet.PackageManagement.csproj index dfbfcaa8d..a6bb51d6b 100644 --- a/src/NuGet.Core/NuGet.PackageManagement/NuGet.PackageManagement.csproj +++ b/src/NuGet.Core/NuGet.PackageManagement/NuGet.PackageManagement.csproj @@ -35,7 +35,7 @@ - + diff --git a/src/NuGet.Core/NuGet.Packaging/Signing/Authoring/SignPackageRequest.cs b/src/NuGet.Core/NuGet.Packaging/Signing/Authoring/SignPackageRequest.cs index e0cfae99f..ce19f2d6e 100644 --- a/src/NuGet.Core/NuGet.Packaging/Signing/Authoring/SignPackageRequest.cs +++ b/src/NuGet.Core/NuGet.Packaging/Signing/Authoring/SignPackageRequest.cs @@ -98,7 +98,9 @@ protected virtual void Dispose(bool disposing) Chain?.Dispose(); #if IS_SIGNING_SUPPORTED +#pragma warning disable CA1416 PrivateKey?.Dispose(); +#pragma warning restore CA1416 #endif } diff --git a/src/NuGet.Core/NuGet.Packaging/Signing/Cms/NativeUtility.cs b/src/NuGet.Core/NuGet.Packaging/Signing/Cms/NativeUtility.cs index 565ac60b7..d57e38a65 100644 --- a/src/NuGet.Core/NuGet.Packaging/Signing/Cms/NativeUtility.cs +++ b/src/NuGet.Core/NuGet.Packaging/Signing/Cms/NativeUtility.cs @@ -120,7 +120,9 @@ internal static SignedCms NativeSign(CmsSigner cmsSigner, byte[] data, CngKey pr signerInfo.cbSize = (uint)Marshal.SizeOf(signerInfo); signerInfo.pCertInfo = MarshalUtility.PtrToStructure(cmsSigner.Certificate.Handle).pCertInfo; +#pragma warning disable CA1416 signerInfo.hCryptProvOrhNCryptKey = privateKey.Handle.DangerousGetHandle(); +#pragma warning restore CA1416 signerInfo.HashAlgorithm.pszObjId = cmsSigner.DigestAlgorithm.Value; if (cmsSigner.SignerIdentifierType == SubjectIdentifierType.SubjectKeyIdentifier) diff --git a/src/NuGet.Core/NuGet.Protocol/HttpSource/HttpRequestMessageExtensions.cs b/src/NuGet.Core/NuGet.Protocol/HttpSource/HttpRequestMessageExtensions.cs index 7c9595268..1ca751850 100644 --- a/src/NuGet.Core/NuGet.Protocol/HttpSource/HttpRequestMessageExtensions.cs +++ b/src/NuGet.Core/NuGet.Protocol/HttpSource/HttpRequestMessageExtensions.cs @@ -34,7 +34,7 @@ internal static HttpRequestMessage Clone(this HttpRequestMessage request) clone.Headers.TryAddWithoutValidation(header.Key, header.Value); } -#if NET5_0 +#if NET5_0 || NET6_0 var clonedOptions = (IDictionary)clone.Options; foreach (var option in request.Options) { @@ -118,7 +118,7 @@ public static void SetConfiguration(this HttpRequestMessage request, HttpRequest throw new ArgumentNullException(nameof(configuration)); } -#if NET5_0 +#if NET5_0 || NET6_0 request.Options.Set(new HttpRequestOptionsKey(NuGetConfigurationKey), configuration); #else request.Properties[NuGetConfigurationKey] = configuration; @@ -128,7 +128,7 @@ public static void SetConfiguration(this HttpRequestMessage request, HttpRequest private static T GetProperty(this HttpRequestMessage request, string key) { -#if NET5_0 +#if NET5_0 || NET6_0 if (request.Options.TryGetValue(new HttpRequestOptionsKey(key), out T result)) #else object result; diff --git a/src/NuGet.Core/NuGet.Protocol/HttpSource/HttpRetryHandler.cs b/src/NuGet.Core/NuGet.Protocol/HttpSource/HttpRetryHandler.cs index c7bcb54bb..30d86fcc9 100644 --- a/src/NuGet.Core/NuGet.Protocol/HttpSource/HttpRetryHandler.cs +++ b/src/NuGet.Core/NuGet.Protocol/HttpSource/HttpRetryHandler.cs @@ -113,7 +113,7 @@ internal HttpRetryHandler(IEnvironmentVariableReader environmentVariableReader) headerStopwatch = new Stopwatch(); stopwatches.Add(headerStopwatch); } -#if NET5_0 +#if NET5_0 || NET6_0 requestMessage.Options.Set(new HttpRequestOptionsKey>(StopwatchPropertyName), stopwatches); #else requestMessage.Properties[StopwatchPropertyName] = stopwatches; diff --git a/src/NuGet.Core/NuGet.Protocol/HttpSource/HttpSourceAuthenticationHandler.cs b/src/NuGet.Core/NuGet.Protocol/HttpSource/HttpSourceAuthenticationHandler.cs index b9ab58ce7..ebf738e52 100644 --- a/src/NuGet.Core/NuGet.Protocol/HttpSource/HttpSourceAuthenticationHandler.cs +++ b/src/NuGet.Core/NuGet.Protocol/HttpSource/HttpSourceAuthenticationHandler.cs @@ -98,7 +98,7 @@ protected override async Task SendAsync(HttpRequestMessage { List stopwatches = null; -#if NET5_0 +#if NET5_0 || NET6_0 if (request.Options.TryGetValue( new HttpRequestOptionsKey>(HttpRetryHandler.StopwatchPropertyName), out stopwatches)) diff --git a/src/NuGet.Core/NuGet.Versioning/NuGet.Versioning.csproj b/src/NuGet.Core/NuGet.Versioning/NuGet.Versioning.csproj index 180293944..8498664b9 100644 --- a/src/NuGet.Core/NuGet.Versioning/NuGet.Versioning.csproj +++ b/src/NuGet.Core/NuGet.Versioning/NuGet.Versioning.csproj @@ -4,7 +4,6 @@ $(TargetFrameworksLibrary) - $(TargetFrameworks);net45 NuGet's implementation of Semantic Versioning. semver;semantic versioning -- 2.31.1