From 093a8cec77177c18502d8f7a16ec047270a249bd Mon Sep 17 00:00:00 2001 From: David Denis Date: Mon, 13 May 2019 19:19:53 +0200 Subject: [PATCH 1/7] Make WinFX based projects buildable in Unix-like platforms The 'MarkupCompiler' sources in 'PresentationBuildTasks' uses hardcoded backslash '\' which leads to projects failing build in non-Windows platforms. This patch replaces the hardcoded backslash to a cross-platform friendly replacement with 'Path.DirectorySeparator'. NOTE: This only fixes in PBT and not anywhere else. --- .../MS/Internal/MarkupCompiler/MarkupCompiler.cs | 13 +++++-------- .../MS/Internal/Tasks/CompilerWrapper.cs | 4 ++-- .../MS/Internal/Tasks/IncrementalCompileAnalyzer.cs | 2 +- .../MS/Internal/Tasks/TaskHelper.cs | 4 +--- .../Build/Tasks/Windows/MarkupCompilePass1.cs | 10 +++++----- .../Build/Tasks/Windows/MarkupCompilePass2.cs | 11 +++++------ .../System/Windows/Markup/ReflectionHelper.cs | 2 +- .../IO/Packaging/Compoundfile/ContainerUtilities.cs | 2 +- 8 files changed, 21 insertions(+), 27 deletions(-) diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/MS/Internal/MarkupCompiler/MarkupCompiler.cs b/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/MS/Internal/MarkupCompiler/MarkupCompiler.cs index 76a0aa297a8..7f1b9a95204 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/MS/Internal/MarkupCompiler/MarkupCompiler.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/MS/Internal/MarkupCompiler/MarkupCompiler.cs @@ -480,14 +480,14 @@ private void Initialize(FileUnit sourceFile) // Prime the output directory if (TargetPath.Length > 0) { - // check for ending '\' - if (!TargetPath.EndsWith(ESCAPED_BACKSLASH, StringComparison.Ordinal)) + // check for ending Path.DirectorySeparatorChar + if (!TargetPath.EndsWith(string.Empty + Path.DirectorySeparatorChar, StringComparison.Ordinal)) { - TargetPath += ESCAPED_BACKSLASH; + TargetPath += Path.DirectorySeparatorChar; } } - int pathEndIndex = SourceFileInfo.RelativeSourceFilePath.LastIndexOf(ESCAPED_BACKSLASH, StringComparison.Ordinal); + int pathEndIndex = SourceFileInfo.RelativeSourceFilePath.LastIndexOf(string.Empty + Path.DirectorySeparatorChar, StringComparison.Ordinal); string targetPath = TargetPath + SourceFileInfo.RelativeSourceFilePath.Substring(0, pathEndIndex + 1); // Create if not already exists @@ -1573,7 +1573,7 @@ private string ParentFolderPrefix { string relPath = TargetPath.Substring(SourceFileInfo.SourcePath.Length); relPath += SourceFileInfo.RelativeSourceFilePath; - string[] dirs = relPath.Split(new Char[] { ESCAPED_BACKSLASH_CHAR }); + string[] dirs = relPath.Split(new Char[] { Path.DirectorySeparatorChar }); for (int i = 1; i < dirs.Length; i++) { parentFolderPrefix += PARENTFOLDER; @@ -3515,8 +3515,6 @@ internal string SubClass private const string VER = "V"; private const string COMPONENT = "component"; private const char COMPONENT_DELIMITER = ';'; - private const string ESCAPED_BACKSLASH = "\\"; - private const char ESCAPED_BACKSLASH_CHAR = '\\'; private const string FORWARDSLASH = "/"; private const string URISCHEME_PACK = "pack"; private const string PARENTFOLDER = @"..\"; @@ -3534,4 +3532,3 @@ internal string SubClass #endregion Private Data } } - diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/MS/Internal/Tasks/CompilerWrapper.cs b/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/MS/Internal/Tasks/CompilerWrapper.cs index 990552a8d0d..d47c9af6ff0 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/MS/Internal/Tasks/CompilerWrapper.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/MS/Internal/Tasks/CompilerWrapper.cs @@ -40,7 +40,7 @@ internal class CompilerWrapper : MarshalByRefObject internal CompilerWrapper() { _mc = new MarkupCompiler(); - _sourceDir = Directory.GetCurrentDirectory() + "\\"; + _sourceDir = Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar; _nErrors = 0; } @@ -408,7 +408,7 @@ private string GetResolvedFilePath(string filePath, ref string newSourceDir) // and put the deepest directory that file is in as the new // SourceDir. // - int pathEndIndex = fullFilePath.LastIndexOf("\\", StringComparison.Ordinal); + int pathEndIndex = fullFilePath.LastIndexOf(string.Empty + Path.DirectorySeparatorChar, StringComparison.Ordinal); newSourceDir = fullFilePath.Substring(0, pathEndIndex + 1); newRelativeFilePath = fullFilePath.Substring(pathEndIndex + 1); diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/MS/Internal/Tasks/IncrementalCompileAnalyzer.cs b/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/MS/Internal/Tasks/IncrementalCompileAnalyzer.cs index c314b4210d6..02a483aa596 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/MS/Internal/Tasks/IncrementalCompileAnalyzer.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/MS/Internal/Tasks/IncrementalCompileAnalyzer.cs @@ -478,7 +478,7 @@ private void RecompileContentFiles() { if (ListIsNotEmpty(_mcPass1.ContentFiles)) { - string curDir = Directory.GetCurrentDirectory() + "\\"; + string curDir = Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar; int count = _mcPass1.ContentFiles.Length; diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/MS/Internal/Tasks/TaskHelper.cs b/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/MS/Internal/Tasks/TaskHelper.cs index d58cf8c4de7..1bd2f580399 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/MS/Internal/Tasks/TaskHelper.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/MS/Internal/Tasks/TaskHelper.cs @@ -80,7 +80,6 @@ internal static string CreateFullFilePath(string thePath, string rootPath) // get rid of '..' and '.' if any thePath = Path.GetFullPath(thePath); - return thePath; } @@ -100,7 +99,7 @@ internal static string GetRootRelativePath(string path1, string path2) string fullpath1; string fullpath2; - string sourceDir = Directory.GetCurrentDirectory() + "\\"; + string sourceDir = Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar; // make sure path1 and Path2 are both full path // so that they can be compared on right base. @@ -235,4 +234,3 @@ internal static CompilerWrapper CreateCompilerWrapper(bool fInSeparateDomain, re #endregion TaskHelper class } - diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Microsoft/Build/Tasks/Windows/MarkupCompilePass1.cs b/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Microsoft/Build/Tasks/Windows/MarkupCompilePass1.cs index 6ccf685c2dd..6a37386e63f 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Microsoft/Build/Tasks/Windows/MarkupCompilePass1.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Microsoft/Build/Tasks/Windows/MarkupCompilePass1.cs @@ -74,7 +74,7 @@ public sealed class MarkupCompilePass1 : Task public MarkupCompilePass1( ) : base(SR.SharedResourceManager) { // set the source directory - _sourceDir = Directory.GetCurrentDirectory() + "\\"; + _sourceDir = Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar; _outputType = SharedStrings.WinExe; @@ -276,10 +276,10 @@ public string OutputPath // Get the relative path based on sourceDir _outputDir= TaskHelper.CreateFullFilePath(filePath, SourceDir); - // Make sure OutputDir always ends with '\\'. - if (!_outputDir.EndsWith("\\", StringComparison.Ordinal)) + // Make sure OutputDir always ends with Path.DirectorySeparatorChar + if (!_outputDir.EndsWith(string.Empty + Path.DirectorySeparatorChar, StringComparison.Ordinal)) { - _outputDir += "\\"; + _outputDir += Path.DirectorySeparatorChar; } } } @@ -1080,7 +1080,7 @@ private string GetResolvedFilePath(string filePath, ref string newSourceDir) // and put the deepest directory that file is in as the new // SourceDir. // - int pathEndIndex = fullFilePath.LastIndexOf("\\", StringComparison.Ordinal); + int pathEndIndex = fullFilePath.LastIndexOf(string.Empty + Path.DirectorySeparatorChar, StringComparison.Ordinal); newSourceDir = fullFilePath.Substring(0, pathEndIndex + 1); newRelativeFilePath = TaskHelper.GetRootRelativePath(newSourceDir, fullFilePath); diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Microsoft/Build/Tasks/Windows/MarkupCompilePass2.cs b/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Microsoft/Build/Tasks/Windows/MarkupCompilePass2.cs index d60f0615809..e0765943adb 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Microsoft/Build/Tasks/Windows/MarkupCompilePass2.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Microsoft/Build/Tasks/Windows/MarkupCompilePass2.cs @@ -43,7 +43,6 @@ namespace Microsoft.Build.Tasks.Windows /// public sealed class MarkupCompilePass2 : Task { - //------------------------------------------------------ // // Constructors @@ -58,7 +57,7 @@ public sealed class MarkupCompilePass2 : Task public MarkupCompilePass2( ) : base(SR.SharedResourceManager) { // set the source directory - _sourceDir = Directory.GetCurrentDirectory() + "\\"; + _sourceDir = Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar; _outputType = SharedStrings.WinExe; @@ -253,10 +252,10 @@ public string OutputPath // Get the relative path based on sourceDir _outputPath= TaskHelper.CreateFullFilePath(filePath, SourceDir); - // Make sure OutputDir always ends with '\\'. - if (!_outputPath.EndsWith("\\", StringComparison.Ordinal)) + // Make sure OutputDir always ends with Path.DirectorySeparatorChar + if (!_outputPath.EndsWith(string.Empty + Path.DirectorySeparatorChar, StringComparison.Ordinal)) { - _outputPath += "\\"; + _outputPath += Path.DirectorySeparatorChar; } } } @@ -546,7 +545,7 @@ private string GetResolvedFilePath(string filePath, ref string newSourceDir) // and put the deepest directory that file is in as the new // SourceDir. // - int pathEndIndex = fullFilePath.LastIndexOf("\\", StringComparison.Ordinal); + int pathEndIndex = fullFilePath.LastIndexOf(string.Empty + Path.DirectorySeparatorChar, StringComparison.Ordinal); newSourceDir = fullFilePath.Substring(0, pathEndIndex + 1); newRelativeFilePath = TaskHelper.GetRootRelativePath(newSourceDir, fullFilePath); diff --git a/src/Microsoft.DotNet.Wpf/src/Shared/System/Windows/Markup/ReflectionHelper.cs b/src/Microsoft.DotNet.Wpf/src/Shared/System/Windows/Markup/ReflectionHelper.cs index d2d536460bf..1589ae70064 100644 --- a/src/Microsoft.DotNet.Wpf/src/Shared/System/Windows/Markup/ReflectionHelper.cs +++ b/src/Microsoft.DotNet.Wpf/src/Shared/System/Windows/Markup/ReflectionHelper.cs @@ -457,7 +457,7 @@ private static Assembly LoadAssemblyHelper(string assemblyGivenName, string asse { // assemblyPath is set, Load the assembly from this specified place. // the path must be full file path which contains directory, file name and extension. - Debug.Assert(!assemblyPath.EndsWith("\\", StringComparison.Ordinal), "the assembly path should be a full file path containing file extension"); + Debug.Assert(!assemblyPath.EndsWith(string.Empty + Path.DirectorySeparatorChar, StringComparison.Ordinal), "the assembly path should be a full file path containing file extension"); // LoadFile will only override your request only if it is in the GAC retassem = Assembly.LoadFile(assemblyPath); diff --git a/src/Microsoft.DotNet.Wpf/src/WindowsBase/MS/Internal/IO/Packaging/Compoundfile/ContainerUtilities.cs b/src/Microsoft.DotNet.Wpf/src/WindowsBase/MS/Internal/IO/Packaging/Compoundfile/ContainerUtilities.cs index f231b989c1d..b86b49bcf86 100644 --- a/src/Microsoft.DotNet.Wpf/src/WindowsBase/MS/Internal/IO/Packaging/Compoundfile/ContainerUtilities.cs +++ b/src/Microsoft.DotNet.Wpf/src/WindowsBase/MS/Internal/IO/Packaging/Compoundfile/ContainerUtilities.cs @@ -44,7 +44,7 @@ static internal class ContainerUtilities /// Used by ConvertBackSlashPathToStringArrayPath and /// ConvertStringArrayPathToBackSlashPath to separate path elements. - static readonly internal char PathSeparator = '\\'; + static readonly internal char PathSeparator = Path.DirectorySeparatorChar; static private readonly char[] _PathSeparatorArray = new char[] { PathSeparator }; static readonly internal string PathSeparatorAsString = new string(ContainerUtilities.PathSeparator, 1); From d96073b85b8718cc8b244c2381e3bc701ab79f1b Mon Sep 17 00:00:00 2001 From: Nirmal Guru Date: Fri, 8 May 2020 18:18:04 +0530 Subject: [PATCH 2/7] Update 'WinFx' -> 'WinFX' in file names 'WinFX' is the correct casing as observed in the .NET CLR 2 frameworks --- .../{Microsoft.WinFx.props => Microsoft.WinFX.props} | 0 .../{Microsoft.WinFx.targets => Microsoft.WinFX.targets} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/{Microsoft.WinFx.props => Microsoft.WinFX.props} (100%) rename src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/{Microsoft.WinFx.targets => Microsoft.WinFX.targets} (100%) diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Microsoft.WinFx.props b/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Microsoft.WinFX.props similarity index 100% rename from src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Microsoft.WinFx.props rename to src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Microsoft.WinFX.props diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Microsoft.WinFx.targets b/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Microsoft.WinFX.targets similarity index 100% rename from src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Microsoft.WinFx.targets rename to src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Microsoft.WinFX.targets From 9edc8d7a35c1f9042573a33021d64a26f71a9466 Mon Sep 17 00:00:00 2001 From: Nirmal Guru Date: Fri, 8 May 2020 18:18:23 +0530 Subject: [PATCH 3/7] Update 'WinFx' -> 'WinFX' everywhere else In project files, scripts, comments, etc... But not in sources (like GetWinFxCallback) 'WinFX' is the correct casing as observed in the .NET CLR 2 frameworks --- eng/WpfArcadeSdk/tools/Pbt.props | 8 ++++---- eng/WpfArcadeSdk/tools/Pbt.targets | 4 ++-- .../PresentationBuildTasks/PresentationBuildTasks.csproj | 6 +++--- .../src/PresentationCore/PresentationCore.csproj | 2 +- .../System/Windows/Interop/IErrorPage.cs | 4 ++-- .../System/Windows/Markup/BamlMapTable.cs | 4 +--- .../System/Windows/Markup/XamlTypeMapper.cs | 6 +----- .../src/Shared/Tracing/mcwpf/mcwpf.csproj | 4 ++-- .../MS/Internal/Automation/CodeQuality_Approved.cs | 2 +- .../System/Windows/Automation/WindowPattern.cs | 6 +++--- .../System/Windows/Automation/Provider/IWindowProvider.cs | 6 +++--- .../MS/Internal/Automation/CodeQuality_Approved.cs | 2 +- 12 files changed, 24 insertions(+), 30 deletions(-) diff --git a/eng/WpfArcadeSdk/tools/Pbt.props b/eng/WpfArcadeSdk/tools/Pbt.props index 4d10975e829..1e0fd8d82bb 100644 --- a/eng/WpfArcadeSdk/tools/Pbt.props +++ b/eng/WpfArcadeSdk/tools/Pbt.props @@ -35,7 +35,7 @@ Project="../targets/Microsoft.NET.Sdk.WindowsDesktop.props" Condition="!Exists('$(LocalMicrosoftWinFXTargets)') And '$(InternalMarkupCompilation)'=='true'"/> - We need Microsoft.WinFx.props though, so that's imported here specifically. + We need Microsoft.WinFX.props though, so that's imported here specifically. The use of Microsoft.NET.Sdk.WindowsDesktop doesn't break the source-build promise. - Microsoft.NET.Sdk.WindowsDesktop is built from sources @@ -57,11 +57,11 @@ Condition="Exists('$(LocalMicrosoftWinFXProps)') "/> + Exists('../targets/Microsoft.WinFX.props')"/> diff --git a/eng/WpfArcadeSdk/tools/Pbt.targets b/eng/WpfArcadeSdk/tools/Pbt.targets index 0816bd935d3..466bc6a577b 100644 --- a/eng/WpfArcadeSdk/tools/Pbt.targets +++ b/eng/WpfArcadeSdk/tools/Pbt.targets @@ -1,7 +1,7 @@ - - + + diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Interop/IErrorPage.cs b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Interop/IErrorPage.cs index 4293c68db57..1883c0b3946 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Interop/IErrorPage.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Interop/IErrorPage.cs @@ -48,8 +48,8 @@ public interface IErrorPage DispatcherOperationCallback RefreshCallback { get; set;} /// - /// Callback when user clicks GetWinFx button + /// Callback when user clicks GetWinFX button /// DispatcherOperationCallback GetWinFxCallback { get; set;} } -} \ No newline at end of file +} diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Markup/BamlMapTable.cs b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Markup/BamlMapTable.cs index 97576ae062c..015e7941b15 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Markup/BamlMapTable.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Markup/BamlMapTable.cs @@ -1571,7 +1571,7 @@ private Type GetCustomConverter( return converterType; } - // Reflect for per property type converter , but skip if WinFx props + // Reflect for per property type converter , but skip if WinFX props Assembly ownerAsm = ownerType.Assembly; #if PBTCOMPILER if (XamlTypeMapper.AssemblyPF != ownerAsm && @@ -1975,5 +1975,3 @@ public override string ToString() } - - diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Markup/XamlTypeMapper.cs b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Markup/XamlTypeMapper.cs index c8eaa39b56c..412881e8822 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Markup/XamlTypeMapper.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Markup/XamlTypeMapper.cs @@ -2479,7 +2479,7 @@ internal TypeAndSerializer GetTypeAndSerializer ( #if PBTCOMPILER private static bool IsFriendAssembly(Assembly assembly) { - // WinFx assemblies can never be friends of compiled assemblies, so just bail out. + // WinFX assemblies can never be friends of compiled assemblies, so just bail out. if (assembly == XamlTypeMapper.AssemblyPF || assembly == XamlTypeMapper.AssemblyPC || assembly == XamlTypeMapper.AssemblyWB) @@ -4463,7 +4463,3 @@ internal static NamespaceMapEntry[] GetDefaultNamespaceMaps() } #endregion XmlParserDefaults Class } - - - - diff --git a/src/Microsoft.DotNet.Wpf/src/Shared/Tracing/mcwpf/mcwpf.csproj b/src/Microsoft.DotNet.Wpf/src/Shared/Tracing/mcwpf/mcwpf.csproj index 3d02acc1f10..12b668b6bbe 100644 --- a/src/Microsoft.DotNet.Wpf/src/Shared/Tracing/mcwpf/mcwpf.csproj +++ b/src/Microsoft.DotNet.Wpf/src/Shared/Tracing/mcwpf/mcwpf.csproj @@ -7,8 +7,8 @@ true v3.5 - v3.5 - v3.5 + v3.5 + v3.5 diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/MS/Internal/Automation/CodeQuality_Approved.cs b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/MS/Internal/Automation/CodeQuality_Approved.cs index 5958a960cde..2b280027ba4 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/MS/Internal/Automation/CodeQuality_Approved.cs +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/MS/Internal/Automation/CodeQuality_Approved.cs @@ -289,7 +289,7 @@ [module: SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Scope = "member", Target = "System.Windows.Automation.Condition.TrueCondition")] [module: SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Scope = "member", Target = "System.Windows.Automation.Condition.FalseCondition")] [module: SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Scope = "member", Target = "System.Windows.Automation.TextPattern.TextChangedEvent")] -// Reviewed by WinFx team and this case is OK +// Reviewed by WinFX team and this case is OK [module: SuppressMessage("Microsoft.Design", "CA1008:EnumsShouldHaveZeroValue", Scope = "type", Target = "System.Windows.Automation.Text.FlowDirections")] // Reviewed by atgarch and these enums are OK [module: SuppressMessage("Microsoft.Naming", "CA1714:FlagsEnumsShouldHavePluralNames", Scope = "type", Target = "System.Windows.Automation.TreeScope")] diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/System/Windows/Automation/WindowPattern.cs b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/System/Windows/Automation/WindowPattern.cs index e58940e319f..966ebccd0d2 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/System/Windows/Automation/WindowPattern.cs +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/System/Windows/Automation/WindowPattern.cs @@ -115,10 +115,10 @@ public void Close() /// call may return sometime after the window is ready for user input. The calling code /// should not rely on this call to understand exactly when the window has become idle. /// - /// For now this method works reliably for both WinFx and Win32 Windows that are starting - /// up. However, if called at other times on WinFx Windows (e.g. during a long layout) + /// For now this method works reliably for both WinFX and Win32 Windows that are starting + /// up. However, if called at other times on WinFX Windows (e.g. during a long layout) /// WaitForInputIdle may return true before the Window is actually idle. Additional work - /// needs to be done to detect when WinFx Windows are idle. + /// needs to be done to detect when WinFX Windows are idle. /// /// The amount of time, in milliseconds, to wait for the /// associated process to become idle. The maximum is the largest possible value of a diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationProvider/System/Windows/Automation/Provider/IWindowProvider.cs b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationProvider/System/Windows/Automation/Provider/IWindowProvider.cs index fa1eea21ad8..35161ec1f86 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationProvider/System/Windows/Automation/Provider/IWindowProvider.cs +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationProvider/System/Windows/Automation/Provider/IWindowProvider.cs @@ -46,10 +46,10 @@ public interface IWindowProvider /// call may return sometime after the window is ready for user input. The calling code /// should not rely on this call to understand exactly when the window has become idle. /// - /// For now this method works reliably for both WinFx and Win32 Windows that are starting - /// up. However, if called at other times on WinFx Windows (e.g. during a long layout) + /// For now this method works reliably for both WinFX and Win32 Windows that are starting + /// up. However, if called at other times on WinFX Windows (e.g. during a long layout) /// WaitForInputIdle may return true before the Window is actually idle. Additional work - /// needs to be done to detect when WinFx Windows are idle. + /// needs to be done to detect when WinFX Windows are idle. /// /// The amount of time, in milliseconds, to wait for the /// associated process to become idle. The maximum is the largest possible value of a diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationTypes/MS/Internal/Automation/CodeQuality_Approved.cs b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationTypes/MS/Internal/Automation/CodeQuality_Approved.cs index e0fe1eef9c0..454c8efd75a 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationTypes/MS/Internal/Automation/CodeQuality_Approved.cs +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationTypes/MS/Internal/Automation/CodeQuality_Approved.cs @@ -425,7 +425,7 @@ [module: SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Scope = "member", Target = "System.Windows.Automation.TransformPatternIdentifiers.CanRotateProperty" )] [module: SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Scope = "member", Target = "System.Windows.Automation.TransformPatternIdentifiers.CanResizeProperty" )] [module: SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Scope = "member", Target = "System.Windows.Automation.TextPatternIdentifiers.TextChangedEvent")] -// Reviewed by WinFx team and this case is OK +// Reviewed by WinFX team and this case is OK [module: SuppressMessage("Microsoft.Design", "CA1008:EnumsShouldHaveZeroValue", Scope = "type", Target = "System.Windows.Automation.Text.FlowDirections")] // Reviewed by atgarch and these enums are OK [module: SuppressMessage("Microsoft.Naming", "CA1714:FlagsEnumsShouldHavePluralNames", Scope = "type", Target = "System.Windows.Automation.TreeScope")] From 5f070a214f861c371bcf8bf7fcb40a8458ca62b9 Mon Sep 17 00:00:00 2001 From: Nirmal Guru Date: Fri, 8 May 2020 18:09:03 +0530 Subject: [PATCH 4/7] Don't import .NET Framework's implementation of WinFX targets When the SDK's implementation is being used. --- packaging/Microsoft.NET.Sdk.WindowsDesktop/Sdk/Sdk.props | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packaging/Microsoft.NET.Sdk.WindowsDesktop/Sdk/Sdk.props b/packaging/Microsoft.NET.Sdk.WindowsDesktop/Sdk/Sdk.props index 19f8200fa41..56014a5e24f 100644 --- a/packaging/Microsoft.NET.Sdk.WindowsDesktop/Sdk/Sdk.props +++ b/packaging/Microsoft.NET.Sdk.WindowsDesktop/Sdk/Sdk.props @@ -24,6 +24,15 @@ Copyright (c) .NET Foundation. All rights reserved. $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)\..\targets)) + + + false + + From 79771515c53ee920a12dbebca2b94e99ec9e846b Mon Sep 17 00:00:00 2001 From: Nirmal Guru Date: Thu, 11 Jun 2020 13:50:41 +0530 Subject: [PATCH 5/7] Rearrange WinFX imports 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.props | 3 +++ .../targets/Microsoft.NET.Sdk.WindowsDesktop.targets | 5 ++++- .../src/PresentationBuildTasks/Microsoft.WinFX.props | 1 + .../src/PresentationBuildTasks/Microsoft.WinFX.targets | 2 +- 4 files changed, 9 insertions(+), 2 deletions(-) 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 b01491da6c9..61affc75fde 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 @@ + <_MicrosoftNetSdkWindowsDesktop>true true @@ -205,5 +206,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 839a615f888..ecf32b3ae18 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 @@ -23,7 +23,6 @@ <_TargetFrameworkVersionValue>$([MSBuild]::ValueOrDefault('$(_TargetFrameworkVersionWithoutV)', '$(_UndefinedTargetFrameworkVersion)')) - @@ -109,4 +108,8 @@ ('$(_TargetFrameworkVersionValue)' != '$(_UndefinedTargetFrameworkVersion)') And ('$(_TargetFrameworkVersionValue)' < '$(_WindowsDesktopSdkTargetFrameworkVersionFloor)')"> + + + + diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Microsoft.WinFX.props b/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Microsoft.WinFX.props index a73f7b23e5f..5c12af7b9c8 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Microsoft.WinFX.props +++ b/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Microsoft.WinFX.props @@ -1,4 +1,5 @@ + <_PresentationBuildTasksTfm Condition="'$(MSBuildRuntimeType)' == 'Core'">netcoreapp2.1 <_PresentationBuildTasksTfm Condition="'$(MSBuildRuntimeType)' != 'Core'">net472 diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Microsoft.WinFX.targets b/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Microsoft.WinFX.targets index 04ec174a95d..cd051de4072 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Microsoft.WinFX.targets +++ b/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Microsoft.WinFX.targets @@ -1,4 +1,5 @@ + true true @@ -934,5 +935,4 @@ - From 2b2c3ec0276fa84184f6c3d18e1bb2e3a75ec4a9 Mon Sep 17 00:00:00 2001 From: Nirmal Guru Date: Thu, 11 Jun 2020 14:06:46 +0530 Subject: [PATCH 6/7] 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 ++- .../targets/Microsoft.NET.Sdk.WindowsDesktop.props | 4 ++-- .../targets/Microsoft.NET.Sdk.WindowsDesktop.targets | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/packaging/Microsoft.NET.Sdk.WindowsDesktop/Sdk/Sdk.props b/packaging/Microsoft.NET.Sdk.WindowsDesktop/Sdk/Sdk.props index 56014a5e24f..dec46a78016 100644 --- a/packaging/Microsoft.NET.Sdk.WindowsDesktop/Sdk/Sdk.props +++ b/packaging/Microsoft.NET.Sdk.WindowsDesktop/Sdk/Sdk.props @@ -28,9 +28,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 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 61affc75fde..1da0f3c6cbc 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 @@ -206,7 +206,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 ecf32b3ae18..7eadb44fe25 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 @@ -109,7 +109,7 @@ - - + + From 8c101b8b19fa3c58a781957dff59b203f790d7fb Mon Sep 17 00:00:00 2001 From: Nirmal Guru Date: Sun, 14 Jun 2020 09:26:08 +0530 Subject: [PATCH 7/7] Fixup new-lines making them easier to read Only in WinFX and Desktop SDK props/targets --- .../Microsoft.NET.Sdk.WindowsDesktop.props | 11 -- .../Microsoft.NET.Sdk.WindowsDesktop.targets | 4 - .../Microsoft.WinFX.targets | 119 ++---------------- 3 files changed, 11 insertions(+), 123 deletions(-) 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 1da0f3c6cbc..7cc1c66bdbc 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 @@ -17,16 +17,13 @@ Irrespective of whether '$(TargetFrameworkIdentifier)' is '.NETCoreApp' or '.NETFramework', the minimum value of $(_TargetFrameworkVersionValue) we will be testing for is '3.0' - --> <_WindowsDesktopSdkTargetFrameworkVersionFloor>3.0 - <_UndefinedTargetFrameworkVersion>0.0 - @@ -50,8 +47,6 @@ Condition="'$(EnableDefaultPageItems)' != 'false'" > MSBuild:Compile - - - 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 7eadb44fe25..5f6244a98b7 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 @@ -23,7 +23,6 @@ <_TargetFrameworkVersionValue>$([MSBuild]::ValueOrDefault('$(_TargetFrameworkVersionWithoutV)', '$(_UndefinedTargetFrameworkVersion)')) - @@ -33,7 +32,6 @@ --> - - - true - false 1.0.0.0 Installed true .g$(DefaultLanguageSourceExtension) - 5.1.2600.0 @@ -37,32 +33,24 @@ - true true true true - - - - AssignWinFXEmbeddedResource; $(PrepareResourceNamesDependsOn) - - - MarkupCompilePass1; AfterMarkupCompilePass1; @@ -71,38 +59,32 @@ MainResourcesGeneration; $(PrepareResourcesDependsOn) - - - DesignTimeMarkupCompilation; $(CoreCompileDependsOn) - - + - + - - @@ -128,52 +110,42 @@ - - - $(CompileDependsOn); _AfterCompileWinFXInternal - - - <_AfterCompileWinFXInternalDependsOn> PrepareResourcesForSatelliteAssemblies; MergeLocalizationDirectives; AfterCompileWinFX - - - + - - - @@ -320,7 +283,6 @@ If MarupCompilePass2 is for Main Assembly as well, output the Baml files into GeneratedBaml, FileClassifier task will be invoked later. --> - @@ -333,20 +295,15 @@ TaskParameter="GeneratedBaml" Condition="'$(_RequireMCPass2ForSatelliteAssemblyOnly)' == 'true'" /> - - - - - GenerateTemporaryTargetAssembly; MarkupCompilePass2; @@ -370,8 +325,6 @@ <_CompileTargetNameForLocalType Condition="'$(_CompileTargetNameForLocalType)' == ''">_CompileTemporaryAssembly - - @@ -380,18 +333,15 @@ - - - @@ -437,13 +383,10 @@ - - - - - true $(GenerateManifests) - - false - - Internet - - - $(TargetUrl)/$(TargetDeployManifestFileName) $(MSBuildProjectDirectory)\bin\$(Configuration)\$(TargetDeployManifestFileName) -debug "$(StartURL)" $(StartArguments) -DebugSecurityZoneURL "$(DebugSecurityZoneURL)" - @@ -551,8 +482,6 @@ - - @@ -577,7 +506,6 @@ CertificateThumbprint="$(_DeploymentResolvedManifestCertificateThumbprint)" TimestampUrl="$(ManifestTimestampUrl)" SigningTarget="@(ApplicationManifest)"/> - @@ -595,7 +523,6 @@ CertificateThumbprint="$(_DeploymentResolvedManifestCertificateThumbprint)" TimestampUrl="$(ManifestTimestampUrl)" SigningTarget="@(DeployManifest)"/> - @@ -605,7 +532,6 @@ ================================================================ Classify baml and image files into different groups for Main assembly and satellite assembly respectively. - --> @@ -623,12 +549,10 @@ - - - - - <_ResourceNameInMainAssembly Condition="'$(UICulture)' == ''">$(AssemblyName).g.resources - <_ResourceNameInMainAssembly Condition="'$(UICulture)' != ''">$(AssemblyName).unlocalizable.g.resources - - - - @@ -689,11 +605,10 @@ $(IntermediateOutputPath)$(_ResourceNameInMainAssembly) - - - - - + @@ -822,7 +732,6 @@ Condition="'$(UICulture)' != ''"> - @@ -833,7 +742,6 @@ Condition="'@(NonResxWithCulture)' != ''"> - @@ -844,7 +752,6 @@ - @@ -853,7 +760,6 @@ Condition="'@(Page)' != '' or '@(ApplicationDefinition)' != ''"> - - + - + - +