Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retarget xplat verification to netcoreapp5.0 #3386

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/common.project.props
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<NetStandardVersion>netstandard2.0</NetStandardVersion>
<TargetFrameworksExe>$(NETFXTargetFramework);$(NETCoreTargetFrameworks)</TargetFrameworksExe>
<TargetFrameworksLibrary Condition=" '$(RequiresSigningXplatAPIs)' != 'true' ">$(NETFXTargetFramework);$(NetStandardVersion)</TargetFrameworksLibrary>
<TargetFrameworksLibrary Condition=" '$(RequiresSigningXplatAPIs)' == 'true' ">$(NETFXTargetFramework);$(NetStandardVersion);netstandard2.1</TargetFrameworksLibrary>
<TargetFrameworksLibrary Condition=" '$(RequiresSigningXplatAPIs)' == 'true' ">$(NETFXTargetFramework);$(NetStandardVersion);netcoreapp5.0</TargetFrameworksLibrary>
<RepositoryRootDirectory>$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'README.md'))\</RepositoryRootDirectory>
<BuildCommonDirectory>$(RepositoryRootDirectory)build\</BuildCommonDirectory>
<SolutionFile>$(RepositoryRootDirectory)$(RepositoryName).sln</SolutionFile>
Expand Down
2 changes: 1 addition & 1 deletion build/common.targets
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</PropertyGroup>

<PropertyGroup>
<SigningNotSupported Condition=" '$(TargetFramework)' == 'netstandard2.0' OR '$(TargetFramework)' == 'netcoreapp2.1'">true</SigningNotSupported>
<SigningNotSupported Condition=" '$(TargetFramework)' == 'netstandard2.0' OR '$(TargetFramework)' == 'netcoreapp2.1' OR '$(TargetFramework)' == 'netstandard2.1'">true</SigningNotSupported>
<SigningNotSupported Condition=" '$(SigningNotSupported)' != 'true'">false</SigningNotSupported>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion build/packages.targets
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<VSFrameworkVersion>16.5.29714.20</VSFrameworkVersion>
<VSServicesVersion>16.153.0</VSServicesVersion>
<VSThreadingVersion>16.5.126</VSThreadingVersion>
<!-- TODO - remove this when temporary patching is no longer necessary. See https://github.com/NuGet/Home/issues/8508 -->
<!-- TODO - remove this when temporary patching is no longer necessary. See https://github.com/nuget/home/issues/8952 -->
<PatchedSystemPackagesVersion>5.0.0-preview.3.20214.6</PatchedSystemPackagesVersion>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
<Project>
<PropertyGroup>
<RequiresSigningXplatAPIs>true</RequiresSigningXplatAPIs>
</PropertyGroup>

<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'README.md'))\build\common.props" />
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />

Expand Down Expand Up @@ -154,7 +150,6 @@
</ItemGroup>
</Target>

<!--These targets help get files for packing the first NuGet.Build.Tasks.Pack package, for netstandard2.1.-->
<Target Name="CreatePackNupkg">
<PropertyGroup>
<!-- Build from source can't use ILMerge. -->
Expand All @@ -168,7 +163,7 @@
<PackagePath>Desktop/</PackagePath>
</TfmSpecificPackageFile>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.1'">
<ItemGroup Condition="'$(TargetFramework)' == '$(NetStandardVersion)'">
<TfmSpecificPackageFile Include="$(OutputPath)\$(ILMergeSubpath)NuGet.Build.Tasks.Pack.dll">
<PackagePath>CoreCLR/</PackagePath>
</TfmSpecificPackageFile>
Expand Down
2 changes: 1 addition & 1 deletion src/NuGet.Core/NuGet.Commands/NuGet.Commands.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<TargetFrameworks>$(TargetFrameworksLibrary)</TargetFrameworks>
<TargetFramework />
<NoWarn>$(NoWarn);CS1591;CS1574;CS1573;CS1584;CS1658</NoWarn>
<NoWarn Condition=" $(TargetFramework.StartsWith('netstandard')) ">$(NoWarn);CS1998</NoWarn>
<NoWarn Condition=" $(TargetFramework.StartsWith('netstandard')) OR $(TargetFramework.StartsWith('netcoreapp')) ">$(NoWarn);CS1998</NoWarn>
<PackProject>true</PackProject>
<IncludeInVSIX>true</IncludeInVSIX>
<Shipping>true</Shipping>
Expand Down
6 changes: 3 additions & 3 deletions src/NuGet.Core/NuGet.Packaging/NuGet.Packaging.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project>
<Project>
<PropertyGroup>
<RequiresSigningXplatAPIs>true</RequiresSigningXplatAPIs>
</PropertyGroup>
Expand All @@ -11,7 +11,7 @@
<TargetFrameworks>$(TargetFrameworksLibrary)</TargetFrameworks>
<TargetFramework />
<NoWarn>$(NoWarn);CS1591;CS1574;CS1573;CS1572</NoWarn>
<NoWarn Condition=" $(TargetFramework.StartsWith('netstandard')) ">$(NoWarn);CS0414</NoWarn>
<NoWarn Condition=" $(TargetFramework.StartsWith('netstandard')) OR $(TargetFramework.StartsWith('netcoreapp'))">$(NoWarn);CS0414</NoWarn>
<PackProject>true</PackProject>
<Shipping>true</Shipping>
<IncludeInVSIX>true</IncludeInVSIX>
Expand Down Expand Up @@ -49,7 +49,7 @@

