From d870ebcc01f730b5ca277f1beee83eb9cf8b5f1e Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Tue, 27 Apr 2021 16:52:47 +0200 Subject: [PATCH 1/8] Drawing: Replace harvested assets with live config Removing the netcoreapp2.0, netstandard2.0 and net461 configurations of System.Drawing.Common as these aren't built live anymore (harvested). Replace the netstandard2.0 and net461 harvested asset with live builds and stop supporting netcoreapp2.x. Bringing these assets back as the minimum supported set of platforms are ones that support netstandard2.0 and are still in support. Contributes to https://github.com/dotnet/runtime/issues/47530 --- .../Directory.Build.targets | 6 +++ .../pkg/System.Drawing.Common.pkgproj | 9 ++-- .../System.Drawing.Common.targets | 7 +++ .../ref/System.Drawing.Common.csproj | 14 +++-- .../ref/System.Drawing.Common.netstandard.cs | 54 +++++++++++++++++++ .../src/System.Drawing.Common.csproj | 14 ++--- 6 files changed, 91 insertions(+), 13 deletions(-) create mode 100644 src/libraries/System.Drawing.Common/Directory.Build.targets create mode 100644 src/libraries/System.Drawing.Common/pkg/buildTransitive/System.Drawing.Common.targets create mode 100644 src/libraries/System.Drawing.Common/ref/System.Drawing.Common.netstandard.cs diff --git a/src/libraries/System.Drawing.Common/Directory.Build.targets b/src/libraries/System.Drawing.Common/Directory.Build.targets new file mode 100644 index 00000000000000..3e682046d73ddc --- /dev/null +++ b/src/libraries/System.Drawing.Common/Directory.Build.targets @@ -0,0 +1,6 @@ + + + + 4.0.1.0 + + diff --git a/src/libraries/System.Drawing.Common/pkg/System.Drawing.Common.pkgproj b/src/libraries/System.Drawing.Common/pkg/System.Drawing.Common.pkgproj index 6754147288e20b..4a74eb0fadbae6 100644 --- a/src/libraries/System.Drawing.Common/pkg/System.Drawing.Common.pkgproj +++ b/src/libraries/System.Drawing.Common/pkg/System.Drawing.Common.pkgproj @@ -2,13 +2,14 @@ - netcoreapp3.0 + netcoreapp3.0;net461 - - - + + diff --git a/src/libraries/System.Drawing.Common/pkg/buildTransitive/System.Drawing.Common.targets b/src/libraries/System.Drawing.Common/pkg/buildTransitive/System.Drawing.Common.targets new file mode 100644 index 00000000000000..395a71b4e5e8e3 --- /dev/null +++ b/src/libraries/System.Drawing.Common/pkg/buildTransitive/System.Drawing.Common.targets @@ -0,0 +1,7 @@ + + + + + diff --git a/src/libraries/System.Drawing.Common/ref/System.Drawing.Common.csproj b/src/libraries/System.Drawing.Common/ref/System.Drawing.Common.csproj index c5678ab357925b..93dc1cf86f856f 100644 --- a/src/libraries/System.Drawing.Common/ref/System.Drawing.Common.csproj +++ b/src/libraries/System.Drawing.Common/ref/System.Drawing.Common.csproj @@ -1,15 +1,20 @@  - $(NetCoreAppCurrent);netcoreapp3.0 + $(NetCoreAppCurrent);netcoreapp3.0;netstandard2.0;net461 true true enable + + + true + - + + - + @@ -34,4 +39,7 @@ + + + diff --git a/src/libraries/System.Drawing.Common/ref/System.Drawing.Common.netstandard.cs b/src/libraries/System.Drawing.Common/ref/System.Drawing.Common.netstandard.cs new file mode 100644 index 00000000000000..671f9cbe6e75bf --- /dev/null +++ b/src/libraries/System.Drawing.Common/ref/System.Drawing.Common.netstandard.cs @@ -0,0 +1,54 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// ------------------------------------------------------------------------------ +// Changes to this file must follow the https://aka.ms/api-review process. +// ------------------------------------------------------------------------------ + +namespace System.Drawing +{ + public static partial class ColorTranslator + { + public static System.Drawing.Color FromHtml(string htmlColor) { throw null; } + public static System.Drawing.Color FromOle(int oleColor) { throw null; } + public static System.Drawing.Color FromWin32(int win32Color) { throw null; } + public static string ToHtml(System.Drawing.Color c) { throw null; } + public static int ToOle(System.Drawing.Color c) { throw null; } + public static int ToWin32(System.Drawing.Color c) { throw null; } + } + public static partial class SystemColors + { + public static System.Drawing.Color ActiveBorder { get { throw null; } } + public static System.Drawing.Color ActiveCaption { get { throw null; } } + public static System.Drawing.Color ActiveCaptionText { get { throw null; } } + public static System.Drawing.Color AppWorkspace { get { throw null; } } + public static System.Drawing.Color ButtonFace { get { throw null; } } + public static System.Drawing.Color ButtonHighlight { get { throw null; } } + public static System.Drawing.Color ButtonShadow { get { throw null; } } + public static System.Drawing.Color Control { get { throw null; } } + public static System.Drawing.Color ControlDark { get { throw null; } } + public static System.Drawing.Color ControlDarkDark { get { throw null; } } + public static System.Drawing.Color ControlLight { get { throw null; } } + public static System.Drawing.Color ControlLightLight { get { throw null; } } + public static System.Drawing.Color ControlText { get { throw null; } } + public static System.Drawing.Color Desktop { get { throw null; } } + public static System.Drawing.Color GradientActiveCaption { get { throw null; } } + public static System.Drawing.Color GradientInactiveCaption { get { throw null; } } + public static System.Drawing.Color GrayText { get { throw null; } } + public static System.Drawing.Color Highlight { get { throw null; } } + public static System.Drawing.Color HighlightText { get { throw null; } } + public static System.Drawing.Color HotTrack { get { throw null; } } + public static System.Drawing.Color InactiveBorder { get { throw null; } } + public static System.Drawing.Color InactiveCaption { get { throw null; } } + public static System.Drawing.Color InactiveCaptionText { get { throw null; } } + public static System.Drawing.Color Info { get { throw null; } } + public static System.Drawing.Color InfoText { get { throw null; } } + public static System.Drawing.Color Menu { get { throw null; } } + public static System.Drawing.Color MenuBar { get { throw null; } } + public static System.Drawing.Color MenuHighlight { get { throw null; } } + public static System.Drawing.Color MenuText { get { throw null; } } + public static System.Drawing.Color ScrollBar { get { throw null; } } + public static System.Drawing.Color Window { get { throw null; } } + public static System.Drawing.Color WindowFrame { get { throw null; } } + public static System.Drawing.Color WindowText { get { throw null; } } + } +} \ No newline at end of file diff --git a/src/libraries/System.Drawing.Common/src/System.Drawing.Common.csproj b/src/libraries/System.Drawing.Common/src/System.Drawing.Common.csproj index a0e1544cb8be00..12b36f7d60cd84 100644 --- a/src/libraries/System.Drawing.Common/src/System.Drawing.Common.csproj +++ b/src/libraries/System.Drawing.Common/src/System.Drawing.Common.csproj @@ -5,13 +5,14 @@ CS0618 $(DefineConstants);FEATURE_WINDOWS_SYSTEM_COLORS;FEATURE_SYSTEM_EVENTS true - $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent);netcoreapp3.0-windows;netcoreapp3.0-Unix;netcoreapp3.0 + $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent);netcoreapp3.0-windows;netcoreapp3.0-Unix;netcoreapp3.0;net461;netstandard2.0 true - true enable + - SR.SystemDrawingCommon_PlatformNotSupported + true + SR.SystemDrawingCommon_PlatformNotSupported @@ -360,10 +361,8 @@ placeholder.ico - + - - @@ -389,4 +388,7 @@ + + + From 8269619c80b438051fae0bac4e8e8fa1ed9802e5 Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Tue, 27 Apr 2021 20:23:56 +0200 Subject: [PATCH 2/8] Package errorID support docs --- docs/project/list-of-diagnostics.md | 11 +++++++++++ .../System.Drawing.Common/Directory.Build.targets | 6 ------ .../pkg/buildTransitive/System.Drawing.Common.targets | 10 +++++----- 3 files changed, 16 insertions(+), 11 deletions(-) delete mode 100644 src/libraries/System.Drawing.Common/Directory.Build.targets diff --git a/docs/project/list-of-diagnostics.md b/docs/project/list-of-diagnostics.md index 47ec2479688594..33bd138e259906 100644 --- a/docs/project/list-of-diagnostics.md +++ b/docs/project/list-of-diagnostics.md @@ -108,3 +108,14 @@ The diagnostic id values reserved for .NET Libraries analyzer warnings are `SYSL | __`SYSLIB1027`__ | *_`SYSLIB1024`-`SYSLIB1029` reserved for logging._* | | __`SYSLIB1028`__ | *_`SYSLIB1024`-`SYSLIB1029` reserved for logging._* | | __`SYSLIB1029`__ | *_`SYSLIB1024`-`SYSLIB1029` reserved for logging._* | + +## Package Support Errors + +The id values reserved for .NET Library packages which error on unsupported platforms are `SYSLIB9000` through `SYSLIB9999`. + +### Package Error codes (`SYSLIB9000` - `SYSLIB9999`) + +| Error ID | Description | +| :---------------- | :---------- | +| __`SYSLIB9000`__ | System.Speech doesn't support netcoreapp2.0. Consider updating your TargetFramework to netcoreapp2.1 or later. | +| __`SYSLIB9001`__ | System.Drawing.Common doesn't support netcoreapp2.x. Consider updating your TargetFramework to netcoreapp3.0 or later. | diff --git a/src/libraries/System.Drawing.Common/Directory.Build.targets b/src/libraries/System.Drawing.Common/Directory.Build.targets deleted file mode 100644 index 3e682046d73ddc..00000000000000 --- a/src/libraries/System.Drawing.Common/Directory.Build.targets +++ /dev/null @@ -1,6 +0,0 @@ - - - - 4.0.1.0 - - diff --git a/src/libraries/System.Drawing.Common/pkg/buildTransitive/System.Drawing.Common.targets b/src/libraries/System.Drawing.Common/pkg/buildTransitive/System.Drawing.Common.targets index 395a71b4e5e8e3..f0f7a1455faa1e 100644 --- a/src/libraries/System.Drawing.Common/pkg/buildTransitive/System.Drawing.Common.targets +++ b/src/libraries/System.Drawing.Common/pkg/buildTransitive/System.Drawing.Common.targets @@ -1,7 +1,7 @@ - - - + + + From 510de83715a0f3b08bb4abd0d30211864f74d685 Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Tue, 27 Apr 2021 20:25:52 +0200 Subject: [PATCH 3/8] Update list-of-diagnostics.md --- docs/project/list-of-diagnostics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/project/list-of-diagnostics.md b/docs/project/list-of-diagnostics.md index 33bd138e259906..5cbc8308b5a8d4 100644 --- a/docs/project/list-of-diagnostics.md +++ b/docs/project/list-of-diagnostics.md @@ -111,7 +111,7 @@ The diagnostic id values reserved for .NET Libraries analyzer warnings are `SYSL ## Package Support Errors -The id values reserved for .NET Library packages which error on unsupported platforms are `SYSLIB9000` through `SYSLIB9999`. +The id values reserved for .NET Library packages which error on unsupported platforms are `SYSLIB9000` through `SYSLIB9999`. ### Package Error codes (`SYSLIB9000` - `SYSLIB9999`) From b383834904a4b297f76730fd3b77a383214b7572 Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Wed, 28 Apr 2021 01:05:22 +0200 Subject: [PATCH 4/8] pkg fix and exclude unsupported apis --- .../pkg/System.Drawing.Common.pkgproj | 2 +- .../ref/System.Drawing.Common.cs | 3 --- .../ref/System.Drawing.Common.csproj | 4 +--- .../ref/System.Drawing.Common.netcoreapp.cs | 21 +++++++++++++++++++ .../src/System.Drawing.Common.csproj | 3 --- 5 files changed, 23 insertions(+), 10 deletions(-) create mode 100644 src/libraries/System.Drawing.Common/ref/System.Drawing.Common.netcoreapp.cs diff --git a/src/libraries/System.Drawing.Common/pkg/System.Drawing.Common.pkgproj b/src/libraries/System.Drawing.Common/pkg/System.Drawing.Common.pkgproj index 4a74eb0fadbae6..96aaf224ad16d6 100644 --- a/src/libraries/System.Drawing.Common/pkg/System.Drawing.Common.pkgproj +++ b/src/libraries/System.Drawing.Common/pkg/System.Drawing.Common.pkgproj @@ -2,7 +2,7 @@ - netcoreapp3.0;net461 + net461;uap10.0.16299;netcoreapp2.0;$(AllXamarinFrameworks) diff --git a/src/libraries/System.Drawing.Common/ref/System.Drawing.Common.cs b/src/libraries/System.Drawing.Common/ref/System.Drawing.Common.cs index e8531366f99bed..795297759344ec 100644 --- a/src/libraries/System.Drawing.Common/ref/System.Drawing.Common.cs +++ b/src/libraries/System.Drawing.Common/ref/System.Drawing.Common.cs @@ -418,7 +418,6 @@ internal Graphics() { } public int TextContrast { get { throw null; } set { } } public System.Drawing.Text.TextRenderingHint TextRenderingHint { get { throw null; } set { } } public System.Drawing.Drawing2D.Matrix Transform { get { throw null; } set { } } - public System.Numerics.Matrix3x2 TransformElements { get { throw null; } set { } } public System.Drawing.RectangleF VisibleClipBounds { get { throw null; } } public void AddMetafileComment(byte[] data) { } public System.Drawing.Drawing2D.GraphicsContainer BeginContainer() { throw null; } @@ -1660,9 +1659,7 @@ public Matrix() { } public Matrix(System.Drawing.Rectangle rect, System.Drawing.Point[] plgpts) { } public Matrix(System.Drawing.RectangleF rect, System.Drawing.PointF[] plgpts) { } public Matrix(float m11, float m12, float m21, float m22, float dx, float dy) { } - public Matrix(System.Numerics.Matrix3x2 matrix) { } public float[] Elements { get { throw null; } } - public System.Numerics.Matrix3x2 MatrixElements { get { throw null; } set { } } public bool IsIdentity { get { throw null; } } public bool IsInvertible { get { throw null; } } public float OffsetX { get { throw null; } } diff --git a/src/libraries/System.Drawing.Common/ref/System.Drawing.Common.csproj b/src/libraries/System.Drawing.Common/ref/System.Drawing.Common.csproj index 93dc1cf86f856f..012d4f7f39134e 100644 --- a/src/libraries/System.Drawing.Common/ref/System.Drawing.Common.csproj +++ b/src/libraries/System.Drawing.Common/ref/System.Drawing.Common.csproj @@ -11,6 +11,7 @@ + @@ -39,7 +40,4 @@ - - - diff --git a/src/libraries/System.Drawing.Common/ref/System.Drawing.Common.netcoreapp.cs b/src/libraries/System.Drawing.Common/ref/System.Drawing.Common.netcoreapp.cs new file mode 100644 index 00000000000000..f4fc55188f3d08 --- /dev/null +++ b/src/libraries/System.Drawing.Common/ref/System.Drawing.Common.netcoreapp.cs @@ -0,0 +1,21 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// ------------------------------------------------------------------------------ +// Changes to this file must follow the https://aka.ms/api-review process. +// ------------------------------------------------------------------------------ + +namespace System.Drawing +{ + public sealed partial class Graphics + { + public System.Numerics.Matrix3x2 TransformElements { get { throw null; } set { } } + } +} +namespace System.Drawing.Drawing2D +{ + public sealed partial class Matrix + { + public Matrix(System.Numerics.Matrix3x2 matrix) { } + public System.Numerics.Matrix3x2 MatrixElements { get { throw null; } set { } } + } +} diff --git a/src/libraries/System.Drawing.Common/src/System.Drawing.Common.csproj b/src/libraries/System.Drawing.Common/src/System.Drawing.Common.csproj index 12b36f7d60cd84..403cad31cdf5b0 100644 --- a/src/libraries/System.Drawing.Common/src/System.Drawing.Common.csproj +++ b/src/libraries/System.Drawing.Common/src/System.Drawing.Common.csproj @@ -388,7 +388,4 @@ - - - From 46da541a1cc2dceaeb99947e6f82285a93daeee7 Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Thu, 29 Apr 2021 11:41:00 +0200 Subject: [PATCH 5/8] Test facades on net48 and remove diagnostic ids --- docs/project/list-of-diagnostics.md | 13 +------------ .../buildTransitive/System.Drawing.Common.targets | 3 +-- .../tests/System.Drawing.Common.Tests.csproj | 2 +- 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/docs/project/list-of-diagnostics.md b/docs/project/list-of-diagnostics.md index 5cbc8308b5a8d4..a574922afdcfa6 100644 --- a/docs/project/list-of-diagnostics.md +++ b/docs/project/list-of-diagnostics.md @@ -107,15 +107,4 @@ The diagnostic id values reserved for .NET Libraries analyzer warnings are `SYSL | __`SYSLIB1026`__ | *_`SYSLIB1024`-`SYSLIB1029` reserved for logging._* | | __`SYSLIB1027`__ | *_`SYSLIB1024`-`SYSLIB1029` reserved for logging._* | | __`SYSLIB1028`__ | *_`SYSLIB1024`-`SYSLIB1029` reserved for logging._* | -| __`SYSLIB1029`__ | *_`SYSLIB1024`-`SYSLIB1029` reserved for logging._* | - -## Package Support Errors - -The id values reserved for .NET Library packages which error on unsupported platforms are `SYSLIB9000` through `SYSLIB9999`. - -### Package Error codes (`SYSLIB9000` - `SYSLIB9999`) - -| Error ID | Description | -| :---------------- | :---------- | -| __`SYSLIB9000`__ | System.Speech doesn't support netcoreapp2.0. Consider updating your TargetFramework to netcoreapp2.1 or later. | -| __`SYSLIB9001`__ | System.Drawing.Common doesn't support netcoreapp2.x. Consider updating your TargetFramework to netcoreapp3.0 or later. | +| __`SYSLIB1029`__ | *_`SYSLIB1024`-`SYSLIB1029` reserved for logging._* | \ No newline at end of file diff --git a/src/libraries/System.Drawing.Common/pkg/buildTransitive/System.Drawing.Common.targets b/src/libraries/System.Drawing.Common/pkg/buildTransitive/System.Drawing.Common.targets index f0f7a1455faa1e..fba8a5498c0c51 100644 --- a/src/libraries/System.Drawing.Common/pkg/buildTransitive/System.Drawing.Common.targets +++ b/src/libraries/System.Drawing.Common/pkg/buildTransitive/System.Drawing.Common.targets @@ -1,7 +1,6 @@ - + diff --git a/src/libraries/System.Drawing.Common/tests/System.Drawing.Common.Tests.csproj b/src/libraries/System.Drawing.Common/tests/System.Drawing.Common.Tests.csproj index e8f4d68133f0dd..426780cb891e1e 100644 --- a/src/libraries/System.Drawing.Common/tests/System.Drawing.Common.Tests.csproj +++ b/src/libraries/System.Drawing.Common/tests/System.Drawing.Common.Tests.csproj @@ -113,12 +113,12 @@ + - From 27002e5e9b99bd9cb2dba15a9e7f8d8496fcbba8 Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Thu, 29 Apr 2021 11:43:13 +0200 Subject: [PATCH 6/8] fix diag ids --- docs/project/list-of-diagnostics.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/project/list-of-diagnostics.md b/docs/project/list-of-diagnostics.md index a574922afdcfa6..201807436d45d9 100644 --- a/docs/project/list-of-diagnostics.md +++ b/docs/project/list-of-diagnostics.md @@ -106,5 +106,4 @@ The diagnostic id values reserved for .NET Libraries analyzer warnings are `SYSL | __`SYSLIB1025`__ | *_`SYSLIB1024`-`SYSLIB1029` reserved for logging._* | | __`SYSLIB1026`__ | *_`SYSLIB1024`-`SYSLIB1029` reserved for logging._* | | __`SYSLIB1027`__ | *_`SYSLIB1024`-`SYSLIB1029` reserved for logging._* | -| __`SYSLIB1028`__ | *_`SYSLIB1024`-`SYSLIB1029` reserved for logging._* | -| __`SYSLIB1029`__ | *_`SYSLIB1024`-`SYSLIB1029` reserved for logging._* | \ No newline at end of file +| __`SYSLIB1028`__ | *_`SYSLIB1024`-`SYSLIB1029` reserved for logging._* | \ No newline at end of file From a94164c5719d1dc6b87783a3fe6a5e7cee2f8ece Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Thu, 29 Apr 2021 11:43:53 +0200 Subject: [PATCH 7/8] ids again --- docs/project/list-of-diagnostics.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/project/list-of-diagnostics.md b/docs/project/list-of-diagnostics.md index 201807436d45d9..bd7fa9b30aee9d 100644 --- a/docs/project/list-of-diagnostics.md +++ b/docs/project/list-of-diagnostics.md @@ -106,4 +106,6 @@ The diagnostic id values reserved for .NET Libraries analyzer warnings are `SYSL | __`SYSLIB1025`__ | *_`SYSLIB1024`-`SYSLIB1029` reserved for logging._* | | __`SYSLIB1026`__ | *_`SYSLIB1024`-`SYSLIB1029` reserved for logging._* | | __`SYSLIB1027`__ | *_`SYSLIB1024`-`SYSLIB1029` reserved for logging._* | -| __`SYSLIB1028`__ | *_`SYSLIB1024`-`SYSLIB1029` reserved for logging._* | \ No newline at end of file +| __`SYSLIB1028`__ | *_`SYSLIB1024`-`SYSLIB1029` reserved for logging._* | +| __`SYSLIB1028`__ | *_`SYSLIB1024`-`SYSLIB1029` reserved for logging._* | +| __`SYSLIB1029`__ | *_`SYSLIB1024`-`SYSLIB1029` reserved for logging._* | From 551f5fca985a7a69c4329d71b534254ecce41f65 Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Thu, 29 Apr 2021 11:44:18 +0200 Subject: [PATCH 8/8] Ids last time... --- docs/project/list-of-diagnostics.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/project/list-of-diagnostics.md b/docs/project/list-of-diagnostics.md index bd7fa9b30aee9d..47ec2479688594 100644 --- a/docs/project/list-of-diagnostics.md +++ b/docs/project/list-of-diagnostics.md @@ -107,5 +107,4 @@ The diagnostic id values reserved for .NET Libraries analyzer warnings are `SYSL | __`SYSLIB1026`__ | *_`SYSLIB1024`-`SYSLIB1029` reserved for logging._* | | __`SYSLIB1027`__ | *_`SYSLIB1024`-`SYSLIB1029` reserved for logging._* | | __`SYSLIB1028`__ | *_`SYSLIB1024`-`SYSLIB1029` reserved for logging._* | -| __`SYSLIB1028`__ | *_`SYSLIB1024`-`SYSLIB1029` reserved for logging._* | | __`SYSLIB1029`__ | *_`SYSLIB1024`-`SYSLIB1029` reserved for logging._* |