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

Stop harvesting S.Security.Cryptography.Pkcs #52045

Merged
merged 3 commits into from
May 4, 2021
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
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,15 @@
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" />
<ItemGroup>
<ProjectReference Include="..\ref\System.Security.Cryptography.Pkcs.csproj">
<SupportedFramework>net461;netcoreapp3.0</SupportedFramework>
<SupportedFramework>net461;netcoreapp2.0;uap10.0.16299;$(AllXamarinFrameworks)</SupportedFramework>
</ProjectReference>
<ProjectReference Include="..\src\System.Security.Cryptography.Pkcs.csproj" />
<HarvestIncludePaths Include="ref/net46;lib/net46;runtimes/win/lib/net46" />
<HarvestIncludePaths Include="ref/netstandard1.3;runtimes/win/lib/netstandard1.3;lib/netstandard1.3" />
<HarvestIncludePaths Include="ref/netstandard2.0" />
<HarvestIncludePaths Include="ref/netcoreapp2.1;lib/netcoreapp2.1;runtimes/win/lib/netcoreapp2.1" />
<!--
Suppress NETStandard.Library collpasing as it add more dependencies then needed in some
scenarios like .NET Framework which adds an unecessary amount of package dependencies to download
-->
<SuppressMetaPackage Include="NETStandard.Library" />
<PackageFile Include="buildTransitive\System.Security.Cryptography.Pkcs.targets"
TargetPath="buildTransitive\netcoreapp2.0" />
<File Include="$(PlaceholderFile)"
TargetPath="buildTransitive\netcoreapp3.0" />
<!-- Exclude TFMs that aren't supported by the package anymore from validation. -->
<ExcludeHarvestedSupportedFramework Include="netcoreapp1.0;netcoreapp1.1;netcore50;uap10.0;net46" />
</ItemGroup>
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets))" />
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Project InitialTargets="_ErrorForSystemSecurityCryptographyPkcsOnNetCoreApp20">
<Target Name="_ErrorForSystemSecurityCryptographyPkcsOnNetCoreApp20"
Condition="'$(SuppressTfmSupportBuildWarnings)' == ''">
<Error Text="System.Security.Cryptography.Pkcs doesn't support netcoreapp2.0. Consider updating your TargetFramework to netcoreapp3.1 or later." />
</Target>
</Project>
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>$(NetCoreAppCurrent);netcoreapp3.0;netstandard2.1;net461</TargetFrameworks>
<TargetFrameworks>$(NetCoreAppCurrent);netcoreapp3.0;netstandard2.1;netstandard2.0;net461</TargetFrameworks>
<ExcludeCurrentNetCoreAppFromPackage>true</ExcludeCurrentNetCoreAppFromPackage>
<Nullable>enable</Nullable>
</PropertyGroup>
<!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. -->
<PropertyGroup>
<IsPartialFacadeAssembly Condition="$(TargetFramework.StartsWith('net4'))">true</IsPartialFacadeAssembly>
<!-- Currently the netstandard build is locked to the net472 API -->
<AssemblyVersion Condition="$(TargetFramework.StartsWith('netstandard'))">4.0.4.0</AssemblyVersion>
<IsPartialFacadeAssembly Condition="'$(TargetFramework)' == 'net461'">true</IsPartialFacadeAssembly>
</PropertyGroup>
<ItemGroup>
<Compile Include="System.Security.Cryptography.Pkcs.cs" />
<Compile Include="System.Security.Cryptography.Pkcs.netcoreapp.cs" Condition="!$(TargetFramework.StartsWith('net4'))" />
<Compile Include="System.Security.Cryptography.Pkcs.netcoreapp.cs" Condition="'$(TargetFramework)' != 'net461' and '$(TargetFramework)' != 'netstandard2.0'" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.StartsWith('net4'))">
<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
<Reference Include="System.Security" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == '$(NetCoreAppCurrent)'">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<UsePackageTargetRuntimeDefaults Condition="'$(IsPartialFacadeAssembly)' != 'true'">true</UsePackageTargetRuntimeDefaults>
<IncludeDllSafeSearchPathAttribute>true</IncludeDllSafeSearchPathAttribute>
<NoWarn>$(NoWarn);CA5384</NoWarn>
<Nullable>enable</Nullable>
Expand All @@ -12,8 +11,7 @@
<PropertyGroup>
<IsPartialFacadeAssembly Condition="$(TargetFramework.StartsWith('net4'))">true</IsPartialFacadeAssembly>
<OmitResources Condition="$(TargetFramework.StartsWith('net4'))">true</OmitResources>
<!-- Currently the netstandard build is locked to the net472 API -->
<AssemblyVersion Condition="$(TargetFramework.StartsWith('netstandard'))">4.0.4.0</AssemblyVersion>
<UsePackageTargetRuntimeDefaults Condition="'$(IsPartialFacadeAssembly)' != 'true'">true</UsePackageTargetRuntimeDefaults>
</PropertyGroup>
<Import Project="$(CommonPath)System\Security\Cryptography\Asn1\AsnXml.targets" Condition="'$(IsPartialFacadeAssembly)' != 'true'" />
<Import Project="$(CommonPath)System\Security\Cryptography\Asn1Reader\System.Security.Cryptography.Asn1Reader.Shared.projitems" Condition="'$(IsPartialFacadeAssembly)' != 'true'" />
Expand Down Expand Up @@ -640,9 +638,6 @@
<PackageReference Include="System.Buffers" Version="$(SystemBuffersVersion)" />
<PackageReference Include="System.Memory" Version="$(SystemMemoryVersion)" />
<ProjectReference Include="$(LibrariesProjectRoot)System.Runtime.CompilerServices.Unsafe\src\System.Runtime.CompilerServices.Unsafe.ilproj" />
<!-- Ref assembly for netstandard2.0 isn't live built anymore. -->
<PackageDownload Include="$(MSBuildProjectName)" Version="[$(SystemSecurityCryptographyPkcsVersion)]" />
<ResolvedMatchingContract Include="$(NuGetPackageRoot)$(MSBuildProjectName.ToLowerInvariant())\$(SystemSecurityCryptographyPkcsVersion)\ref\$(TargetFramework)\$(MSBuildProjectName).dll" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I was looking at when this was introduced and found

<PackageReference Include="System.Security.Cryptography.Pkcs" Version="$(SystemSecurityCryptographyPkcsVersion)" />

Might be an opportunity for further cleanup, removing SystemSecurityCryptographyPkcsVersion entirely. Not necessarily as part of this PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only grabbed for "$(ProjectName).csproj" but not for "$(ProjectName)" which is why I missed this dependent project. Thanks for the great feedback. I submitted #52239 to address this.

</ItemGroup>
<ItemGroup Condition="!$(TargetFramework.StartsWith('$(NetCoreAppCurrent)'))">
<PackageReference Include="System.Security.Cryptography.Cng" Version="$(SystemSecurityCryptographyCngVersion)" />
Expand Down