<ItemGroup Condition=" '$(IsCore)' == 'true' ">
<PackageReference Include="System.Dynamic.Runtime" />
<!-- TODO - remove this when temporary patching is no longer necessary. See https://github.com/NuGet/Home/issues/8508 -->
<!-- TODO - remove this when temporary patching is no longer necessary. See https://github.com/nuget/home/issues/8952 -->
<PackageReference Include="System.Security.Cryptography.Pkcs" />
<PackageReference Include="System.Security.Cryptography.Cng" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ private void CopyRestoreArtifacts(string artifactsDirectory, string pathToSdkInC
{
var projectArtifactsFolder = new DirectoryInfo(Path.Combine(artifactsDirectory, projectName, toolsetVersion, "bin", configuration));

IEnumerable<DirectoryInfo> frameworkArtifactFolders = projectArtifactsFolder.EnumerateDirectories().Where(folder => folder.FullName.Contains("netstandard2.1") || folder.FullName.Contains("netcoreapp5.0"));
IEnumerable<DirectoryInfo> frameworkArtifactFolders = projectArtifactsFolder.EnumerateDirectories().Where(folder => folder.FullName.Contains("netcoreapp5.0"));

if (!frameworkArtifactFolders.Any())
{
Expand Down Expand Up @@ -328,8 +328,8 @@ private void CopyPackSdkArtifacts(string artifactsDirectory, string pathToSdkInC
const string packProjectName = "NuGet.Build.Tasks.Pack";
const string packTargetsName = "NuGet.Build.Tasks.Pack.targets";
// Copy the pack SDK.
//Order by fullname so that we can get the latest nestandard version. E.g. if we have both netstandard2.0 and netstandard2.1, netstandard2.1 will be selected.
var packProjectCoreArtifactsDirectory = new DirectoryInfo(Path.Combine(artifactsDirectory, packProjectName, toolsetVersion, "bin", configuration)).EnumerateDirectories("netstandard*").OrderBy(x => x.FullName).Last();
// Pick the netstandard2.0 NuGet.Build.Tasks.Pack dll
var packProjectCoreArtifactsDirectory = new DirectoryInfo(Path.Combine(artifactsDirectory, packProjectName, toolsetVersion, "bin", configuration)).EnumerateDirectories("netstandard*").Single();
var packAssemblyDestinationDirectory = Path.Combine(pathToPackSdk, "CoreCLR");
// Be smart here so we don't have to call ILMerge in the VS build. It takes ~15s total.
// In VisualStudio, simply use the non il merged version.
Expand Down Expand Up @@ -505,7 +505,7 @@ private void PatchDepsJsonWithNewlyAddedDlls(string[] assemblyNames, string[] fi
var assemblyPath = Path.Combine(Directory.GetCurrentDirectory(), assemblyName);
var assemblyVersion = Assembly.LoadFile(assemblyPath).GetName().Version.ToString();
var assemblyFileVersion = FileVersionInfo.GetVersionInfo(assemblyPath).FileVersion;
var jproperty = new JProperty("lib/netstandard2.1/" + assemblyName,
var jproperty = new JProperty("lib/netcoreapp5.0/" + assemblyName,
new JObject
{
new JProperty("assemblyVersion", assemblyVersion),
Expand Down