From c645a5bb7388dc1d6f64f158d03d3602c65d4e5f Mon Sep 17 00:00:00 2001 From: Eirik Tsarpalis Date: Wed, 6 Nov 2019 23:10:27 +0000 Subject: [PATCH] Centralize fix for nullability annotations in netstandard builds (dotnet/corefx#42391) * centralize fix for nullability in netstandard2.0 * remove project property from conditional * Revert "remove project property from conditional" This reverts commit dotnet/corefx@ffc54a15a4589381b3bd78aa5b3ef020c8a1c75e. * move to Directory.Build.targets * Add netcoreapp2.x check * update logic for projects that use nullable annotations without it being enabled * add nullable property to System.Data.SqlClient * address newly added annotated project * add nullable annotations to System.Security.Cryptography.Pkcs Commit migrated from https://github.com/dotnet/corefx/commit/e52be6965496af9de49de585e6c62bdb0915c775 --- src/libraries/Directory.Build.targets | 12 ++++++++++++ .../Microsoft.Diagnostics.Tracing.EventSource.Redist.csproj | 5 ++--- .../Microsoft.IO.Redist/src/Microsoft.IO.Redist.csproj | 4 ++-- .../System.Data.SqlClient/src/System.Data.SqlClient.csproj | 7 +------ .../src/System.IO.FileSystem.AccessControl.csproj | 7 +------ .../System.IO.Pipelines/src/System.IO.Pipelines.csproj | 4 +--- .../src/System.Resources.Extensions.csproj | 4 ++-- .../src/System.Security.Cryptography.Pkcs.csproj | 5 ++--- .../src/System.Text.Encoding.CodePages.csproj | 4 ---- .../src/System.Text.Encodings.Web.csproj | 4 ---- .../ref/System.Threading.Channels.csproj | 4 +--- .../src/System.Threading.Channels.csproj | 4 +--- 12 files changed, 25 insertions(+), 39 deletions(-) diff --git a/src/libraries/Directory.Build.targets b/src/libraries/Directory.Build.targets index 345ac4a..42ec782 100644 --- a/src/libraries/Directory.Build.targets +++ b/src/libraries/Directory.Build.targets @@ -7,6 +7,18 @@ + + + + + + $(DefineConstants),INTERNAL_NULLABLE_ATTRIBUTES + + + + + + - - - @@ -88,4 +83,4 @@ - \ No newline at end of file + diff --git a/src/libraries/System.IO.Pipelines/src/System.IO.Pipelines.csproj b/src/libraries/System.IO.Pipelines/src/System.IO.Pipelines.csproj index 024eff9..955bc03 100644 --- a/src/libraries/System.IO.Pipelines/src/System.IO.Pipelines.csproj +++ b/src/libraries/System.IO.Pipelines/src/System.IO.Pipelines.csproj @@ -1,7 +1,6 @@  netcoreapp-Debug;netcoreapp-Release;netcoreapp3.0-Debug;netcoreapp3.0-Release;netstandard2.0-Debug;netstandard2.0-Release - $(DefineConstants);INTERNAL_NULLABLE_ATTRIBUTES enable @@ -45,7 +44,6 @@ - @@ -60,4 +58,4 @@ - \ No newline at end of file + diff --git a/src/libraries/System.Resources.Extensions/src/System.Resources.Extensions.csproj b/src/libraries/System.Resources.Extensions/src/System.Resources.Extensions.csproj index a6ea52e..14787f0 100644 --- a/src/libraries/System.Resources.Extensions/src/System.Resources.Extensions.csproj +++ b/src/libraries/System.Resources.Extensions/src/System.Resources.Extensions.csproj @@ -2,7 +2,8 @@ true netstandard2.0-Debug;netstandard2.0-Release - $(DefineConstants);RESOURCES_EXTENSIONS;INTERNAL_NULLABLE_ATTRIBUTES + $(DefineConstants);RESOURCES_EXTENSIONS + annotations @@ -13,7 +14,6 @@ - diff --git a/src/libraries/System.Security.Cryptography.Pkcs/src/System.Security.Cryptography.Pkcs.csproj b/src/libraries/System.Security.Cryptography.Pkcs/src/System.Security.Cryptography.Pkcs.csproj index 02c1635..d019d4d 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/src/System.Security.Cryptography.Pkcs.csproj +++ b/src/libraries/System.Security.Cryptography.Pkcs/src/System.Security.Cryptography.Pkcs.csproj @@ -6,8 +6,8 @@ true true $(NoWarn);CS1574;CS3016;CA5379;CA5384 + annotations net461-Windows_NT-Debug;net461-Windows_NT-Release;netcoreapp-Debug;netcoreapp-Release;netcoreapp-Windows_NT-Debug;netcoreapp-Windows_NT-Release;netcoreapp3.0-Debug;netcoreapp3.0-Release;netcoreapp3.0-Windows_NT-Debug;netcoreapp3.0-Windows_NT-Release;netfx-Windows_NT-Debug;netfx-Windows_NT-Release;netstandard2.0-Debug;netstandard2.0-Release;netstandard2.0-Windows_NT-Debug;netstandard2.0-Windows_NT-Release;netstandard2.1-Debug;netstandard2.1-Release;netstandard2.1-Windows_NT-Debug;netstandard2.1-Windows_NT-Release - $(DefineConstants);INTERNAL_NULLABLE_ATTRIBUTES @@ -54,7 +54,6 @@ - Internal\Cryptography\Helpers.cs @@ -707,4 +706,4 @@ - \ No newline at end of file + diff --git a/src/libraries/System.Text.Encoding.CodePages/src/System.Text.Encoding.CodePages.csproj b/src/libraries/System.Text.Encoding.CodePages/src/System.Text.Encoding.CodePages.csproj index 4372dfd..156986e 100644 --- a/src/libraries/System.Text.Encoding.CodePages/src/System.Text.Encoding.CodePages.csproj +++ b/src/libraries/System.Text.Encoding.CodePages/src/System.Text.Encoding.CodePages.csproj @@ -4,7 +4,6 @@ enable netstandard2.0;net461 - $(DefineConstants);INTERNAL_NULLABLE_ATTRIBUTES netcoreapp-Windows_NT-Debug;netcoreapp-Windows_NT-Release;netcoreapp2.0-Windows_NT-Debug;netcoreapp2.0-Windows_NT-Release;netstandard2.0-Debug;netstandard2.0-Release;netstandard2.0-Windows_NT-Debug;netstandard2.0-Windows_NT-Release @@ -29,9 +28,6 @@ - - - diff --git a/src/libraries/System.Text.Encodings.Web/src/System.Text.Encodings.Web.csproj b/src/libraries/System.Text.Encodings.Web/src/System.Text.Encodings.Web.csproj index db96caa..9d1cf95 100644 --- a/src/libraries/System.Text.Encodings.Web/src/System.Text.Encodings.Web.csproj +++ b/src/libraries/System.Text.Encodings.Web/src/System.Text.Encodings.Web.csproj @@ -2,7 +2,6 @@ true netcoreapp-Debug;netcoreapp-Release;netcoreapp3.0-Debug;netcoreapp3.0-Release;netstandard2.0-Debug;netstandard2.0-Release;netstandard2.1-Debug;netstandard2.1-Release - $(DefineConstants);INTERNAL_NULLABLE_ATTRIBUTES enable @@ -35,9 +34,6 @@ System\Text\UnicodeUtility.cs - - - diff --git a/src/libraries/System.Threading.Channels/ref/System.Threading.Channels.csproj b/src/libraries/System.Threading.Channels/ref/System.Threading.Channels.csproj index 43dce86..e4e1b54 100644 --- a/src/libraries/System.Threading.Channels/ref/System.Threading.Channels.csproj +++ b/src/libraries/System.Threading.Channels/ref/System.Threading.Channels.csproj @@ -1,7 +1,6 @@ netcoreapp-Debug;netcoreapp-Release;netcoreapp3.0-Debug;netcoreapp3.0-Release;netstandard2.0-Debug;netstandard2.0-Release;netstandard1.3-Debug;netstandard1.3-Release - $(DefineConstants);INTERNAL_NULLABLE_ATTRIBUTES enable @@ -11,7 +10,6 @@ - @@ -24,4 +22,4 @@ - \ No newline at end of file + diff --git a/src/libraries/System.Threading.Channels/src/System.Threading.Channels.csproj b/src/libraries/System.Threading.Channels/src/System.Threading.Channels.csproj index 90578d8..bac5f58 100644 --- a/src/libraries/System.Threading.Channels/src/System.Threading.Channels.csproj +++ b/src/libraries/System.Threading.Channels/src/System.Threading.Channels.csproj @@ -1,7 +1,6 @@  netcoreapp-Debug;netcoreapp-Release;netcoreapp3.0-Debug;netcoreapp3.0-Release;netstandard2.0-Debug;netstandard2.0-Release;netstandard1.3-Debug;netstandard1.3-Release - $(DefineConstants);INTERNAL_NULLABLE_ATTRIBUTES enable @@ -25,7 +24,6 @@ - @@ -41,4 +39,4 @@ - \ No newline at end of file + -- 2.7.4