From d81578a8817f56b68b84436b0d0ae2d3b2cc0026 Mon Sep 17 00:00:00 2001 From: Nirmal Guru Date: Thu, 11 Jun 2020 13:50:39 +0530 Subject: [PATCH 1/4] Remove trailing white-space and Fixup new-lines Only in Desktop SDK and WinFX props/targets Respect EditorConfig preferences for whitespace and new-lines --- .../Sdk/Sdk.props | 2 +- .../Sdk/Sdk.targets | 3 +- .../Microsoft.NET.Sdk.WindowsDesktop.props | 101 ++++++----- .../Microsoft.NET.Sdk.WindowsDesktop.targets | 72 ++++---- .../Microsoft.WinFX.targets | 169 ++++-------------- 5 files changed, 124 insertions(+), 223 deletions(-) diff --git a/packaging/Microsoft.NET.Sdk.WindowsDesktop/Sdk/Sdk.props b/packaging/Microsoft.NET.Sdk.WindowsDesktop/Sdk/Sdk.props index d9f409bd77b..8c33d1d597e 100644 --- a/packaging/Microsoft.NET.Sdk.WindowsDesktop/Sdk/Sdk.props +++ b/packaging/Microsoft.NET.Sdk.WindowsDesktop/Sdk/Sdk.props @@ -6,7 +6,7 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and created a backup copy. Incorrect changes to this file will make it impossible to load or build your projects from the command-line or the IDE. -Copyright (c) .NET Foundation. All rights reserved. +Copyright (c) .NET Foundation. All rights reserved. *********************************************************************************************** --> diff --git a/packaging/Microsoft.NET.Sdk.WindowsDesktop/Sdk/Sdk.targets b/packaging/Microsoft.NET.Sdk.WindowsDesktop/Sdk/Sdk.targets index c594b72551d..285d65252c9 100644 --- a/packaging/Microsoft.NET.Sdk.WindowsDesktop/Sdk/Sdk.targets +++ b/packaging/Microsoft.NET.Sdk.WindowsDesktop/Sdk/Sdk.targets @@ -6,7 +6,7 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and created a backup copy. Incorrect changes to this file will make it impossible to load or build your projects from the command-line or the IDE. -Copyright (c) .NET Foundation. All rights reserved. +Copyright (c) .NET Foundation. All rights reserved. *********************************************************************************************** --> @@ -14,4 +14,5 @@ Copyright (c) .NET Foundation. All rights reserved. + 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 98b2c24e13e..4fc676239b4 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 @@ -1,4 +1,5 @@ + @@ -19,9 +20,9 @@ - - - <_WpfCommonNetFxReference Include="WindowsBase" /> + <_WpfCommonNetFxReference Include="WindowsBase" /> <_WpfCommonNetFxReference Include="PresentationCore" /> <_WpfCommonNetFxReference Include="PresentationFramework" /> @@ -93,39 +92,38 @@ - + <_SDKImplicitReference Include="@(_WpfCommonNetFxReference)" Condition="'$(UseWPF)' == 'true'"/> - + <_SDKImplicitReference Include="System.Windows.Forms" Condition="('$(UseWindowsForms)' == 'true') " /> - + <_SDKImplicitReference Include="WindowsFormsIntegration" Condition=" ('$(UseWindowsForms)' == 'true') And ('$(UseWPF)' == 'true') "/> - - - - - + Microsoft.NET.Sdk project (and show a suppressible build-time warning). - + + <_UnsupportedNETCoreAppTargetFramework Include=".NETCoreApp,Version=v1.0" /> @@ -140,17 +138,17 @@ <_UnsupportedNETStandardTargetFramework Include="@(SupportedNETStandardTargetFramework)" /> @@ -159,7 +157,8 @@ - + + 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 644d4be4257..1eeb8ac196e 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 @@ -8,21 +8,19 @@ - <_WindowsDesktopSdkTargetFrameworkVersionFloor>3.0 - - @@ -30,24 +28,24 @@ - <_TargetFrameworkVersionValue>$([MSBuild]::ValueOrDefault('$(_TargetFrameworkVersionWithoutV)', '$(_UndefinedTargetFrameworkVersion)')) @@ -71,33 +69,30 @@ '$(_TargetFrameworkVersionValue)' >= '$(_WindowsDesktopSdkTargetFrameworkVersionFloor)'">true - + - = '$(_WindowsDesktopSdkTargetFrameworkVersionFloor)')"> - - - - @@ -133,29 +128,30 @@ - + --> - - + --> + diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Microsoft.WinFX.targets b/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Microsoft.WinFX.targets index bfd753c4ea5..cb8fb19ec9a 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Microsoft.WinFX.targets +++ b/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Microsoft.WinFX.targets @@ -19,10 +19,9 @@ true None - + - true - false 1.0.0.0 Installed true .g$(DefaultLanguageSourceExtension) - 5.1.2600.0 @@ -51,32 +47,24 @@ - true true true true - - - - AssignWinFXEmbeddedResource; $(PrepareResourceNamesDependsOn) - - - MarkupCompilePass1; AfterMarkupCompilePass1; @@ -85,38 +73,32 @@ MainResourcesGeneration; $(PrepareResourcesDependsOn) - - - DesignTimeMarkupCompilation; $(CoreCompileDependsOn) - - + - + - - @@ -142,52 +124,42 @@ - - - $(CompileDependsOn); _AfterCompileWinFXInternal - - - <_AfterCompileWinFXInternalDependsOn> PrepareResourcesForSatelliteAssemblies; MergeLocalizationDirectives; AfterCompileWinFX - - - + - - - @@ -326,7 +289,7 @@ XamlDebuggingInformation="$(XamlDebuggingInformation)" GeneratedBaml="" OutputPath="$(IntermediateOutputPath)" - ContinueOnError="false" + ContinueOnError="false" SupportCustomOutputPaths="$(IncludePackageReferencesDuringMarkupCompilation)"> - @@ -349,20 +311,15 @@ TaskParameter="GeneratedBaml" Condition="'$(_RequireMCPass2ForSatelliteAssemblyOnly)' == 'true'" /> - - - - - GenerateTemporaryTargetAssembly; MarkupCompilePass2; @@ -386,12 +341,10 @@ <_CompileTargetNameForLocalType Condition="'$(_CompileTargetNameForLocalType)' == ''">_CompileTemporaryAssembly - - + false <_ResolveProjectReferencesTargetName Condition="'$(IncludePackageReferencesDuringMarkupCompilation)' != 'false'">ResolveProjectReferences <_CompileTemporaryAssemblyDependsOn>BuildOnlySettings;ResolveKeySource;$(_ResolveProjectReferencesTargetName);CoreCompile - @@ -400,22 +353,20 @@ - - - + - + <_ParentProjectName>$([System.IO.Path]::GetFileNameWithoutExtension('$(MSBuildProjectFullPath)')) @@ -425,9 +376,10 @@ - @@ -449,20 +401,20 @@ <_DestGeneratedNuGetPropsAndTargets Include="$(BaseIntermediateOutputPath)project.assets.json"/> <_DestGeneratedNuGetPropsAndTargets Include="$(BaseIntermediateOutputPath)project.nuget.cache"/> - + @@ -471,18 +423,18 @@ <_IntermediateOutputPathNoTargetFrameworkOrRID>$([System.Text.RegularExpressions.Regex]::Replace($(_IntermediateOutputPathNoTargetFrameworkOrRID), "$(RuntimeIdentifier)\\$",, System.Text.RegularExpressions.RegexOptions.IgnoreCase)) - - <_IntermediateOutputPathNoTargetFrameworkOrRID>$([System.Text.RegularExpressions.Regex]::Replace($(_IntermediateOutputPathNoTargetFrameworkOrRID), "$(TargetFramework)\\$",, System.Text.RegularExpressions.RegexOptions.IgnoreCase)) - + - @@ -508,20 +459,18 @@ - - @@ -530,13 +479,10 @@ - - - - - true $(GenerateManifests) - - false - - Internet - - - $(TargetUrl)/$(TargetDeployManifestFileName) $(MSBuildProjectDirectory)\bin\$(Configuration)\$(TargetDeployManifestFileName) -debug "$(StartURL)" $(StartArguments) -DebugSecurityZoneURL "$(DebugSecurityZoneURL)" - @@ -644,14 +578,12 @@ - - - @@ -670,7 +602,6 @@ CertificateThumbprint="$(_DeploymentResolvedManifestCertificateThumbprint)" TimestampUrl="$(ManifestTimestampUrl)" SigningTarget="@(ApplicationManifest)"/> - @@ -688,7 +619,6 @@ CertificateThumbprint="$(_DeploymentResolvedManifestCertificateThumbprint)" TimestampUrl="$(ManifestTimestampUrl)" SigningTarget="@(DeployManifest)"/> - @@ -698,7 +628,6 @@ ================================================================ Classify baml and image files into different groups for Main assembly and satellite assembly respectively. - --> @@ -716,12 +645,10 @@ - - - - - <_ResourceNameInMainAssembly Condition="'$(UICulture)' == ''">$(AssemblyName).g.resources - <_ResourceNameInMainAssembly Condition="'$(UICulture)' != ''">$(AssemblyName).unlocalizable.g.resources - - - - @@ -782,11 +701,10 @@ $(IntermediateOutputPath)$(_ResourceNameInMainAssembly) - - - - - + @@ -915,7 +828,6 @@ Condition="'$(UICulture)' != ''"> - @@ -926,7 +838,6 @@ Condition="'@(NonResxWithCulture)' != ''"> - @@ -937,7 +848,6 @@ - @@ -946,7 +856,6 @@ Condition="'@(Page)' != '' or '@(ApplicationDefinition)' != ''"> - - + - + - + + From 609928a105a09314576930fc18c1ecb125d6040e Mon Sep 17 00:00:00 2001 From: Nirmal Guru Date: Thu, 11 Jun 2020 13:50:41 +0530 Subject: [PATCH 2/4] Rearrange WinFX import and add comments The MSBuild items & targets that were defined after the WinFX targets import doesn't depend on anything from the WinFX targets. So, it is safe and better to declare the import after those items and targets definitions. --- .../targets/Microsoft.NET.Sdk.WindowsDesktop.targets | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 1eeb8ac196e..335e662d5c7 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 @@ -70,8 +70,6 @@ - - + + From d84a8e298804c4752d7b22910b65162f111634ad Mon Sep 17 00:00:00 2001 From: Nirmal Guru Date: Fri, 8 May 2020 18:09:03 +0530 Subject: [PATCH 3/4] Don't import .NET Framework's implementation of WinFX targets When the SDK's implementation is being used. --- .../Microsoft.NET.Sdk.WindowsDesktop/Sdk/Sdk.props | 14 ++++++++++++-- .../Microsoft.NET.Sdk.WindowsDesktop.targets | 6 +++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/packaging/Microsoft.NET.Sdk.WindowsDesktop/Sdk/Sdk.props b/packaging/Microsoft.NET.Sdk.WindowsDesktop/Sdk/Sdk.props index 8c33d1d597e..c926ed1c462 100644 --- a/packaging/Microsoft.NET.Sdk.WindowsDesktop/Sdk/Sdk.props +++ b/packaging/Microsoft.NET.Sdk.WindowsDesktop/Sdk/Sdk.props @@ -15,10 +15,20 @@ Copyright (c) .NET Foundation. All rights reserved. <_MicrosoftWindowsDesktopSdkImported>true + + + false + + - true 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 335e662d5c7..edadf38f4b3 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 @@ -1,7 +1,7 @@ - <_MicrosoftNetSdkWindowsDesktop>true + <_MicrosoftNETSdkWindowsDesktop>true true true Wpf @@ -152,7 +152,7 @@ - - + + From cb0e62672c53fc0437ba27c0bca2267526cbed1e Mon Sep 17 00:00:00 2001 From: Nirmal Guru Date: Wed, 5 Aug 2020 09:36:33 +0530 Subject: [PATCH 4/4] Make the Framework WinFX targets import opt-out Currently there's no way to properly switch between NETFX's and CoreCLR's WinFX targets. This adds an opt-out, just in case, if we want to use the NETFX's WinFX targets instead. --- packaging/Microsoft.NET.Sdk.WindowsDesktop/Sdk/Sdk.props | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packaging/Microsoft.NET.Sdk.WindowsDesktop/Sdk/Sdk.props b/packaging/Microsoft.NET.Sdk.WindowsDesktop/Sdk/Sdk.props index c926ed1c462..697cd52fe21 100644 --- a/packaging/Microsoft.NET.Sdk.WindowsDesktop/Sdk/Sdk.props +++ b/packaging/Microsoft.NET.Sdk.WindowsDesktop/Sdk/Sdk.props @@ -19,9 +19,10 @@ Copyright (c) .NET Foundation. All rights reserved. Workaround: https://github.com/microsoft/msbuild/issues/4948 Disable .NET Framework's inbox WinFX targets when using the SDK, since, we really don't use it's build logic and is superseded by 'WindowsDesktop' SDK that provides it's own WinFX for both NETFX and CoreCLR targets. + Make it opt-out, just in case, if something fails or we don't want to use 'WindowsDesktop' SDK's version. --> - false + false