From 0d8dd220d5e85b63b942b52076f4a4614aae3f5c Mon Sep 17 00:00:00 2001 From: Igor Velikorossov Date: Mon, 31 May 2021 17:34:12 +1000 Subject: [PATCH 1/2] Ingest and import Windows Forms analyzer props Provide a mechanism to ingest Windows Forms specific analyzer props and targets into Microsoft.NET.Sdk.WindowsDesktop from Windows Forms transport package, and copy these files into `targets` folder of the SDK, so that the props files are resolved and imported when a developer builds a Windows Forms app. In the end the new props file will end up in a location similar to this: `C:\Program Files\dotnet\sdk\6.0.\Sdks\Microsoft.NET.Sdk.WindowsDesktop\targets\`. This work relates to https://github.com/dotnet/designs/pull/223, and acts as a workaround until https://github.com/dotnet/designs/pull/181 is approved and implemented. --- ....NET.Sdk.WindowsDesktop.ArchNeutral.csproj | 28 ++++++++++++++++++- .../Microsoft.NET.Sdk.WindowsDesktop.props | 3 ++ .../Microsoft.NET.Sdk.WindowsDesktop.targets | 3 ++ 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/packaging/Microsoft.NET.Sdk.WindowsDesktop/Microsoft.NET.Sdk.WindowsDesktop.ArchNeutral.csproj b/packaging/Microsoft.NET.Sdk.WindowsDesktop/Microsoft.NET.Sdk.WindowsDesktop.ArchNeutral.csproj index 275fd4a4cb9..ef86e36c422 100644 --- a/packaging/Microsoft.NET.Sdk.WindowsDesktop/Microsoft.NET.Sdk.WindowsDesktop.ArchNeutral.csproj +++ b/packaging/Microsoft.NET.Sdk.WindowsDesktop/Microsoft.NET.Sdk.WindowsDesktop.ArchNeutral.csproj @@ -1,4 +1,4 @@ - + {440d06b8-e3de-4c0d-ad25-cd4f43d836e1} net6.0 @@ -25,4 +25,30 @@ + + + + <_WinFormsNuGetPath>$(PkgMicrosoft_Private_Winforms) + <_WinFormsContentPath>$(_WinFormsNuGetPath)\sdk\dotnet-wpf\* + + + + + + + + + + + + <_WinFormsContent Include="$(_WinFormsContentPath)" /> + + + + diff --git a/packaging/Microsoft.NET.Sdk.WindowsDesktop/targets/Microsoft.NET.Sdk.WindowsDesktop.props b/packaging/Microsoft.NET.Sdk.WindowsDesktop/targets/Microsoft.NET.Sdk.WindowsDesktop.props index d04f9b04b58..32b555a5d4e 100644 --- a/packaging/Microsoft.NET.Sdk.WindowsDesktop/targets/Microsoft.NET.Sdk.WindowsDesktop.props +++ b/packaging/Microsoft.NET.Sdk.WindowsDesktop/targets/Microsoft.NET.Sdk.WindowsDesktop.props @@ -161,4 +161,7 @@ + + + diff --git a/packaging/Microsoft.NET.Sdk.WindowsDesktop/targets/Microsoft.NET.Sdk.WindowsDesktop.targets b/packaging/Microsoft.NET.Sdk.WindowsDesktop/targets/Microsoft.NET.Sdk.WindowsDesktop.targets index edadf38f4b3..7634aae5edb 100644 --- a/packaging/Microsoft.NET.Sdk.WindowsDesktop/targets/Microsoft.NET.Sdk.WindowsDesktop.targets +++ b/packaging/Microsoft.NET.Sdk.WindowsDesktop/targets/Microsoft.NET.Sdk.WindowsDesktop.targets @@ -155,4 +155,7 @@ + + + From 9c0757e7519cff48333b376866d417cd0e1da3b5 Mon Sep 17 00:00:00 2001 From: Igor Velikorossov Date: Mon, 7 Jun 2021 20:55:46 +1000 Subject: [PATCH 2/2] fixup! Ingest and import Windows Forms analyzer props --- eng/WindowsForms.targets | 19 ++++++++++++++++++ ....NET.Sdk.WindowsDesktop.ArchNeutral.csproj | 20 ++++--------------- 2 files changed, 23 insertions(+), 16 deletions(-) create mode 100644 eng/WindowsForms.targets diff --git a/eng/WindowsForms.targets b/eng/WindowsForms.targets new file mode 100644 index 00000000000..dfadeee59da --- /dev/null +++ b/eng/WindowsForms.targets @@ -0,0 +1,19 @@ + + + + + + + + <_WinFormsContent Include="$(_WinFormsContentPath)" /> + + + + + + diff --git a/packaging/Microsoft.NET.Sdk.WindowsDesktop/Microsoft.NET.Sdk.WindowsDesktop.ArchNeutral.csproj b/packaging/Microsoft.NET.Sdk.WindowsDesktop/Microsoft.NET.Sdk.WindowsDesktop.ArchNeutral.csproj index ef86e36c422..93a4505249a 100644 --- a/packaging/Microsoft.NET.Sdk.WindowsDesktop/Microsoft.NET.Sdk.WindowsDesktop.ArchNeutral.csproj +++ b/packaging/Microsoft.NET.Sdk.WindowsDesktop/Microsoft.NET.Sdk.WindowsDesktop.ArchNeutral.csproj @@ -1,4 +1,5 @@ - + + {440d06b8-e3de-4c0d-ad25-cd4f43d836e1} net6.0 @@ -27,6 +28,8 @@ + + <_WinFormsNuGetPath>$(PkgMicrosoft_Private_Winforms) <_WinFormsContentPath>$(_WinFormsNuGetPath)\sdk\dotnet-wpf\* @@ -36,19 +39,4 @@ - - - - - - <_WinFormsContent Include="$(_WinFormsContentPath)" /> - - - -