Use Roslyn apis to generate Platform Not Supported Assemblies (#40296)
authorAnirudh Agnihotry <anirudhagnihotry098@gmail.com>
Tue, 18 Aug 2020 00:01:27 +0000 (17:01 -0700)
committerGitHub <noreply@github.com>
Tue, 18 Aug 2020 00:01:27 +0000 (17:01 -0700)
* fixes on the runtime side

* address feedback

* update arcade version

* merge conflicts

* update the version

eng/Version.Details.xml
eng/Versions.props
src/libraries/System.ComponentModel.Composition/src/System.ComponentModel.Composition.csproj
src/libraries/System.Net.NameResolution/src/System.Net.NameResolution.csproj
src/libraries/System.Security.Cryptography.Algorithms/src/System.Security.Cryptography.Algorithms.csproj
src/libraries/System.Security.Cryptography.Cng/pkg/System.Security.Cryptography.Cng.pkgproj
src/libraries/System.Security.Cryptography.Cng/src/System.Security.Cryptography.Cng.csproj
src/libraries/System.Security.Cryptography.OpenSsl/pkg/System.Security.Cryptography.OpenSsl.pkgproj
src/libraries/System.Security.Cryptography.OpenSsl/src/System.Security.Cryptography.OpenSsl.csproj
src/libraries/System.Windows.Extensions/src/ExcludeApiList.PNSE.txt [deleted file]
src/libraries/System.Windows.Extensions/src/System.Windows.Extensions.csproj

index 80f1bd8..ee62cbe 100644 (file)
       <Uri>https://github.com/dotnet/arcade</Uri>
       <Sha>ea8f37e8982dc22022b33c5e151081ad04d923a6</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.DotNet.GenAPI" Version="5.0.0-beta.20407.3">
+    <Dependency Name="Microsoft.DotNet.GenAPI" Version="5.0.0-beta.20417.5">
       <Uri>https://github.com/dotnet/arcade</Uri>
-      <Sha>ea8f37e8982dc22022b33c5e151081ad04d923a6</Sha>
+      <Sha>d7e47e893c86c3c9f4e8d8129b2d45516a69bc41</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.DotNet.GenFacades" Version="5.0.0-beta.20407.3">
+    <Dependency Name="Microsoft.DotNet.GenFacades" Version="5.0.0-beta.20417.5">
       <Uri>https://github.com/dotnet/arcade</Uri>
-      <Sha>ea8f37e8982dc22022b33c5e151081ad04d923a6</Sha>
+      <Sha>d7e47e893c86c3c9f4e8d8129b2d45516a69bc41</Sha>
     </Dependency>
     <Dependency Name="Microsoft.DotNet.XUnitExtensions" Version="5.0.0-beta.20407.3">
       <Uri>https://github.com/dotnet/arcade</Uri>
index 059ee99..c4e792f 100644 (file)
@@ -52,8 +52,8 @@
     <MicrosoftDotNetApiCompatVersion>5.0.0-beta.20407.3</MicrosoftDotNetApiCompatVersion>
     <MicrosoftDotNetBuildTasksFeedVersion>5.0.0-beta.20407.3</MicrosoftDotNetBuildTasksFeedVersion>
     <MicrosoftDotNetCodeAnalysisVersion>5.0.0-beta.20407.3</MicrosoftDotNetCodeAnalysisVersion>
-    <MicrosoftDotNetGenAPIVersion>5.0.0-beta.20407.3</MicrosoftDotNetGenAPIVersion>
-    <MicrosoftDotNetGenFacadesVersion>5.0.0-beta.20407.3</MicrosoftDotNetGenFacadesVersion>
+    <MicrosoftDotNetGenAPIVersion>5.0.0-beta.20417.5</MicrosoftDotNetGenAPIVersion>
+    <MicrosoftDotNetGenFacadesVersion>5.0.0-beta.20417.5</MicrosoftDotNetGenFacadesVersion>
     <MicrosoftDotNetXUnitExtensionsVersion>5.0.0-beta.20407.3</MicrosoftDotNetXUnitExtensionsVersion>
     <MicrosoftDotNetXUnitConsoleRunnerVersion>2.5.1-beta.20407.3</MicrosoftDotNetXUnitConsoleRunnerVersion>
     <MicrosoftDotNetBuildTasksPackagingVersion>5.0.0-beta.20412.1</MicrosoftDotNetBuildTasksPackagingVersion>
index 519abad..98e9003 100644 (file)
@@ -9,10 +9,8 @@
     <GeneratePlatformNotSupportedAssemblyMessage Condition="'$(TargetFramework)' == 'netstandard2.0'">SR.PlatformNotSupported_ComponentModel_Composition</GeneratePlatformNotSupportedAssemblyMessage>
     <NoWarn Condition="'$(TargetFramework)' == 'netcoreapp2.0'">$(NoWarn);nullable</NoWarn>
   </PropertyGroup>
-  <ItemGroup>
-    <Compile Include="TypeForwards.cs" />
-  </ItemGroup>
   <ItemGroup Condition="'$(TargetFramework)' != 'netstandard2.0'">
+    <Compile Include="TypeForwards.cs" />
     <Compile Include="Microsoft\Internal\AttributeServices.cs" />
     <Compile Include="Microsoft\Internal\Collections\CollectionServices.cs" />
     <Compile Include="Microsoft\Internal\Collections\CollectionServices.CollectionOfObject.cs" />
index 27f4e95..8fff5c1 100644 (file)
@@ -6,7 +6,7 @@
   </PropertyGroup>
   <PropertyGroup>
     <GeneratePlatformNotSupportedAssemblyMessage Condition="'$(TargetsBrowser)' == 'true'">SR.SystemNetNameResolution_PlatformNotSupported</GeneratePlatformNotSupportedAssemblyMessage>
-    <GeneratePlatformNotSupportedAdditionalParameters Condition="'$(TargetsBrowser)' == 'true'">--exclude-api-list ExcludeApiList.PNSE.Browser.txt</GeneratePlatformNotSupportedAdditionalParameters>
+    <ApiExclusionListPath Condition="'$(TargetsBrowser)' == 'true'">ExcludeApiList.PNSE.Browser.txt</ApiExclusionListPath>
   </PropertyGroup>
   <ItemGroup Condition="'$(TargetsBrowser)' != 'true'">
     <Compile Include="System\Net\Dns.cs" />
index cf86581..80fa4fb 100644 (file)
@@ -10,7 +10,7 @@
   <Import Project="$(CommonPath)System\Security\Cryptography\Asn1Reader\System.Security.Cryptography.Asn1Reader.Shared.projitems" />
   <PropertyGroup>
     <GeneratePlatformNotSupportedAssemblyMessage Condition="'$(TargetsBrowser)' == 'true'">SR.SystemSecurityCryptographyAlgorithms_PlatformNotSupported</GeneratePlatformNotSupportedAssemblyMessage>
-    <GeneratePlatformNotSupportedAdditionalParameters Condition="'$(TargetsBrowser)' == 'true'">--exclude-api-list ExcludeApiList.PNSE.Browser.txt</GeneratePlatformNotSupportedAdditionalParameters>
+    <ApiExclusionListPath Condition="'$(TargetsBrowser)' == 'true'">ExcludeApiList.PNSE.Browser.txt</ApiExclusionListPath>
   </PropertyGroup>
   <ItemGroup Condition="'$(TargetsBrowser)' != 'true'">
     <Compile Include="Internal\Cryptography\AesImplementation.cs" />
index bff5673..66cb2ac 100644 (file)
@@ -16,6 +16,7 @@
     <HarvestIncludePaths Include="ref/netstandard1.4;runtimes/win/lib/netstandard1.4;lib/netstandard1.4" />
     <HarvestIncludePaths Include="ref/netstandard1.6;runtimes/win/lib/netstandard1.6;lib/netstandard1.6" />
     <HarvestIncludePaths Include="ref/netstandard2.0" />
+    <HarvestIncludePaths Include="lib/netstandard2.0" />
     <HarvestIncludePaths Include="ref/netcoreapp2.0;runtimes/win/lib/netcoreapp2.0" />
     <HarvestIncludePaths Include="ref/netcoreapp2.1;lib/netcoreapp2.1;runtimes/win/lib/netcoreapp2.1" />
     <!-- this package is part of the implementation closure of NETStandard.Library
index f689e38..74dac99 100644 (file)
@@ -2,7 +2,7 @@
   <PropertyGroup>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
     <GenFacadesIgnoreMissingTypes Condition="'$(TargetFramework)' == 'net461'">true</GenFacadesIgnoreMissingTypes>
-    <TargetFrameworks>$(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent);netstandard2.0;netstandard2.1;net461-Windows_NT;netcoreapp3.0-Windows_NT;netcoreapp3.0;net462-Windows_NT;net47-Windows_NT</TargetFrameworks>
+    <TargetFrameworks>$(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent);netstandard2.1;net461-Windows_NT;netcoreapp3.0-Windows_NT;netcoreapp3.0;net462-Windows_NT;net47-Windows_NT</TargetFrameworks>
     <ExcludeCurrentNetCoreAppFromPackage>true</ExcludeCurrentNetCoreAppFromPackage>
     <Nullable>enable</Nullable>
   </PropertyGroup>
@@ -13,7 +13,6 @@
   </PropertyGroup>
   <PropertyGroup Condition="'$(TargetsWindows)' != 'true'">
     <GeneratePlatformNotSupportedAssemblyMessage>SR.PlatformNotSupported_CryptographyCng</GeneratePlatformNotSupportedAssemblyMessage>
-    <AssemblyVersion Condition="'$(TargetFramework)' == 'netstandard2.0'">4.3.0.0</AssemblyVersion>
   </PropertyGroup>
   <Import Project="$(CommonPath)System\Security\Cryptography\Asn1\AsnXml.targets" Condition="'$(IsPartialFacadeAssembly)' != 'true' and '$(TargetsWindows)' == 'true'" />
   <Import Project="$(CommonPath)System\Security\Cryptography\Asn1Reader\System.Security.Cryptography.Asn1Reader.Shared.projitems" Condition="'$(IsPartialFacadeAssembly)' != 'true' and '$(TargetsWindows)' == 'true'" />
     <Reference Include="System.Text.Encoding.Extensions" />
     <Reference Include="System.Threading" />
   </ItemGroup>
-  <ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
-    <PackageReference Include="System.Buffers" Version="$(SystemBuffersVersion)" />
-    <PackageReference Include="System.Memory" Version="$(SystemMemoryVersion)" />
-    <!-- Ref assembly for netstandard2.0 isn't live built anymore. -->
-    <PackageDownload Include="$(MSBuildProjectName)" Version="[$(SystemSecurityCryptographyCngVersion)]" />
-    <ResolvedMatchingContract Include="$(NuGetPackageRoot)$(MSBuildProjectName.ToLowerInvariant())\$(SystemSecurityCryptographyCngVersion)\ref\$(TargetFramework)\$(MSBuildProjectName).dll" />
-  </ItemGroup>
 </Project>
index fd148c3..e934cc2 100644 (file)
@@ -7,6 +7,7 @@
     <ProjectReference Include="..\src\System.Security.Cryptography.OpenSsl.csproj" />
     <HarvestIncludePaths Include="ref/netstandard1.6;lib/netstandard1.6;runtimes/unix/lib/netstandard1.6" />
     <HarvestIncludePaths Include="ref/netstandard2.0" />
+    <HarvestIncludePaths Include="lib/netstandard2.0" />
     <HarvestIncludePaths Include="ref/netcoreapp2.0;runtimes/unix/lib/netcoreapp2.0" />
     <HarvestIncludePaths Include="ref/netcoreapp2.1;lib/netcoreapp2.1;runtimes/unix/lib/netcoreapp2.1" />
     <!-- this package is part of the implementation closure of NETStandard.Library
index 54ff81d..5c402ff 100644 (file)
@@ -1,13 +1,13 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
-    <TargetFrameworks>$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser;$(NetCoreAppCurrent);netcoreapp3.0-Unix;netcoreapp3.0;netstandard2.0;net47</TargetFrameworks>
+    <TargetFrameworks>$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser;$(NetCoreAppCurrent);netcoreapp3.0-Unix;netcoreapp3.0;net47</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>
-    <AssemblyVersion Condition="'$(TargetFramework)' == 'netstandard2.0' OR $(TargetFramework.StartsWith('net4'))">4.1.0.0</AssemblyVersion>
+    <AssemblyVersion Condition="$(TargetFramework.StartsWith('net4'))">4.1.0.0</AssemblyVersion>
     <!-- We need to build against net47 because that is where ECParameters got added inbox. We ship as net461 in order to not require
     the facades when the package is restored. -->
     <PackageTargetFramework Condition="$(TargetFramework.StartsWith('net4'))">net461</PackageTargetFramework>
   <ItemGroup Condition="$(TargetFramework.StartsWith('net4'))">
     <SuppressPackageTargetFrameworkCompatibility Include="net461" />
   </ItemGroup>
-  <ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
-    <!-- Ref assembly for netstandard2.0 isn't live built anymore. -->
-    <PackageDownload Include="$(MSBuildProjectName)" Version="[$(SystemSecurityCryptographyOpenSslVersion)]" />
-    <ResolvedMatchingContract Include="$(NuGetPackageRoot)$(MSBuildProjectName.ToLowerInvariant())\$(SystemSecurityCryptographyOpenSslVersion)\ref\$(TargetFramework)\$(MSBuildProjectName).dll" />
-  </ItemGroup>
 </Project>
diff --git a/src/libraries/System.Windows.Extensions/src/ExcludeApiList.PNSE.txt b/src/libraries/System.Windows.Extensions/src/ExcludeApiList.PNSE.txt
deleted file mode 100644 (file)
index 4537903..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-T:System.Drawing.FontConverter
-T:System.Drawing.FontConverter.FontNameConverter
-T:System.Drawing.FontConverter.FontUnitConverter
-T:System.Drawing.IconConverter
-T:System.Drawing.ImageConverter
-T:System.Drawing.ImageFormatConverter
-T:System.Drawing.Printing.MarginsConverter
index 178344c..68020c1 100644 (file)
@@ -6,12 +6,9 @@
   </PropertyGroup>
   <PropertyGroup Condition="'$(TargetsWindows)' != 'true'">
     <GeneratePlatformNotSupportedAssemblyMessage>SR.PlatformNotSupported_System_Windows_Extensions</GeneratePlatformNotSupportedAssemblyMessage>
-    <GeneratePlatformNotSupportedAdditionalParameters>--exclude-api-list ExcludeApiList.PNSE.txt</GeneratePlatformNotSupportedAdditionalParameters>
   </PropertyGroup>
-  <ItemGroup>
-    <Compile Include="TypeForwards.cs" />
-  </ItemGroup>
   <ItemGroup Condition="'$(TargetsWindows)' == 'true'">
+    <Compile Include="TypeForwards.cs" />
     <Compile Include="$(CommonPath)Interop\Windows\Crypt32\Interop.CertAddCertificateLinkToStore.cs"
              Link="Common\Interop\Windows\Crypt32\Interop.CertAddCertificateLinkToStore.cs" />
     <Compile Include="$(CommonPath)Interop\Windows\Crypt32\Interop.CertCloseStore.cs"