From 0bef5b1f29f2c926bc3c010a10c935ac8f9ad8ce Mon Sep 17 00:00:00 2001 From: David Federman Date: Thu, 13 Jan 2022 15:33:49 -0600 Subject: [PATCH 1/2] Remove xmlns from props/targets and projects --- documentation/wiki/MSBuild-Tips-&-Tricks.md | 6 +++--- src/Directory.Build.props | 2 +- src/Directory.Build.targets | 2 +- src/Samples/MultiprocessBuild/1.csproj | 2 +- src/Samples/MultiprocessBuild/2.csproj | 4 ++-- src/Samples/MultiprocessBuild/root.proj | 2 +- src/Samples/PortableTask/portableTaskTest.proj | 6 +++--- src/Tasks/Microsoft.CSharp.CrossTargeting.targets | 2 +- src/Tasks/Microsoft.CSharp.CurrentVersion.targets | 2 +- src/Tasks/Microsoft.CSharp.targets | 2 +- src/Tasks/Microsoft.Common.CrossTargeting.targets | 2 +- src/Tasks/Microsoft.Common.CurrentVersion.targets | 14 +++++++------- src/Tasks/Microsoft.Common.overridetasks | 2 +- src/Tasks/Microsoft.Common.props | 2 +- src/Tasks/Microsoft.Common.targets | 2 +- src/Tasks/Microsoft.Common.tasks | 2 +- src/Tasks/Microsoft.Data.Entity.targets | 2 +- src/Tasks/Microsoft.NET.props | 2 +- .../Microsoft.NETFramework.CurrentVersion.props | 2 +- .../Microsoft.NETFramework.CurrentVersion.targets | 2 +- src/Tasks/Microsoft.NETFramework.props | 2 +- src/Tasks/Microsoft.NETFramework.targets | 2 +- src/Tasks/Microsoft.ServiceModel.targets | 2 +- .../Microsoft.VisualBasic.CrossTargeting.targets | 2 +- .../Microsoft.VisualBasic.CurrentVersion.targets | 2 +- src/Tasks/Microsoft.VisualBasic.targets | 2 +- src/Tasks/Microsoft.WinFx.targets | 2 +- .../Microsoft.WorkflowBuildExtensions.targets | 2 +- src/Tasks/Microsoft.Xaml.targets | 2 +- src/Tasks/Workflow.VisualBasic.targets | 2 +- src/Tasks/Workflow.targets | 2 +- .../Microsoft.Build.UnitTests.Shared.csproj | 2 +- 32 files changed, 43 insertions(+), 43 deletions(-) diff --git a/documentation/wiki/MSBuild-Tips-&-Tricks.md b/documentation/wiki/MSBuild-Tips-&-Tricks.md index 925930a747a..a66255a037e 100644 --- a/documentation/wiki/MSBuild-Tips-&-Tricks.md +++ b/documentation/wiki/MSBuild-Tips-&-Tricks.md @@ -39,7 +39,7 @@ See the [MSBuild Command-Line Reference](https://docs.microsoft.com/visualstudio If MSBuild.exe is passed properties on the command line, such as `/p:Platform=AnyCPU` then this value overrides whatever assignments you have to that property inside property groups. For instance, `x86` will be ignored. To make sure your local assignment to properties overrides whatever they pass on the command line, add the following at the top of your MSBuild project file: ``` - + ``` This will make sure that your local assignments to the `Platform` property are respected. You can specify multiple properties in `TreatAsLocalProperty` separated by semicolon. @@ -59,11 +59,11 @@ Use this command-line to approximate what the design-time build does: See https://www.simple-talk.com/dotnet/.net-tools/extending-msbuild, "Extending all builds" section. Also read about [MSBuildUserExtensionsPath](http://referencesource.microsoft.com/#MSBuildFiles/C/ProgramFiles(x86)/MSBuild/14.0/Microsoft.Common.props,33), [CustomBeforeMicrosoftCommonProps](http://referencesource.microsoft.com/#MSBuildFiles/C/ProgramFiles(x86)/MSBuild/14.0/Microsoft.Common.props,68), [CustomBeforeMicrosoftCommonTargets](http://referencesource.microsoft.com/#MSBuildFiles/C/ProgramFiles(x86)/MSBuild/14.0/bin_/amd64/Microsoft.Common.targets,71), and CustomAfterMicrosoftCommonProps/CustomAfterMicrosoftCommonTargets. Example: -Create this file (Custom.props) in `C:\Users\username\AppData\Local\Microsoft\MSBuild\14.0\Microsoft.Common.targets\ImportAfter`: +Create this file (Custom.props) in `C:\Users\username\AppData\Local\Microsoft\MSBuild\Current\Microsoft.Common.targets\ImportAfter`: ``` - + Value! diff --git a/src/Directory.Build.props b/src/Directory.Build.props index a96fe427c62..612f1412be8 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -1,4 +1,4 @@ - + diff --git a/src/Directory.Build.targets b/src/Directory.Build.targets index bff6cc9053f..2dbbe6d8ace 100644 --- a/src/Directory.Build.targets +++ b/src/Directory.Build.targets @@ -1,4 +1,4 @@ - + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) diff --git a/src/Samples/MultiprocessBuild/1.csproj b/src/Samples/MultiprocessBuild/1.csproj index 969ebd61564..fbd4c35b5c5 100644 --- a/src/Samples/MultiprocessBuild/1.csproj +++ b/src/Samples/MultiprocessBuild/1.csproj @@ -1,4 +1,4 @@ - + PortableTask.dll diff --git a/src/Samples/MultiprocessBuild/2.csproj b/src/Samples/MultiprocessBuild/2.csproj index 41b58f20011..96117ad4cbc 100644 --- a/src/Samples/MultiprocessBuild/2.csproj +++ b/src/Samples/MultiprocessBuild/2.csproj @@ -1,4 +1,4 @@ - + PortableTask.dll @@ -8,4 +8,4 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/Samples/MultiprocessBuild/root.proj b/src/Samples/MultiprocessBuild/root.proj index 0b092a78802..523c4e7109d 100644 --- a/src/Samples/MultiprocessBuild/root.proj +++ b/src/Samples/MultiprocessBuild/root.proj @@ -1,4 +1,4 @@ - + diff --git a/src/Samples/PortableTask/portableTaskTest.proj b/src/Samples/PortableTask/portableTaskTest.proj index 7ba2ebcf48d..e2d00979f2a 100644 --- a/src/Samples/PortableTask/portableTaskTest.proj +++ b/src/Samples/PortableTask/portableTaskTest.proj @@ -1,9 +1,9 @@ - - + + PortableTask.dll - + diff --git a/src/Tasks/Microsoft.CSharp.CrossTargeting.targets b/src/Tasks/Microsoft.CSharp.CrossTargeting.targets index 26ae23579d9..62d284b87e2 100644 --- a/src/Tasks/Microsoft.CSharp.CrossTargeting.targets +++ b/src/Tasks/Microsoft.CSharp.CrossTargeting.targets @@ -10,7 +10,7 @@ Copyright (C) Microsoft Corporation. All rights reserved. *********************************************************************************************** --> - + diff --git a/src/Tasks/Microsoft.CSharp.CurrentVersion.targets b/src/Tasks/Microsoft.CSharp.CurrentVersion.targets index d7bd7923aa7..6e68b0dd542 100644 --- a/src/Tasks/Microsoft.CSharp.CurrentVersion.targets +++ b/src/Tasks/Microsoft.CSharp.CurrentVersion.targets @@ -15,7 +15,7 @@ Copyright (C) Microsoft Corporation. All rights reserved. *********************************************************************************************** --> - + true diff --git a/src/Tasks/Microsoft.CSharp.targets b/src/Tasks/Microsoft.CSharp.targets index 55e2a28888d..9aceb4e3813 100644 --- a/src/Tasks/Microsoft.CSharp.targets +++ b/src/Tasks/Microsoft.CSharp.targets @@ -15,7 +15,7 @@ Copyright (C) Microsoft Corporation. All rights reserved. *********************************************************************************************** --> - + diff --git a/src/Tasks/Microsoft.Common.CrossTargeting.targets b/src/Tasks/Microsoft.Common.CrossTargeting.targets index c7d553aecd3..7eb75f9f283 100644 --- a/src/Tasks/Microsoft.Common.CrossTargeting.targets +++ b/src/Tasks/Microsoft.Common.CrossTargeting.targets @@ -10,7 +10,7 @@ Copyright (C) Microsoft Corporation. All rights reserved. *********************************************************************************************** --> - + true diff --git a/src/Tasks/Microsoft.Common.CurrentVersion.targets b/src/Tasks/Microsoft.Common.CurrentVersion.targets index 260448aa946..c56c9597036 100644 --- a/src/Tasks/Microsoft.Common.CurrentVersion.targets +++ b/src/Tasks/Microsoft.Common.CurrentVersion.targets @@ -14,7 +14,7 @@ Copyright (C) Microsoft Corporation. All rights reserved. *********************************************************************************************** --> - + @@ -1610,8 +1610,8 @@ Copyright (C) Microsoft Corporation. All rights reserved. ==================================================================================== _GetProjectReferencePlatformProperties - If a project is opted in via $(EnableDynamicPlatformResolution), this target calls the - GetCompatiblePlatform task on all ProjectReference items to determine the most compatible + If a project is opted in via $(EnableDynamicPlatformResolution), this target calls the + GetCompatiblePlatform task on all ProjectReference items to determine the most compatible platform for each project. It then sets SetPlatform metadata on each ProjectReference. This prevents overbuilding a project when 'AnyCPU' is available. @@ -1637,7 +1637,7 @@ Copyright (C) Microsoft Corporation. All rights reserved. - <_ProjectReferencePlatformPossibilities Include="@(_MSBuildProjectReferenceExistent)" + <_ProjectReferencePlatformPossibilities Include="@(_MSBuildProjectReferenceExistent)" Condition="'%(_MSBuildProjectReferenceExistent.SkipGetPlatformProperties)' != 'true'"/> @@ -1737,7 +1737,7 @@ Copyright (C) Microsoft Corporation. All rights reserved. --> <_MSBuildProjectReferenceExistent Condition="'%(_MSBuildProjectReferenceExistent.SkipGetTargetFrameworkProperties)' == '' and ('%(Extension)' == '.vcxproj' or '%(Extension)' == '.nativeproj')"> - @@ -1759,7 +1759,7 @@ Copyright (C) Microsoft Corporation. All rights reserved. --> <_MSBuildProjectReferenceExistent Condition="'%(_MSBuildProjectReferenceExistent.SetTargetFramework)' != ''"> - @@ -1828,7 +1828,7 @@ Copyright (C) Microsoft Corporation. All rights reserved. https://github.com/dotnet/sdk/issues/416 Furthermore, if we're referencing a .vcxproj or .nativeproj, those items won't be populated into `AnnotatedProjects` - by `GetReferenceNearestTargetFrameworkTask`, so let them flow when `EnableDynamicPlatformResolution` is set. + by `GetReferenceNearestTargetFrameworkTask`, so let them flow when `EnableDynamicPlatformResolution` is set. --> + diff --git a/src/Tasks/Microsoft.Common.props b/src/Tasks/Microsoft.Common.props index 4b20447abdf..4385c405f61 100644 --- a/src/Tasks/Microsoft.Common.props +++ b/src/Tasks/Microsoft.Common.props @@ -10,7 +10,7 @@ Copyright (C) Microsoft Corporation. All rights reserved. *********************************************************************************************** --> - + true diff --git a/src/Tasks/Microsoft.Common.targets b/src/Tasks/Microsoft.Common.targets index ff31db3c66e..a2e63d0c48d 100644 --- a/src/Tasks/Microsoft.Common.targets +++ b/src/Tasks/Microsoft.Common.targets @@ -14,7 +14,7 @@ Copyright (C) Microsoft Corporation. All rights reserved. *********************************************************************************************** --> - + $(MSBuildToolsPath)\Microsoft.Common.CurrentVersion.targets diff --git a/src/Tasks/Microsoft.Common.tasks b/src/Tasks/Microsoft.Common.tasks index ec7d33ea7cf..3be5690920c 100644 --- a/src/Tasks/Microsoft.Common.tasks +++ b/src/Tasks/Microsoft.Common.tasks @@ -1,4 +1,4 @@ - + diff --git a/src/Tasks/Microsoft.Data.Entity.targets b/src/Tasks/Microsoft.Data.Entity.targets index 534b0e4c192..80d43afd2be 100644 --- a/src/Tasks/Microsoft.Data.Entity.targets +++ b/src/Tasks/Microsoft.Data.Entity.targets @@ -1,4 +1,4 @@ - + - + - + true diff --git a/src/Tasks/Microsoft.NETFramework.CurrentVersion.targets b/src/Tasks/Microsoft.NETFramework.CurrentVersion.targets index 5e79387e8cd..6145e82de80 100644 --- a/src/Tasks/Microsoft.NETFramework.CurrentVersion.targets +++ b/src/Tasks/Microsoft.NETFramework.CurrentVersion.targets @@ -13,7 +13,7 @@ Copyright (C) Microsoft Corporation. All rights reserved. *********************************************************************************************** --> - + true diff --git a/src/Tasks/Microsoft.NETFramework.props b/src/Tasks/Microsoft.NETFramework.props index 0bcdb236dbe..805a6081510 100644 --- a/src/Tasks/Microsoft.NETFramework.props +++ b/src/Tasks/Microsoft.NETFramework.props @@ -13,7 +13,7 @@ Copyright (C) Microsoft Corporation. All rights reserved. *********************************************************************************************** --> - + $(MSBuildToolsPath)\Microsoft.NETFramework.CurrentVersion.props diff --git a/src/Tasks/Microsoft.NETFramework.targets b/src/Tasks/Microsoft.NETFramework.targets index ef06d37bd22..4d17decc15c 100644 --- a/src/Tasks/Microsoft.NETFramework.targets +++ b/src/Tasks/Microsoft.NETFramework.targets @@ -13,7 +13,7 @@ Copyright (C) Microsoft Corporation. All rights reserved. *********************************************************************************************** --> - + $(MSBuildToolsPath)\Microsoft.NETFramework.CurrentVersion.targets diff --git a/src/Tasks/Microsoft.ServiceModel.targets b/src/Tasks/Microsoft.ServiceModel.targets index 10579ef15e2..41d4b1f3d59 100644 --- a/src/Tasks/Microsoft.ServiceModel.targets +++ b/src/Tasks/Microsoft.ServiceModel.targets @@ -1,4 +1,4 @@ - + - + diff --git a/src/Tasks/Microsoft.VisualBasic.CurrentVersion.targets b/src/Tasks/Microsoft.VisualBasic.CurrentVersion.targets index 45f937a1389..daebf98475b 100644 --- a/src/Tasks/Microsoft.VisualBasic.CurrentVersion.targets +++ b/src/Tasks/Microsoft.VisualBasic.CurrentVersion.targets @@ -15,7 +15,7 @@ Copyright (C) Microsoft Corporation. All rights reserved. *********************************************************************************************** --> - + true diff --git a/src/Tasks/Microsoft.VisualBasic.targets b/src/Tasks/Microsoft.VisualBasic.targets index 666a807bede..3616981103c 100644 --- a/src/Tasks/Microsoft.VisualBasic.targets +++ b/src/Tasks/Microsoft.VisualBasic.targets @@ -16,7 +16,7 @@ Copyright (C) Microsoft Corporation. All rights reserved. *********************************************************************************************** --> - + diff --git a/src/Tasks/Microsoft.WinFx.targets b/src/Tasks/Microsoft.WinFx.targets index 4cf77fc6f3c..a2e5e8be195 100644 --- a/src/Tasks/Microsoft.WinFx.targets +++ b/src/Tasks/Microsoft.WinFx.targets @@ -1,4 +1,4 @@ - + - + - + + + @@ -850,11 +850,11 @@ Task IRequestBuilderCallback.BlockOnTargetInProgress(int blockingRequestId, stri #endregion -/********************************************************************************* - * - * Helpers - * - *********************************************************************************/ + /********************************************************************************* + * + * Helpers + * + *********************************************************************************/ /// /// Helper method for validating the setting of defining project metadata on items @@ -871,7 +871,7 @@ private void ValidateDefiningProjectMetadataOnTaskOutputsHelper(string customTas - @@ -880,10 +880,10 @@ private void ValidateDefiningProjectMetadataOnTaskOutputsHelper(string customTas - - - - + + + + "; @@ -1092,11 +1092,11 @@ private ProjectInstance CreateTestProject() - - - - - + + + + + @@ -1147,7 +1147,7 @@ private ProjectInstance CreateTestProject() /// private class MockHost : MockLoggingService, IBuildComponentHost, IBuildComponent { -#region IBuildComponentHost Members + #region IBuildComponentHost Members /// /// The config cache @@ -1285,9 +1285,9 @@ public void RegisterFactory(BuildComponentType type, BuildComponentFactoryDelega { } -#endregion + #endregion -#region IBuildComponent Members + #region IBuildComponent Members /// /// Sets the component host @@ -1306,7 +1306,7 @@ public void ShutdownComponent() throw new NotImplementedException(); } -#endregion + #endregion } } } diff --git a/src/Build.UnitTests/BackEnd/TaskHost_Tests.cs b/src/Build.UnitTests/BackEnd/TaskHost_Tests.cs index fe372c03fda..7733f0aac37 100644 --- a/src/Build.UnitTests/BackEnd/TaskHost_Tests.cs +++ b/src/Build.UnitTests/BackEnd/TaskHost_Tests.cs @@ -498,7 +498,7 @@ public void IsRunningMultipleNodes4Nodes() public void LogCustomAfterTaskIsDone() { string projectFileContents = @" - + @@ -534,7 +534,7 @@ public void LogCustomAfterTaskIsDone() public void LogCommentAfterTaskIsDone() { string projectFileContents = @" - + @@ -570,7 +570,7 @@ public void LogCommentAfterTaskIsDone() public void LogWarningAfterTaskIsDone() { string projectFileContents = @" - + @@ -606,7 +606,7 @@ public void LogWarningAfterTaskIsDone() public void LogErrorAfterTaskIsDone() { string projectFileContents = @" - + diff --git a/src/Build.UnitTests/BinaryLogger_Tests.cs b/src/Build.UnitTests/BinaryLogger_Tests.cs index 17527ef7440..cb255f7ae9b 100644 --- a/src/Build.UnitTests/BinaryLogger_Tests.cs +++ b/src/Build.UnitTests/BinaryLogger_Tests.cs @@ -18,7 +18,7 @@ namespace Microsoft.Build.UnitTests public class BinaryLoggerTests : IDisposable { private const string s_testProject = @" - + Test diff --git a/src/Build.UnitTests/ConsoleLogger_Tests.cs b/src/Build.UnitTests/ConsoleLogger_Tests.cs index e73b77312b4..2a6a823e973 100644 --- a/src/Build.UnitTests/ConsoleLogger_Tests.cs +++ b/src/Build.UnitTests/ConsoleLogger_Tests.cs @@ -33,7 +33,7 @@ public class ConsoleLoggerTest private Dictionary _environment; private static string s_dummyProjectContents = @" - + @@ -103,7 +103,7 @@ internal void ResetColor() _simulatedConsole.Append(""); } - public static implicit operator string (SimulatedConsole sc) + public static implicit operator string(SimulatedConsole sc) { return sc.ToString(); } @@ -289,7 +289,7 @@ public void ErrorMessageWithMultiplePropertiesInMessage(bool includeEvaluationPr

- + diff --git a/src/Build.UnitTests/Construction/SolutionProjectGenerator_Tests.cs b/src/Build.UnitTests/Construction/SolutionProjectGenerator_Tests.cs index 44a8a18a6a6..2b50c83925d 100644 --- a/src/Build.UnitTests/Construction/SolutionProjectGenerator_Tests.cs +++ b/src/Build.UnitTests/Construction/SolutionProjectGenerator_Tests.cs @@ -249,8 +249,8 @@ public void EmitToolsVersionAttributeToInMemoryProject10() } ///

- /// Test to make sure that if the solution file version doesn't map to a sub-toolset version, we won't try - /// to force it to be used. + /// Test to make sure that if the solution file version doesn't map to a sub-toolset version, we won't try + /// to force it to be used. /// [Fact(Skip = "Needs investigation")] public void DefaultSubToolsetIfSolutionVersionSubToolsetDoesntExist() @@ -291,8 +291,8 @@ public void DefaultSubToolsetIfSolutionVersionSubToolsetDoesntExist() } /// - /// Test to make sure that if the solution version corresponds to an existing sub-toolset version, - /// barring other factors that might override, the sub-toolset will be based on the solution version. + /// Test to make sure that if the solution version corresponds to an existing sub-toolset version, + /// barring other factors that might override, the sub-toolset will be based on the solution version. /// [Fact] public void SubToolsetSetBySolutionVersion() @@ -327,7 +327,7 @@ public void SubToolsetSetBySolutionVersion() } /// - /// Test to make sure that even if the solution version corresponds to an existing sub-toolset version, + /// Test to make sure that even if the solution version corresponds to an existing sub-toolset version, /// [Fact] [Trait("Category", "mono-osx-failing")] @@ -503,7 +503,7 @@ public void SolutionPassesSubToolsetToChildProjects2() /// /// Test to make sure that, when we're not TV 4.0 -- which even for Dev11 solutions we are not by default -- that we - /// do not pass VisualStudioVersion down to the child projects. + /// do not pass VisualStudioVersion down to the child projects. /// [Fact(Skip = "Needs investigation")] public void SolutionDoesntPassSubToolsetToChildProjects() @@ -512,7 +512,7 @@ public void SolutionDoesntPassSubToolsetToChildProjects() { string classLibraryContents = @" - + @@ -568,7 +568,7 @@ public void SolutionDoesntPassSubToolsetToChildProjects() } /// - /// Verify that we throw the appropriate error if the solution declares a dependency + /// Verify that we throw the appropriate error if the solution declares a dependency /// on a project that doesn't exist. /// [Fact] @@ -1192,7 +1192,7 @@ public void ToolsVersionOverrideShouldBeSpecifiedOnMSBuildTaskInvocations() #if FEATURE_MULTIPLE_TOOLSETS /// - /// Make sure that whatever the solution ToolsVersion is, it gets mapped to all its metaprojs, too. + /// Make sure that whatever the solution ToolsVersion is, it gets mapped to all its metaprojs, too. /// [Fact] public void SolutionWithDependenciesHasCorrectToolsVersionInMetaprojs() @@ -1239,22 +1239,22 @@ public void SolutionWithDependenciesHasCorrectToolsVersionInMetaprojs() Assert.Equal(2, instances.Length); - // Solution metaproj + // Solution metaproj Assert.Equal(solutionToolsVersion, instances[0].ToolsVersion); ICollection projectReferences = instances[0].GetItems("ProjectReference"); foreach (ProjectItemInstance projectReference in projectReferences) { - // If this is the reference to the metaproj, its ToolsVersion metadata needs to match - // the solution ToolsVersion -- that's how the build knows which ToolsVersion to use. + // If this is the reference to the metaproj, its ToolsVersion metadata needs to match + // the solution ToolsVersion -- that's how the build knows which ToolsVersion to use. if (projectReference.EvaluatedInclude.EndsWith(".metaproj", StringComparison.OrdinalIgnoreCase)) { Assert.Equal(solutionToolsVersion, projectReference.GetMetadataValue("ToolsVersion")); } } - // Project metaproj for project with dependencies + // Project metaproj for project with dependencies Assert.Equal(solutionToolsVersion, instances[1].ToolsVersion); } } @@ -1293,7 +1293,7 @@ public void ToolsVersionOverrideCausesToolsetRedirect() try { - // SolutionProjectGenerator.Generate() is used at build-time, and creates evaluation- and + // SolutionProjectGenerator.Generate() is used at build-time, and creates evaluation- and // execution-model projects; as such it will throw if fed an explicitly invalid toolsversion ProjectInstance[] instances = SolutionProjectGenerator.Generate(solution, null, "invalid", _buildEventContext, CreateMockLoggingService()); } @@ -1525,7 +1525,7 @@ public void VenusSolutionDefaultTargetFrameworkVersion() msbuildProject = CreateVenusSolutionProject("2.0"); Assert.Equal("v2.0", msbuildProject.GetPropertyValue("TargetFrameworkVersion")); - // may be user defined + // may be user defined IDictionary globalProperties = new Dictionary(); globalProperties.Add("TargetFrameworkVersion", "userdefined"); msbuildProject = CreateVenusSolutionProject(globalProperties); @@ -1915,7 +1915,7 @@ public void BadFrameworkMonkierExpectBuildToFail() try { - // Since we're creating our own BuildManager, we need to make sure that the default + // Since we're creating our own BuildManager, we need to make sure that the default // one has properly relinquished the inproc node NodeProviderInProc nodeProviderInProc = ((IBuildComponentHost)BuildManager.DefaultBuildManager).GetComponent(BuildComponentType.InProcNodeProvider) as NodeProviderInProc; nodeProviderInProc?.Dispose(); @@ -2003,7 +2003,7 @@ public void BadFrameworkMonkierExpectBuildToFail2() try { - // Since we're creating our own BuildManager, we need to make sure that the default + // Since we're creating our own BuildManager, we need to make sure that the default // one has properly relinquished the inproc node NodeProviderInProc nodeProviderInProc = ((IBuildComponentHost)BuildManager.DefaultBuildManager).GetComponent(BuildComponentType.InProcNodeProvider) as NodeProviderInProc; nodeProviderInProc?.Dispose(); @@ -2448,7 +2448,7 @@ public void DirectorySolutionPropsTest(string projectName, bool enable) var solutionFile = SolutionFile.Parse(solutionFilePath); ProjectInstance projectInstance = SolutionProjectGenerator.Generate(solutionFile, globalProperties, null, BuildEventContext.Invalid, CreateMockLoggingService(), new[] { "Build" }).FirstOrDefault(); - + Assert.NotNull(projectInstance); Assert.Equal(enable ? expectedPropertyValue : string.Empty, projectInstance.GetPropertyValue("PropertyA")); @@ -2570,7 +2570,7 @@ private ILoggingService CreateMockLoggingService() /// /// Checks the provided project for a matching itemtype and include value. If it - /// does not exist, asserts. + /// does not exist, asserts. /// private void AssertProjectContainsItem(ProjectInstance msbuildProject, string itemType, string include) { @@ -2589,7 +2589,7 @@ private void AssertProjectContainsItem(ProjectInstance msbuildProject, string it } /// - /// Counts the number of items with a particular itemtype in the provided project, and + /// Counts the number of items with a particular itemtype in the provided project, and /// asserts if it doesn't match the provided count. /// private void AssertProjectItemNameCount(ProjectInstance msbuildProject, string itemType, int count) diff --git a/src/Build.UnitTests/Construction/XmlReaderWithoutLocation_Tests.cs b/src/Build.UnitTests/Construction/XmlReaderWithoutLocation_Tests.cs index b790a35ea3a..703e0a5b7ee 100644 --- a/src/Build.UnitTests/Construction/XmlReaderWithoutLocation_Tests.cs +++ b/src/Build.UnitTests/Construction/XmlReaderWithoutLocation_Tests.cs @@ -157,7 +157,7 @@ public void CreateProjectWithoutLineInfo() { XmlReader reader = XmlReader.Create(new StringReader ( - @" + @" " )); diff --git a/src/Build.UnitTests/Definition/ItemDefinitionGroup_Tests.cs b/src/Build.UnitTests/Definition/ItemDefinitionGroup_Tests.cs index a04dbc363b2..94626b132d4 100644 --- a/src/Build.UnitTests/Definition/ItemDefinitionGroup_Tests.cs +++ b/src/Build.UnitTests/Definition/ItemDefinitionGroup_Tests.cs @@ -32,7 +32,7 @@ public class ItemDefinitionGroup_Tests public void ItemDefinitionGroupExistsInProject() { Project p = new Project(XmlReader.Create(new StringReader( - @" + @" 1st @@ -53,7 +53,7 @@ public void ItemDefinitionGroupExistsInProject() public void MultipleItemDefinitionGroupExistsInProject() { Project p = new Project(XmlReader.Create(new StringReader( - @" + @" 1st @@ -82,7 +82,7 @@ public void MultipleItemDefinitionGroupExistsInProject() public void EmptyItemsInheritValues() { Project p = new Project(XmlReader.Create(new StringReader( - @" + @" 1st @@ -115,7 +115,7 @@ public void EmptyItemsInheritValues() public void ItemMetadataOverridesInheritedValues() { Project p = new Project(XmlReader.Create(new StringReader( - @" + @" 1st @@ -160,7 +160,7 @@ public void ItemDefinitionDoesntAllowItemExpansion() Assert.Throws(() => { Project p = new Project(XmlReader.Create(new StringReader( - @" + @" Bar @@ -190,7 +190,7 @@ public void ItemDefinitionMetadataConditionDoesntAllowItemExpansion() Assert.Throws(() => { Project p = new Project(XmlReader.Create(new StringReader( - @" + @" Bar @@ -219,7 +219,7 @@ public void ItemDefinitionMetadataDoesntAllowItemExpansion() Assert.Throws(() => { Project p = new Project(XmlReader.Create(new StringReader( - @" + @" Bar @@ -247,7 +247,7 @@ public void ItemDefinitionMetadataDoesntAllowItemExpansion() public void ItemMetadataReferringToDifferentItemGivesEmptyValue() { Project p = new Project(XmlReader.Create(new StringReader( - @" + @" 1st @@ -285,7 +285,7 @@ public void ItemMetadataReferringToDifferentItemGivesEmptyValue() public void EmptyItemDefinitionGroup() { Project p = new Project(XmlReader.Create(new StringReader( - @" + @" @@ -302,7 +302,7 @@ public void EmptyItemDefinitionGroup() public void EmptyItemDefinitions() { Project p = new Project(XmlReader.Create(new StringReader( - @" + @" @@ -323,7 +323,7 @@ public void SelfReferencingMetadataReferencesUseItemDefinition() { MockLogger logger = new MockLogger(); Project p = new Project(XmlReader.Create(new StringReader(@" - + @@ -352,7 +352,7 @@ public void SelfReferencingMetadataReferencesUseItemDefinitionInTarget() { MockLogger logger = new MockLogger(); Project p = new Project(XmlReader.Create(new StringReader(@" - + @@ -380,7 +380,7 @@ public void SelfReferencingMetadataReferencesUseItemDefinitionInTargetModify() { MockLogger logger = new MockLogger(); Project p = new Project(XmlReader.Create(new StringReader(@" - + @@ -413,7 +413,7 @@ public void SelfReferencingMetadataReferencesUseItemDefinitionInTargetModify() public void ItemDefinitionGroupWithFalseCondition() { Project p = new Project(XmlReader.Create(new StringReader( - @" + @" 1st @@ -439,7 +439,7 @@ public void ItemDefinitionGroupWithFalseCondition() public void ItemDefinitionGroupWithTrueCondition() { Project p = new Project(XmlReader.Create(new StringReader( - @" + @" 1st @@ -465,7 +465,7 @@ public void ItemDefinitionGroupWithTrueCondition() public void ItemDefinitionWithFalseCondition() { Project p = new Project(XmlReader.Create(new StringReader( - @" + @" 1st @@ -491,7 +491,7 @@ public void ItemDefinitionWithFalseCondition() public void ItemDefinitionWithTrueCondition() { Project p = new Project(XmlReader.Create(new StringReader( - @" + @" 1st @@ -517,7 +517,7 @@ public void ItemDefinitionWithTrueCondition() public void ItemDefinitionMetadataWithFalseCondition() { Project p = new Project(XmlReader.Create(new StringReader( - @" + @" 1st @@ -543,7 +543,7 @@ public void ItemDefinitionMetadataWithFalseCondition() public void ItemDefinitionMetadataWithTrueCondition() { Project p = new Project(XmlReader.Create(new StringReader( - @" + @" 1st @@ -569,7 +569,7 @@ public void ItemDefinitionMetadataWithTrueCondition() public void ItemDefinitionMetadataCopiedToTaskItem() { Project p = new Project(XmlReader.Create(new StringReader( - @" + @" M-A(b) @@ -604,7 +604,7 @@ public void ItemDefinitionMetadataCopiedToTaskItem() public void ItemDefinitionMetadataCopiedToTaskItem2() { Project p = new Project(XmlReader.Create(new StringReader( - @" + @" M-A(b) @@ -642,7 +642,7 @@ public void ItemDefinitionMetadataCopiedToTaskItem2() public void ItemDefinitionMetadataCopiedToTaskItem3() { Project p = new Project(XmlReader.Create(new StringReader( - @" + @" M-A(b) @@ -685,7 +685,7 @@ public void BasicItemDefinitionInProject() { MockLogger logger = new MockLogger(); Project p = new Project(XmlReader.Create(new StringReader(@" - + @@ -693,7 +693,7 @@ public void BasicItemDefinitionInProject() DEBUG - + @@ -712,7 +712,7 @@ public void EscapingInItemDefinitionInProject() { MockLogger logger = new MockLogger(); Project p = new Project(XmlReader.Create(new StringReader(@" - + @@ -720,7 +720,7 @@ public void EscapingInItemDefinitionInProject() %24(xyz) - + @@ -737,7 +737,7 @@ public void ItemDefinitionForOtherItemType() { MockLogger logger = new MockLogger(); Project p = new Project(XmlReader.Create(new StringReader(@" - + @@ -745,7 +745,7 @@ public void ItemDefinitionForOtherItemType() m1 - + @@ -761,7 +761,7 @@ public void RedefinitionLastOneWins() { MockLogger logger = new MockLogger(); Project p = new Project(XmlReader.Create(new StringReader(@" - + @@ -770,13 +770,13 @@ public void RedefinitionLastOneWins() m1 n1 - + m2 o1 - + @@ -795,12 +795,12 @@ public void ItemExpressionInDefaultMetadataValueErrors() // We don't allow item expressions on an ItemDefinitionGroup because there are no items when IDG is evaluated. MockLogger logger = new MockLogger(); Project p = new Project(XmlReader.Create(new StringReader(@" - + @(x) - + "))); p.Build("t", new ILogger[] { logger }); @@ -815,7 +815,7 @@ public void UnqualifiedMetadataConditionOnItemDefinitionGroupErrors() // We don't allow unqualified metadata on an ItemDefinitionGroup because we don't know what item type it refers to. MockLogger logger = new MockLogger(); Project p = new Project(XmlReader.Create(new StringReader(@" - + "))); @@ -832,7 +832,7 @@ public void QualifiedMetadataConditionOnItemDefinitionGroupErrors() // We don't allow qualified metadata because it's not worth distinguishing from unqualified, when you can just move the condition to the child. MockLogger logger = new MockLogger(); Project p = new Project(XmlReader.Create(new StringReader(@" - + "))); @@ -845,7 +845,7 @@ public void MetadataConditionOnItemDefinition() { MockLogger logger = new MockLogger(); Project p = new Project(XmlReader.Create(new StringReader(@" - + @@ -857,16 +857,16 @@ public void MetadataConditionOnItemDefinition() n1 - + m2 - n2 + n2 - + @@ -883,7 +883,7 @@ public void QualifiedMetadataConditionOnItemDefinitionBothQualifiedAndUnqualifie { MockLogger logger = new MockLogger(); Project p = new Project(XmlReader.Create(new StringReader(@" - + @@ -891,12 +891,12 @@ public void QualifiedMetadataConditionOnItemDefinitionBothQualifiedAndUnqualifie m1 - + m2 - + @@ -912,7 +912,7 @@ public void FalseMetadataConditionOnItemDefinitionBothQualifiedAndUnqualified() { MockLogger logger = new MockLogger(); Project p = new Project(XmlReader.Create(new StringReader(@" - + @@ -920,12 +920,12 @@ public void FalseMetadataConditionOnItemDefinitionBothQualifiedAndUnqualified() m1 - + m3 - + @@ -941,7 +941,7 @@ public void MetadataConditionOnItemDefinitionChildBothQualifiedAndUnqualified() { MockLogger logger = new MockLogger(); Project p = new Project(XmlReader.Create(new StringReader(@" - + @@ -950,12 +950,12 @@ public void MetadataConditionOnItemDefinitionChildBothQualifiedAndUnqualified() m1 n1 - + m2 - + @@ -971,7 +971,7 @@ public void FalseMetadataConditionOnItemDefinitionChildBothQualifiedAndUnqualifi { MockLogger logger = new MockLogger(); Project p = new Project(XmlReader.Create(new StringReader(@" - + @@ -980,7 +980,7 @@ public void FalseMetadataConditionOnItemDefinitionChildBothQualifiedAndUnqualifi m1 n1 - + m3 @@ -1001,7 +1001,7 @@ public void MetadataConditionOnItemDefinitionAndChildQualifiedWithUnrelatedItemT { MockLogger logger = new MockLogger(); Project p = new Project(XmlReader.Create(new StringReader(@" - + @@ -1009,12 +1009,12 @@ public void MetadataConditionOnItemDefinitionAndChildQualifiedWithUnrelatedItemT m1 - + m2 - + @@ -1027,8 +1027,8 @@ public void MetadataConditionOnItemDefinitionAndChildQualifiedWithUnrelatedItemT /// /// Make ItemDefinitionGroup inside a target produce a nice error. - /// It will normally produce an error due to the invalid child tag, but - /// we want to error even if there's no child tag. This will make it + /// It will normally produce an error due to the invalid child tag, but + /// we want to error even if there's no child tag. This will make it /// easier to support it inside targets in a future version. /// [Fact] @@ -1038,7 +1038,7 @@ public void ItemDefinitionInTargetErrors() { MockLogger logger = new MockLogger(); Project p = new Project(XmlReader.Create(new StringReader(@" - + @@ -1056,7 +1056,7 @@ public void ItemDefinitionInTargetErrors() public void ItemDefinitionGroupTask() { MockLogger ml = Helpers.BuildProjectWithNewOMExpectSuccess(String.Format(@" - + @@ -1073,7 +1073,7 @@ public void MetadataOnItemWins() { MockLogger logger = new MockLogger(); Project p = new Project(XmlReader.Create(new StringReader(@" - + RETAIL @@ -1084,7 +1084,7 @@ public void MetadataOnItemWins() DEBUG - + @@ -1100,7 +1100,7 @@ public void MixtureOfItemAndDefaultMetadata() { MockLogger logger = new MockLogger(); Project p = new Project(XmlReader.Create(new StringReader(@" - + 4 @@ -1110,7 +1110,7 @@ public void MixtureOfItemAndDefaultMetadata() DEBUG - + @@ -1127,7 +1127,7 @@ public void IntrinsicTaskModifyingDefaultMetadata() { MockLogger logger = new MockLogger(); Project p = new Project(XmlReader.Create(new StringReader(@" - + @@ -1135,7 +1135,7 @@ public void IntrinsicTaskModifyingDefaultMetadata() m1 - + @@ -1156,7 +1156,7 @@ public void IntrinsicTaskConsumingDefaultMetadata() { MockLogger logger = new MockLogger(); Project p = new Project(XmlReader.Create(new StringReader(@" - + @@ -1164,7 +1164,7 @@ public void IntrinsicTaskConsumingDefaultMetadata() m1 - + @@ -1190,18 +1190,18 @@ public void DefinitionInImportedFile() { importedFile = FileUtilities.GetTemporaryFile(); File.WriteAllText(importedFile, @" - + DEBUG - + "); Project p = new Project(XmlReader.Create(new StringReader(@" - + - + @@ -1227,12 +1227,12 @@ public void DefinitionInImportedFile() public void ProjectAddNewItemPicksUpProjectItemDefinitions() { Project p = new Project(XmlReader.Create(new StringReader(@" - + m1 - + "))); @@ -1250,12 +1250,12 @@ public void ProjectAddNewItemPicksUpProjectItemDefinitions() public void ProjectAddNewItemExistingGroupPicksUpProjectItemDefinitions() { Project p = new Project(XmlReader.Create(new StringReader(@" - + m1 - + m2 @@ -1276,13 +1276,13 @@ public void ItemsEmittedByTaskPickUpItemDefinitions() { MockLogger logger = new MockLogger(); Project p = new Project(XmlReader.Create(new StringReader(@" - + m1 n1 - + @@ -1302,13 +1302,13 @@ public void ItemsEmittedByIntrinsicTaskPickUpItemDefinitions() { MockLogger logger = new MockLogger(); Project p = new Project(XmlReader.Create(new StringReader(@" - + m1 n1 - + @@ -1334,12 +1334,12 @@ public void ItemsEmittedByIntrinsicTaskConsumingItemExpression_SourceDefaultMeta { MockLogger logger = new MockLogger(); Project p = new Project(XmlReader.Create(new StringReader(@" - + m1 - + @@ -1365,12 +1365,12 @@ public void ItemsEmittedByIntrinsicTaskConsumingItemExpression_DestinationExplic { MockLogger logger = new MockLogger(); Project p = new Project(XmlReader.Create(new StringReader(@" - + m1 - + @@ -1403,7 +1403,7 @@ public void ItemsEmittedByIntrinsicTaskConsumingItemExpression_DestinationDefaul { MockLogger logger = new MockLogger(); Project p = new Project(XmlReader.Create(new StringReader(@" - + m1 @@ -1411,7 +1411,7 @@ public void ItemsEmittedByIntrinsicTaskConsumingItemExpression_DestinationDefaul m2 - + @@ -1443,7 +1443,7 @@ public void ItemsEmittedByIntrinsicTaskConsumingItemExpression_Combination_Outsi { MockLogger logger = new MockLogger(); Project p = new Project(XmlReader.Create(new StringReader(@" - + im1 @@ -1461,7 +1461,7 @@ public void ItemsEmittedByIntrinsicTaskConsumingItemExpression_Combination_Outsi kq4 kr4 - + io2 @@ -1535,7 +1535,7 @@ public void ItemsEmittedByIntrinsicTaskConsumingItemExpression_Combination_Insid { MockLogger logger = new MockLogger(); Project p = new Project(XmlReader.Create(new StringReader(@" - + im1 @@ -1552,7 +1552,7 @@ public void ItemsEmittedByIntrinsicTaskConsumingItemExpression_Combination_Insid km4 kq4 - + io2 @@ -1591,16 +1591,16 @@ public void MutualReferenceToDefinition1() { MockLogger logger = new MockLogger(); Project p = new Project(XmlReader.Create(new StringReader(@" - + m1 ~%(m)~ - + - + @@ -1617,16 +1617,16 @@ public void MutualReferenceToDefinition2() { MockLogger logger = new MockLogger(); Project p = new Project(XmlReader.Create(new StringReader(@" - + ~%(n)~ n1 - + - + @@ -1643,17 +1643,17 @@ public void MutualReferenceToDefinition3() { MockLogger logger = new MockLogger(); Project p = new Project(XmlReader.Create(new StringReader(@" - + m1 %(i.m) %(j.m) - + - + @@ -1670,7 +1670,7 @@ public void ProjectReevaluationReevaluatesItemDefinitions() { MockLogger logger = new MockLogger(); Project p = new Project(XmlReader.Create(new StringReader(@" - + CODEANALYSIS @@ -1682,7 +1682,7 @@ public void ProjectReevaluationReevaluatesItemDefinitions() $(Defines);RETAIL $(Defines);DEBUG - + @@ -1711,7 +1711,7 @@ public void MSBuildCallDoesNotAffectCallingProjectsDefinitions() try { otherProject = FileUtilities.GetTemporaryFile(); - string otherProjectContent = @" + string otherProjectContent = @" @@ -1719,7 +1719,7 @@ public void MSBuildCallDoesNotAffectCallingProjectsDefinitions() m2 - + @@ -1732,7 +1732,7 @@ public void MSBuildCallDoesNotAffectCallingProjectsDefinitions() MockLogger logger = new MockLogger(); Project p = new Project(XmlReader.Create(new StringReader(@" - + @@ -1740,7 +1740,7 @@ public void MSBuildCallDoesNotAffectCallingProjectsDefinitions() m1 - + @@ -1767,7 +1767,7 @@ public void DefaultMetadataTravelWithTargetOutputs() try { otherProject = FileUtilities.GetTemporaryFile(); - string otherProjectContent = @" + string otherProjectContent = @" m1 @@ -1777,7 +1777,7 @@ public void DefaultMetadataTravelWithTargetOutputs() n1 - + @@ -1790,7 +1790,7 @@ public void DefaultMetadataTravelWithTargetOutputs() MockLogger logger = new MockLogger(); Project p = new Project(XmlReader.Create(new StringReader(@" - + diff --git a/src/Build.UnitTests/Definition/ProjectHelpers.cs b/src/Build.UnitTests/Definition/ProjectHelpers.cs index a7ee529b63d..de7960e5361 100644 --- a/src/Build.UnitTests/Definition/ProjectHelpers.cs +++ b/src/Build.UnitTests/Definition/ProjectHelpers.cs @@ -23,7 +23,7 @@ internal static ProjectInstance CreateEmptyProjectInstance() { XmlReader reader = XmlReader.Create(new StringReader ( - @" + @" " )); diff --git a/src/Build.UnitTests/Definition/Project_Internal_Tests.cs b/src/Build.UnitTests/Definition/Project_Internal_Tests.cs index a2bef1d7c0c..c2a03e57d20 100644 --- a/src/Build.UnitTests/Definition/Project_Internal_Tests.cs +++ b/src/Build.UnitTests/Definition/Project_Internal_Tests.cs @@ -16,12 +16,12 @@ namespace Microsoft.Build.UnitTests.Definition { /// - /// Tests some manipulations of Project and ProjectCollection that require dealing with internal data. + /// Tests some manipulations of Project and ProjectCollection that require dealing with internal data. /// public class Project_Internal_Tests { /// - /// Set default tools version; subsequent projects should use it + /// Set default tools version; subsequent projects should use it /// [Fact] public void SetDefaultToolsVersion() @@ -31,8 +31,8 @@ public void SetDefaultToolsVersion() try { // In the new world of figuring out the ToolsVersion to use, we completely ignore the default - // ToolsVersion in the ProjectCollection. However, this test explicitly depends on modifying - // that, so we need to turn the new defaulting behavior off in order to verify that this still works. + // ToolsVersion in the ProjectCollection. However, this test explicitly depends on modifying + // that, so we need to turn the new defaulting behavior off in order to verify that this still works. Environment.SetEnvironmentVariable("MSBUILDLEGACYDEFAULTTOOLSVERSION", "1"); InternalUtilities.RefreshInternalEnvironmentValues(); @@ -44,7 +44,7 @@ public void SetDefaultToolsVersion() Assert.Equal("x", collection.DefaultToolsVersion); string content = @" - + "; @@ -61,10 +61,10 @@ public void SetDefaultToolsVersion() } /// - /// If the ToolsVersion in the project file is bogus, we'll default to the current ToolsVersion and successfully - /// load it. Make sure we can RE-load it, too, and successfully pick up the correct copy of the loaded project. - /// - /// ... Make sure we can do this even if we're not using the "always default everything to current anyway" codepath. + /// If the ToolsVersion in the project file is bogus, we'll default to the current ToolsVersion and successfully + /// load it. Make sure we can RE-load it, too, and successfully pick up the correct copy of the loaded project. + /// + /// ... Make sure we can do this even if we're not using the "always default everything to current anyway" codepath. /// [Fact] public void ReloadProjectWithInvalidToolsVersionInFile() @@ -74,13 +74,13 @@ public void ReloadProjectWithInvalidToolsVersionInFile() try { // In the new world of figuring out the ToolsVersion to use, we completely ignore the default - // ToolsVersion in the ProjectCollection. However, this test explicitly depends on modifying - // that, so we need to turn the new defaulting behavior off in order to verify that this still works. + // ToolsVersion in the ProjectCollection. However, this test explicitly depends on modifying + // that, so we need to turn the new defaulting behavior off in order to verify that this still works. Environment.SetEnvironmentVariable("MSBUILDLEGACYDEFAULTTOOLSVERSION", "1"); InternalUtilities.RefreshInternalEnvironmentValues(); string content = @" - + "; @@ -118,10 +118,10 @@ public void ProjectToolsVersion20Present() try { - // In the new world of figuring out the ToolsVersion to use, we completely ignore what + // In the new world of figuring out the ToolsVersion to use, we completely ignore what // is written in the project file. However, this test explicitly depends on effectively - // modifying the "project file" (through the construction model OM), so we need to turn - // that behavior off in order to verify that it still works. + // modifying the "project file" (through the construction model OM), so we need to turn + // that behavior off in order to verify that it still works. Environment.SetEnvironmentVariable("MSBUILDLEGACYDEFAULTTOOLSVERSION", "1"); InternalUtilities.RefreshInternalEnvironmentValues(); @@ -169,10 +169,10 @@ public void MSBuildToolsVersionProperty() try { - // In the new world of figuring out the ToolsVersion to use, we completely ignore what + // In the new world of figuring out the ToolsVersion to use, we completely ignore what // is written in the project file. However, this test explicitly depends on effectively - // modifying the "project file" (through the construction model OM), so we need to turn - // that behavior off in order to verify that it still works. + // modifying the "project file" (through the construction model OM), so we need to turn + // that behavior off in order to verify that it still works. Environment.SetEnvironmentVariable("MSBUILDLEGACYDEFAULTTOOLSVERSION", "1"); InternalUtilities.RefreshInternalEnvironmentValues(); @@ -202,13 +202,13 @@ public void MSBuildToolsVersionProperty() public void ProjectEvaluationShouldRespectConditionsIfProjectLoadSettingsSaysSo() { var projectContents = @" - + v - + v diff --git a/src/Build.UnitTests/Definition/ToolsVersion_Tests.cs b/src/Build.UnitTests/Definition/ToolsVersion_Tests.cs index 3921c17b9d1..9d292500a86 100644 --- a/src/Build.UnitTests/Definition/ToolsVersion_Tests.cs +++ b/src/Build.UnitTests/Definition/ToolsVersion_Tests.cs @@ -291,7 +291,7 @@ public void InvalidToolsVersionTooHighMappedToCurrent() service.RegisterLogger(mockLogger); bool success = false; - Project project = new Project(XmlReader.Create(new StringReader(@" + Project project = new Project(XmlReader.Create(new StringReader(@" ")), null /* no global properties */, null /* don't explicitly set the toolsversion */, p); @@ -326,7 +326,7 @@ public void InvalidToolsVersionMissingLowMappedToCurrent() service.RegisterLogger(mockLogger); bool success = false; - Project project = new Project(XmlReader.Create(new StringReader(@" + Project project = new Project(XmlReader.Create(new StringReader(@" ")), null /* no global properties */, null /* don't explicitly set the toolsversion */, p); @@ -359,7 +359,7 @@ public void InvalidToolsVersionMissingMappedToCurrent() service.RegisterLogger(mockLogger); bool success = false; - Project project = new Project(XmlReader.Create(new StringReader(@" + Project project = new Project(XmlReader.Create(new StringReader(@" ")), null /* no global properties */, null /* don't explicitly set the toolsversion */, p); @@ -387,7 +387,7 @@ public void InvalidToolsVersion() service.RegisterLogger(mockLogger); bool success = false; - Project project = new Project(XmlReader.Create(new StringReader(@" + Project project = new Project(XmlReader.Create(new StringReader(@" ")), null /* no global properties */, "goober", p); @@ -418,7 +418,7 @@ public void ToolsVersionMappedToCurrent() service.RegisterLogger(mockLogger); bool success = false; - Project project = new Project(XmlReader.Create(new StringReader(@" + Project project = new Project(XmlReader.Create(new StringReader(@" ")), null /* no global properties */, null /* don't explicitly set the toolsversion */, p); @@ -446,7 +446,7 @@ public void CustomToolsVersionIsHonored() Environment.SetEnvironmentVariable("MSBUILDTREATALLTOOLSVERSIONSASCURRENT", String.Empty); try { - string content = @" + string content = @" @@ -487,7 +487,7 @@ public void ToolsVersionFallbackIfCurrentToolsVersionDoesNotExist() MockLogger mockLogger = new MockLogger(); LoggingService service = (LoggingService)LoggingService.CreateLoggingService(LoggerMode.Synchronous, 1); service.RegisterLogger(mockLogger); - Project project = new Project(XmlReader.Create(new StringReader(@" + Project project = new Project(XmlReader.Create(new StringReader(@" ")), null /* no global properties */, null /* don't explicitly set the toolsversion */, p); @@ -522,7 +522,7 @@ public void ToolsVersionFromEnvironmentVariable() service.RegisterLogger(mockLogger); bool success = false; - Project project = new Project(XmlReader.Create(new StringReader(@" + Project project = new Project(XmlReader.Create(new StringReader(@" ")), null /* no global properties */, null /* don't explicitly set the toolsversion */, p); @@ -559,7 +559,7 @@ public void InvalidToolsVersionFromEnvironmentVariable() service.RegisterLogger(mockLogger); bool success = false; - Project project = new Project(XmlReader.Create(new StringReader(@" + Project project = new Project(XmlReader.Create(new StringReader(@" ")), null /* no global properties */, null /* don't explicitly set the toolsversion */, p); @@ -599,7 +599,7 @@ public void ToolsVersionMappedToCurrent_CreateProjectInstance() service.RegisterLogger(mockLogger); bool success = false; - Project project = new Project(XmlReader.Create(new StringReader(@" + Project project = new Project(XmlReader.Create(new StringReader(@" ")), null /* no global properties */, null /* don't explicitly set the toolsversion */, p); @@ -632,7 +632,7 @@ public void ToolsVersionFallbackIfCurrentToolsVersionDoesNotExist_CreateProjectI MockLogger mockLogger = new MockLogger(); LoggingService service = (LoggingService)LoggingService.CreateLoggingService(LoggerMode.Synchronous, 1); service.RegisterLogger(mockLogger); - Project project = new Project(XmlReader.Create(new StringReader(@" + Project project = new Project(XmlReader.Create(new StringReader(@" ")), null /* no global properties */, null /* don't explicitly set the toolsversion */, p); @@ -668,7 +668,7 @@ public void ToolsVersionFromEnvironmentVariable_CreateProjectInstance() service.RegisterLogger(mockLogger); bool success = false; - Project project = new Project(XmlReader.Create(new StringReader(@" + Project project = new Project(XmlReader.Create(new StringReader(@" ")), null /* no global properties */, null /* don't explicitly set the toolsversion */, p); @@ -708,7 +708,7 @@ public void InvalidToolsVersionFromEnvironmentVariable_CreateProjectInstance() service.RegisterLogger(mockLogger); bool success = false; - Project project = new Project(XmlReader.Create(new StringReader(@" + Project project = new Project(XmlReader.Create(new StringReader(@" ")), null /* no global properties */, null /* don't explicitly set the toolsversion */, p); @@ -751,7 +751,7 @@ public void ToolsVersionMappedToCurrent_ProjectInstance() service.RegisterLogger(mockLogger); bool success = false; - Project project = new Project(XmlReader.Create(new StringReader(@" + Project project = new Project(XmlReader.Create(new StringReader(@" ")), null /* no global properties */, null /* don't explicitly set the toolsversion */, p); @@ -784,7 +784,7 @@ public void ToolsVersionFallbackIfCurrentToolsVersionDoesNotExist_ProjectInstanc MockLogger mockLogger = new MockLogger(); LoggingService service = (LoggingService)LoggingService.CreateLoggingService(LoggerMode.Synchronous, 1); service.RegisterLogger(mockLogger); - Project project = new Project(XmlReader.Create(new StringReader(@" + Project project = new Project(XmlReader.Create(new StringReader(@" ")), null /* no global properties */, null /* don't explicitly set the toolsversion */, p); @@ -819,7 +819,7 @@ public void ToolsVersionFromEnvironmentVariable_ProjectInstance() service.RegisterLogger(mockLogger); bool success = false; - Project project = new Project(XmlReader.Create(new StringReader(@" + Project project = new Project(XmlReader.Create(new StringReader(@" ")), null /* no global properties */, null /* don't explicitly set the toolsversion */, p); @@ -859,7 +859,7 @@ public void InvalidToolsVersionFromEnvironmentVariable_ProjectInstance() service.RegisterLogger(mockLogger); bool success = false; - Project project = new Project(XmlReader.Create(new StringReader(@" + Project project = new Project(XmlReader.Create(new StringReader(@" ")), null /* no global properties */, null /* don't explicitly set the toolsversion */, p); @@ -956,7 +956,7 @@ private XmlDocumentWithLocation loadXmlFromPath(string path) new DefaultTasksFile(NativeMethodsShared.IsWindows ? "c:\\directory1\\directory2\\a.tasks" : "/directory1/directory2/a.tasks", - @" + @" @@ -965,37 +965,37 @@ private XmlDocumentWithLocation loadXmlFromPath(string path) new DefaultTasksFile(NativeMethodsShared.IsWindows ? "c:\\directory1\\directory2\\b.tasks" : "/directory1/directory2/b.tasks", - @" + @" "), new DefaultTasksFile(NativeMethodsShared.IsWindows ? "c:\\directory1\\directory2\\c.tasksfile" : "/directory1/directory2/c.taskfile", - @" + @" "), new DefaultTasksFile(NativeMethodsShared.IsWindows ? "c:\\directory1\\directory2\\directory3\\d.tasks" : "/directory1/directory2/directory3/d.tasks", - @" + @" "), new DefaultTasksFile(NativeMethodsShared.IsWindows ? "c:\\directory1\\directory2\\e.tasks" : "/directory1/directory2/e.tasks", - @" + @" "), new DefaultTasksFile(NativeMethodsShared.IsWindows ? "d:\\directory1\\directory2\\f.tasks" : "/d/directory1/directory2/f.tasks", - @" + @" "), new DefaultTasksFile(NativeMethodsShared.IsWindows ? "c:\\directory1\\directory2\\g.custom.tasks" : "/directory1/directory2/g.custom.tasks", - @" + @" @@ -1003,7 +1003,7 @@ private XmlDocumentWithLocation loadXmlFromPath(string path) new DefaultTasksFile(NativeMethodsShared.IsWindows ? "c:\\somepath\\1.tasks" : "/somepath/1.tasks", - @" + @" @@ -1011,13 +1011,13 @@ private XmlDocumentWithLocation loadXmlFromPath(string path) new DefaultTasksFile(NativeMethodsShared.IsWindows ? "c:\\somepath\\2.tasks" : "/somepath/2.tasks", - @" + @" "), new DefaultTasksFile(NativeMethodsShared.IsWindows ? "c:\\inline\\inlinetasks.tasks" : "/inline/inlinetasks.tasks", - @" + @" @@ -1030,7 +1030,7 @@ private XmlDocumentWithLocation loadXmlFromPath(string path) new DefaultTasksFile(NativeMethodsShared.IsWindows ? "c:\\msbuildoverridetasks\\1.overridetasks" : "/msbuildoverridetasks/1.overridetasks", - @" + @" @@ -1039,7 +1039,7 @@ private XmlDocumentWithLocation loadXmlFromPath(string path) new DefaultTasksFile(NativeMethodsShared.IsWindows ? "c:\\msbuildoverridetasks\\2.overridetasks" : "/msbuildoverridetasks/2.overridetasks", - @" + @" ") }; diff --git a/src/Build.UnitTests/Definition/ToolsetReader_Tests.cs b/src/Build.UnitTests/Definition/ToolsetReader_Tests.cs index 7b1f1f6e36b..57abe763aaf 100644 --- a/src/Build.UnitTests/Definition/ToolsetReader_Tests.cs +++ b/src/Build.UnitTests/Definition/ToolsetReader_Tests.cs @@ -45,7 +45,7 @@ public class ToolsetReaderTests : IDisposable private const string testRegistryPath = @"msbuildUnitTests"; /// - /// Store the value of the "VisualStudioVersion" environment variable here so that + /// Store the value of the "VisualStudioVersion" environment variable here so that /// we can unset it for the duration of the test. /// private string _oldVisualStudioVersion; @@ -124,7 +124,7 @@ public void GetToolsetDataFromConfiguration_SectionNotRegisteredInConfigFile() } #endif - #region "Reading from application configuration file tests" + #region "Reading from application configuration file tests" #if FEATURE_SYSTEM_CONFIGURATION @@ -669,7 +669,7 @@ public void BlankPropertyNameInRegistry() ); } /// - /// Tests the case when a blank property name is specified in the registry in a + /// Tests the case when a blank property name is specified in the registry in a /// sub-toolset. /// [Fact] @@ -957,7 +957,7 @@ public void GetToolsetDataFromConfiguration_PropertyValueIsEmptyString2() /// /// Tests that any escaped xml in config file, is treated well - /// Note that this comes for free with the current implementation using the + /// Note that this comes for free with the current implementation using the /// framework api to access section in the config file /// [Fact] @@ -988,9 +988,9 @@ public void GetToolsetDataFromConfiguration_XmlEscapedCharacters() Assert.Equal(@"some>value", values["2>.0"].Properties["foo"].EvaluatedValue); } #endif - #endregion + #endregion - #region "GetToolsetData tests" + #region "GetToolsetData tests" /// /// Tests the case where registry and config file contains different toolsVersion @@ -1407,7 +1407,7 @@ public void ToolsPathInRegistryHasInvalidPathChars() Dictionary values = new Dictionary(StringComparer.OrdinalIgnoreCase); - // should throw... + // should throw... ToolsetReader.ReadAllToolsets ( values, @@ -2006,9 +2006,9 @@ public void GetToolsetData_ConflictingPropertyValuesSameCase() } /// - /// Tests the case where application configuration file overrides a value already specified in the registry, - /// where that registry value is bogus and would otherwise throw. However, since the config file also - /// contains an entry for that toolset, the registry toolset never gets read, and thus never throws. + /// Tests the case where application configuration file overrides a value already specified in the registry, + /// where that registry value is bogus and would otherwise throw. However, since the config file also + /// contains an entry for that toolset, the registry toolset never gets read, and thus never throws. /// [Fact] public void GetToolsetData_ConflictingPropertyValuesRegistryThrows() @@ -2115,8 +2115,8 @@ public void ToolsVersionAttributeNotSpecifiedOnProjectElementAndDefaultVersionSp try { // In the new world of figuring out the ToolsVersion to use, we completely ignore the default - // ToolsVersion in the ProjectCollection. However, this test explicitly depends on modifying - // that, so we need to turn the new defaulting behavior off in order to verify that this still works. + // ToolsVersion in the ProjectCollection. However, this test explicitly depends on modifying + // that, so we need to turn the new defaulting behavior off in order to verify that this still works. Environment.SetEnvironmentVariable("MSBUILDLEGACYDEFAULTTOOLSVERSION", "1"); InternalUtilities.RefreshInternalEnvironmentValues(); @@ -2126,7 +2126,7 @@ public void ToolsVersionAttributeNotSpecifiedOnProjectElementAndDefaultVersionSp projectCollection.AddToolset(new Toolset("2.0", "20toolsPath", projectCollection, msbuildOverrideTasksPath)); projectCollection.AddToolset(new Toolset(ObjectModelHelpers.MSBuildDefaultToolsVersion, "120toolsPath", projectCollection, msbuildOverrideTasksPath)); - string projectPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("x.proj", @""); + string projectPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("x.proj", @""); Project project = projectCollection.LoadProject(projectPath); @@ -2188,8 +2188,8 @@ public void GetToolsetData_RegistryNotPresent() /// /// Test the case where nothing is specified in the config file - /// Note that config file not present is same as config file - /// with no MSBuildToolsets Section + /// Note that config file not present is same as config file + /// with no MSBuildToolsets Section /// [Fact] public void GetToolsetData_ConfigFileNotPresent() @@ -2324,9 +2324,9 @@ public void GetToolsetData_ReadRegistryOpenSubKeyThrowsException() }); } - #endregion + #endregion - #region "SetDefaultToolsetVersion tests" + #region "SetDefaultToolsetVersion tests" /// /// Tests that the default ToolsVersion is correctly resolved when specified @@ -2837,7 +2837,7 @@ public void GlobalPropertiesInToolsetsAreExpandedButAreNotOverwritten() Assert.Equal("gv1", values["4.0"].Properties["p2"].EvaluatedValue); } - #endregion + #endregion private ToolsetRegistryReader GetStandardRegistryReader() { diff --git a/src/Build.UnitTests/EscapingInProjects_Tests.cs b/src/Build.UnitTests/EscapingInProjects_Tests.cs index 952ae4b81cf..54c6967dd17 100644 --- a/src/Build.UnitTests/EscapingInProjects_Tests.cs +++ b/src/Build.UnitTests/EscapingInProjects_Tests.cs @@ -85,7 +85,7 @@ public void Dispose() public void SemicolonInPropertyPassedIntoStringParam() { MockLogger logger = Helpers.BuildProjectWithNewOMExpectSuccess(@" - + abc %3b def %3b ghi @@ -107,7 +107,7 @@ public void SemicolonInPropertyPassedIntoStringParam() public void SemicolonInPropertyPassedIntoStringParam_UsingTaskHost() { MockLogger logger = Helpers.BuildProjectWithNewOMExpectSuccess(@" - + abc %3b def %3b ghi @@ -131,7 +131,7 @@ public void SemicolonInPropertyPassedIntoITaskItemParam() { MockLogger logger = Helpers.BuildProjectWithNewOMExpectSuccess(@$" - + @@ -161,7 +161,7 @@ public void SemicolonInPropertyPassedIntoITaskItemParam_UsingTaskHost() { MockLogger logger = Helpers.BuildProjectWithNewOMExpectSuccess(String.Format(@" - + @@ -194,7 +194,7 @@ public void AddNewItemWithSemicolon() // BEFORE // ************************************ string projectOriginalContents = @" - + @@ -206,7 +206,7 @@ public void AddNewItemWithSemicolon() // AFTER // ************************************ string projectNewExpectedContents = @" - + @@ -232,7 +232,7 @@ public void AddNewItemWithPropertyContainingSemicolon() // BEFORE // ************************************ string projectOriginalContents = @" - + foo;bar @@ -247,7 +247,7 @@ public void AddNewItemWithPropertyContainingSemicolon() // AFTER // ************************************ string projectNewExpectedContents = @" - + foo;bar @@ -277,7 +277,7 @@ public void ModifyItemIncludeSemicolon() // BEFORE // ************************************ string projectOriginalContents = @" - + @@ -291,7 +291,7 @@ public void ModifyItemIncludeSemicolon() // AFTER // ************************************ string projectNewExpectedContents = @" - + @@ -330,7 +330,7 @@ public void ModifyItemIncludeEscapedSemicolon() // BEFORE // ************************************ string projectOriginalContents = @" - + @@ -344,7 +344,7 @@ public void ModifyItemIncludeEscapedSemicolon() // AFTER // ************************************ string projectNewExpectedContents = @" - + @@ -387,7 +387,7 @@ public void ModifyItemAddPropertyContainingSemicolon() // BEFORE // ************************************ string projectOriginalContents = @" - + foo;bar @@ -405,7 +405,7 @@ public void ModifyItemAddPropertyContainingSemicolon() // AFTER // ************************************ string projectNewExpectedContents = @" - + foo;bar @@ -448,7 +448,7 @@ public void AddNewItemThatMatchesWildcard1() // BEFORE // ************************************ string projectOriginalContents = @" - + @@ -460,7 +460,7 @@ public void AddNewItemThatMatchesWildcard1() // AFTER // ************************************ string projectNewExpectedContents = @" - + @@ -490,7 +490,7 @@ public void AddNewItemThatMatchesWildcard2() // BEFORE // ************************************ string projectOriginalContents = @" - + @@ -502,7 +502,7 @@ public void AddNewItemThatMatchesWildcard2() // AFTER // ************************************ string projectNewExpectedContents = @" - + @@ -539,7 +539,7 @@ public void InferEscapedOutputsFromTask() MockLogger logger = Helpers.BuildProjectWithNewOMExpectSuccess(String.Format(@" - + @@ -574,7 +574,7 @@ public void ItemTransformContainingSemicolon() { MockLogger logger = Helpers.BuildProjectWithNewOMExpectSuccess(@" - + @@ -600,7 +600,7 @@ public void ItemTransformContainingSemicolon_InTaskHost() { MockLogger logger = Helpers.BuildProjectWithNewOMExpectSuccess(@" - + @@ -661,7 +661,7 @@ public void GlobalPropertyWithEscapedCharacters() { MockLogger logger = new MockLogger(); Project project = ObjectModelHelpers.CreateInMemoryProject(@" - + @@ -690,7 +690,7 @@ public void EscapedWildcardsShouldNotBeExpanded() // Populate the project directory with three physical files on disk -- a.weirdo, b.weirdo, c.weirdo. EscapingInProjectsHelper.CreateThreeWeirdoFiles(); Project project = ObjectModelHelpers.CreateInMemoryProject(@" - + @@ -759,7 +759,7 @@ public void TargetNamesAlwaysUnescaped() try { ObjectModelHelpers.CreateInMemoryProject(@" - + "); @@ -783,7 +783,7 @@ public void TargetNamesAlwaysUnescaped() public void TargetNamesAlwaysUnescaped_Override() { Project project = ObjectModelHelpers.CreateInMemoryProject(@" - + @@ -806,7 +806,7 @@ public void TargetNamesAlwaysUnescaped_Override() public void SpecialCharactersInMetadataValueConstruction() { string projectString = @" - + %3B @@ -849,7 +849,7 @@ public void SpecialCharactersInMetadataValueEvaluation() public void CanGetCorrectListOfItemsWithSemicolonsInThem() { string projectString = @" - + foo%3bbar @@ -881,7 +881,7 @@ public void CanGetCorrectListOfItemsWithSemicolonsInThem() public void CanGetCorrectListOfItemsWithSemicolonsInThem2() { string projectString = @" - + foo;bar @@ -952,7 +952,7 @@ public void SemicolonInConfiguration() // Foo.csproj // --------------------- ObjectModelHelpers.CreateFileInTempProjectDirectory("foo.csproj", $@" - + Debug @@ -1017,7 +1017,7 @@ public void SemicolonInConfiguration_UsingTaskHost() // Foo.csproj // --------------------- ObjectModelHelpers.CreateFileInTempProjectDirectory("foo.csproj", $@" - + Debug @@ -1082,7 +1082,7 @@ public void SemicolonInAssemblyName() // Foo.csproj // --------------------- ObjectModelHelpers.CreateFileInTempProjectDirectory("foo.csproj", $@" - + Debug @@ -1142,7 +1142,7 @@ public void SemicolonInAssemblyName_UsingTaskHost() // Foo.csproj // --------------------- ObjectModelHelpers.CreateFileInTempProjectDirectory("foo.csproj", $@" - + Debug @@ -1202,7 +1202,7 @@ public void DollarSignInAssemblyName() // Foo.csproj // --------------------- ObjectModelHelpers.CreateFileInTempProjectDirectory("foo.csproj", $@" - + Debug @@ -1262,7 +1262,7 @@ public void DollarSignInAssemblyName_UsingTaskHost() // Foo.csproj // --------------------- ObjectModelHelpers.CreateFileInTempProjectDirectory("foo.csproj", $@" - + Debug @@ -1322,7 +1322,7 @@ public void SemicolonInSourceCodeFilename() // Foo.csproj // --------------------- ObjectModelHelpers.CreateFileInTempProjectDirectory("foo.csproj", $@" - + Debug @@ -1382,7 +1382,7 @@ public void SemicolonInSourceCodeFilename_UsingTaskHost() // Foo.csproj // --------------------- ObjectModelHelpers.CreateFileInTempProjectDirectory("foo.csproj", $@" - + Debug @@ -1454,7 +1454,7 @@ public void SolutionWithLotsaCrazyCharacters() @"SLN;!@(foo)'^1\Console;!@(foo)'^(Application1\Cons.ole;!@(foo)'^(Application1.csproj", @" - + Debug AnyCPU @@ -1531,7 +1531,7 @@ static void Main(string[] args) @"SLN;!@(foo)'^1\Class;!@(foo)'^(Library1\Class;!@(foo)'^(Library1.csproj", @" - + Debug AnyCPU @@ -1625,7 +1625,7 @@ public void SolutionWithLotsaCrazyCharacters_UsingTaskHost() @"SLN;!@(foo)'^1\Console;!@(foo)'^(Application1\Cons.ole;!@(foo)'^(Application1.csproj", @" - + Debug AnyCPU @@ -1702,7 +1702,7 @@ static void Main(string[] args) @"SLN;!@(foo)'^1\Class;!@(foo)'^(Library1\Class;!@(foo)'^(Library1.csproj", @" - + Debug AnyCPU diff --git a/src/Build.UnitTests/Evaluation/Expander_Tests.cs b/src/Build.UnitTests/Evaluation/Expander_Tests.cs index 06c13eae9c6..02d0df21845 100644 --- a/src/Build.UnitTests/Evaluation/Expander_Tests.cs +++ b/src/Build.UnitTests/Evaluation/Expander_Tests.cs @@ -368,7 +368,7 @@ public void ExpandItemVectorFunctionsChained3() public void ExpandItemVectorFunctionsChainedProject1() { MockLogger logger = Helpers.BuildProjectWithNewOMExpectSuccess(@" - + @@ -393,7 +393,7 @@ public void ExpandItemVectorFunctionsChainedProject1() - + '%(SomeMeta)'->'%(Directory)'->Distinct())`/> '%(SomeMeta)'->'%(Directory)'->Distinct(), '%(A)')`/> '%(SomeMeta)'->'%(Directory)'->Distinct(), '%(A)%(B)')`/> @@ -416,8 +416,8 @@ public void ExpandItemVectorFunctionsChainedProject1() public void ExpandItemVectorFunctionsCount1() { string content = @" - - + + @@ -438,8 +438,8 @@ public void ExpandItemVectorFunctionsCount1() public void ExpandItemVectorFunctionsCount2() { string content = @" - - + + @@ -461,8 +461,8 @@ public void ExpandItemVectorFunctionsCount2() public void ExpandItemVectorFunctionsCountOperatingOnEmptyResult1() { string content = @" - - + + @@ -483,8 +483,8 @@ public void ExpandItemVectorFunctionsCountOperatingOnEmptyResult1() public void ExpandItemVectorFunctionsCountOperatingOnEmptyResult2() { string content = @" - - + + @@ -506,8 +506,8 @@ public void ExpandItemVectorFunctionsCountOperatingOnEmptyResult2() public void ExpandItemVectorFunctionsBuiltIn1() { string content = @" - - + + @@ -528,8 +528,8 @@ public void ExpandItemVectorFunctionsBuiltIn1() public void ExpandItemVectorFunctionsBuiltIn2() { string content = @" - - + + @@ -550,8 +550,8 @@ public void ExpandItemVectorFunctionsBuiltIn2() public void ExpandItemVectorFunctionsBuiltIn3() { string content = @" - - + + @@ -572,8 +572,8 @@ public void ExpandItemVectorFunctionsBuiltIn3() public void ExpandItemVectorFunctionsBuiltIn4() { string content = @" - - + + @@ -595,8 +595,8 @@ public void ExpandItemVectorFunctionsBuiltIn4() public void ExpandItemVectorFunctionsBuiltIn_PathTooLongError() { string content = @" - - + + @@ -621,8 +621,8 @@ public void ExpandItemVectorFunctionsBuiltIn_InvalidCharsError() } string content = @" - - + + @@ -816,7 +816,7 @@ private Expander CreateExpander() public void ZeroItemsInProjectExpandsToEmpty() { MockLogger logger = Helpers.BuildProjectWithNewOMExpectSuccess(@" - + @@ -828,7 +828,7 @@ public void ZeroItemsInProjectExpandsToEmpty() logger.AssertLogDoesntContain("This target should NOT run."); logger = Helpers.BuildProjectWithNewOMExpectSuccess(@" - + @@ -848,7 +848,7 @@ public void ZeroItemsInProjectExpandsToEmpty() public void ItemIncludeContainsMultipleItemReferences() { MockLogger logger = Helpers.BuildProjectWithNewOMExpectSuccess(@" - + Library @@ -880,7 +880,7 @@ public void ItemIncludeContainsMultipleItemReferences() public void InvalidPathAndMetadataItemFunctionPathTooLong() { MockLogger logger = Helpers.BuildProjectWithNewOMExpectFailure(@" - + @@ -902,7 +902,7 @@ public void InvalidPathAndMetadataItemFunctionPathTooLong() public void InvalidPathAndMetadataItemFunctionInvalidWindowsPathChars() { MockLogger logger = Helpers.BuildProjectWithNewOMExpectFailure(@" - + @@ -921,7 +921,7 @@ public void InvalidPathAndMetadataItemFunctionInvalidWindowsPathChars() public void InvalidMetadataName() { MockLogger logger = Helpers.BuildProjectWithNewOMExpectFailure(@" - + @@ -942,7 +942,7 @@ public void InvalidMetadataName() public void InvalidPathAndMetadataItemFunctionPathTooLong2() { MockLogger logger = Helpers.BuildProjectWithNewOMExpectFailure(@" - + @@ -964,7 +964,7 @@ public void InvalidPathAndMetadataItemFunctionPathTooLong2() public void InvalidPathAndMetadataItemFunctionInvalidWindowsPathChars2() { MockLogger logger = Helpers.BuildProjectWithNewOMExpectFailure(@" - + @@ -983,7 +983,7 @@ public void InvalidPathAndMetadataItemFunctionInvalidWindowsPathChars2() public void InvalidMetadataName2() { MockLogger logger = Helpers.BuildProjectWithNewOMExpectFailure(@" - + @@ -1004,7 +1004,7 @@ public void InvalidMetadataName2() public void InvalidPathAndMetadataItemFunctionPathTooLong3() { MockLogger logger = Helpers.BuildProjectWithNewOMExpectFailure(@" - + @@ -1026,7 +1026,7 @@ public void InvalidPathAndMetadataItemFunctionPathTooLong3() public void InvalidPathAndMetadataItemInvalidWindowsPathChars3() { MockLogger logger = Helpers.BuildProjectWithNewOMExpectFailure(@" - + @@ -1044,7 +1044,7 @@ public void InvalidPathAndMetadataItemInvalidWindowsPathChars3() public void InvalidPathInDirectMetadata() { var logger = Helpers.BuildProjectContentUsingBuildManagerExpectResult( - @" + @" %(FullPath) @@ -1062,7 +1062,7 @@ public void InvalidPathInDirectMetadata() public void PathTooLongInDirectMetadata() { var logger = Helpers.BuildProjectContentUsingBuildManagerExpectResult( - @" + @" %(FullPath) @@ -1081,7 +1081,7 @@ public void PathTooLongInDirectMetadata() public void InvalidMetadataName3() { MockLogger logger = Helpers.BuildProjectWithNewOMExpectFailure(@" - + @@ -1100,7 +1100,7 @@ public void InvalidMetadataName3() public void HasMetadata() { MockLogger logger = Helpers.BuildProjectWithNewOMExpectSuccess(@" - + <_Item Include=""One""> @@ -1149,7 +1149,7 @@ public void DirectItemMetadataReferenceShouldBeCaseInsensitive() - + @@ -1178,7 +1178,7 @@ public void ItemDefinitionGroupMetadataReferenceShouldBeCaseInsensitive() - + @@ -1202,7 +1202,7 @@ public void WellKnownMetadataReferenceShouldBeCaseInsensitive() - + @@ -1224,7 +1224,7 @@ public void StaticMethodErrorMessageHaveMethodName() try { Helpers.BuildProjectWithNewOMExpectFailure(@" - + $([System.IO.Path]::Combine(null,'')) @@ -1251,7 +1251,7 @@ public void StaticMethodErrorMessageHaveMethodName1() try { Helpers.BuildProjectWithNewOMExpectFailure(@" - + $(System.IO.Path::Combine('a','b')) @@ -1515,7 +1515,7 @@ public void ExpandAllIntoStringTruncated() } var lookup = new Lookup(projectItemGroups, pg); lookup.EnterScope("x"); - lookup.PopulateWithItems("ManySpacesItem", new [] + lookup.PopulateWithItems("ManySpacesItem", new[] { new ProjectItemInstance (project, "ManySpacesItem", "Foo", project.FullPath), new ProjectItemInstance (project, "ManySpacesItem", manySpaces, project.FullPath), @@ -1850,7 +1850,7 @@ public void RegistryPropertyMultiString() public void TestItemSpecModiferEscaping() { string content = @" - + @@ -1884,7 +1884,7 @@ public void TestGetPathToReferenceAssembliesAsFunction() } string content = $@" - + .NETFramework @@ -2638,7 +2638,7 @@ public void PropertyFunctionStaticMethodQuoted1Spaces() Expander expander = new Expander(pg, FileSystems.Default); string result = expander.ExpandIntoStringLeaveEscaped(@"$([System.IO.Path]::Combine(`" + - Path.Combine(s_rootPathPrefix, "foo goo") + "`, `$(File)`))", + Path.Combine(s_rootPathPrefix, "foo goo") + "`, `$(File)`))", ExpanderOptions.ExpandProperties, MockElementLocation.Instance); Assert.Equal(Path.Combine(s_rootPathPrefix, "foo goo", "foo goo", "file.txt"), result); @@ -2854,7 +2854,7 @@ public void PropertyFunctionRuntimeInformation(string propertyFunction, string e public void StringIndexOfTests(string propertyName, string properyValue, string propertyFunction, string expectedExpansion) { var pg = new PropertyDictionary - {[propertyName] = ProjectPropertyInstance.Create(propertyName, properyValue)}; + { [propertyName] = ProjectPropertyInstance.Create(propertyName, properyValue) }; var expander = new Expander(pg, FileSystems.Default); @@ -2916,9 +2916,9 @@ public void PropertyFunctionVersionComparisons(string a, string b, int expectedS var pg = new PropertyDictionary(); var expander = new Expander(pg, FileSystems.Default); - AssertSuccess(expander, expectedSign > 0, $"$([MSBuild]::VersionGreaterThan('{a}', '{b}'))"); + AssertSuccess(expander, expectedSign > 0, $"$([MSBuild]::VersionGreaterThan('{a}', '{b}'))"); AssertSuccess(expander, expectedSign >= 0, $"$([MSBuild]::VersionGreaterThanOrEquals('{a}', '{b}'))"); - AssertSuccess(expander, expectedSign < 0, $"$([MSBuild]::VersionLessThan('{a}', '{b}'))"); + AssertSuccess(expander, expectedSign < 0, $"$([MSBuild]::VersionLessThan('{a}', '{b}'))"); AssertSuccess(expander, expectedSign <= 0, $"$([MSBuild]::VersionLessThanOrEquals('{a}', '{b}'))"); AssertSuccess(expander, expectedSign == 0, $"$([MSBuild]::VersionEquals('{a}', '{b}'))"); AssertSuccess(expander, expectedSign != 0, $"$([MSBuild]::VersionNotEquals('{a}', '{b}'))"); @@ -3740,25 +3740,25 @@ public void Medley() "$(listofthings.Split(';')[-1])", "$([]::())", @" - + $( - + $( - + [System.IO]::Path.GetDirectory('c:\foo\bar\baz.txt') - + ).Substring( - + '$([System.IO]::Path.GetPathRoot( - + '$([System.IO]::Path.GetDirectory('c:\foo\bar\baz.txt'))' - + ).Length)' - - - + + + ) - + ", "$([Microsoft.VisualBasic.FileIO.FileSystem]::CurrentDirectory)", // not allowed "$(e.Length..ToString())", @@ -3876,7 +3876,7 @@ public void Medley() { // If no registry or not running on windows, this gets expanded to the empty string // example: xplat build running on OSX - validTests.Add(new string[]{"$(Registry:X)", ""}); + validTests.Add(new string[] { "$(Registry:X)", "" }); } string result; diff --git a/src/Build.UnitTests/Evaluation/ImportFromMSBuildExtensionsPath_Tests.cs b/src/Build.UnitTests/Evaluation/ImportFromMSBuildExtensionsPath_Tests.cs index 1993567e97c..df80473fc4e 100644 --- a/src/Build.UnitTests/Evaluation/ImportFromMSBuildExtensionsPath_Tests.cs +++ b/src/Build.UnitTests/Evaluation/ImportFromMSBuildExtensionsPath_Tests.cs @@ -77,7 +77,7 @@ public void ImportFromExtensionsPathNotFound() public void ConditionalImportFromExtensionsPathNotFound() { string extnTargetsFileContentWithCondition = @" - + FooBar @@ -94,7 +94,8 @@ public void ConditionalImportFromExtensionsPathNotFound() CreateAndBuildProjectForImportFromExtensionsPath(mainProjectPath, "MSBuildExtensionsPath", new string[] { extnDir1, Path.Combine("tmp", "nonexistent") }, null, - (p, l) => { + (p, l) => + { Assert.True(p.Build()); l.AssertLogContains("Running FromExtn"); @@ -106,7 +107,7 @@ public void ConditionalImportFromExtensionsPathNotFound() public void ImportFromExtensionsPathCircularImportError() { string extnTargetsFileContent1 = @" - + @@ -115,7 +116,7 @@ public void ImportFromExtensionsPathCircularImportError() "; string extnTargetsFileContent2 = @" - + @@ -138,7 +139,7 @@ public void ImportFromExtensionsPathCircularImportError() public void ExtensionPathFallbackIsCaseInsensitive() { string mainTargetsFileContent = @" - + @@ -147,7 +148,7 @@ public void ExtensionPathFallbackIsCaseInsensitive() "; string extnTargetsFileContent = @" - + @@ -175,7 +176,7 @@ public void ExtensionPathFallbackIsCaseInsensitive() public void ImportFromExtensionsPathWithWildCard() { string mainTargetsFileContent = @" - + @@ -184,7 +185,7 @@ public void ImportFromExtensionsPathWithWildCard() "; string extnTargetsFileContent = @" - + @@ -218,7 +219,7 @@ public void ImportFromExtensionsPathWithWildCard() public void ImportFromExtensionsPathWithWildCardAndSelfImport() { string mainTargetsFileContent = @" - + @@ -227,14 +228,14 @@ public void ImportFromExtensionsPathWithWildCardAndSelfImport() "; string extnTargetsFileContent = @" - + "; string extnTargetsFileContent2 = @" - + @@ -271,7 +272,7 @@ public void ImportFromExtensionsPathWithWildCardAndSelfImport() public void ImportFromExtensionsPathWithWildCardNothingFound() { string extnTargetsFileContent = @" - + @@ -289,7 +290,7 @@ public void ImportFromExtensionsPathWithWildCardNothingFound() [Fact] public void ImportFromExtensionsPathInvalidFile() { - string extnTargetsFileContent = @""; + string extnTargetsFileContent = @""; string extnDir1 = null; string mainProjectPath = null; @@ -325,7 +326,7 @@ public void ImportFromExtensionsPathInvalidFile() public void ImportFromExtensionsPathSearchOrder() { string extnTargetsFileContent1 = @" - + FromFirstFile @@ -337,7 +338,7 @@ public void ImportFromExtensionsPathSearchOrder() "; string extnTargetsFileContent2 = @" - + FromSecondFile @@ -357,7 +358,8 @@ public void ImportFromExtensionsPathSearchOrder() CreateAndBuildProjectForImportFromExtensionsPath(mainProjectPath, "MSBuildExtensionsPath", new string[] { extnDir2, Path.Combine("tmp", "nonexistent"), extnDir1 }, null, - (p, l) => { + (p, l) => + { Assert.True(p.Build()); l.AssertLogContains("Running FromExtn"); @@ -369,7 +371,7 @@ public void ImportFromExtensionsPathSearchOrder() public void ImportFromExtensionsPathSearchOrder2() { string extnTargetsFileContent1 = @" - + FromFirstFile @@ -381,7 +383,7 @@ public void ImportFromExtensionsPathSearchOrder2() "; string extnTargetsFileContent2 = @" - + FromSecondFile @@ -448,7 +450,7 @@ public void ImportOrderFromExtensionsPath64() public void ImportFromExtensionsPathAnd32And64() { string extnTargetsFileContentTemplate = @" - + @@ -531,7 +533,7 @@ public void ImportFromExtensionsPathAnd32And64() public void ExpandExtensionsPathFallback() { string extnTargetsFileContentTemplate = @" - + @@ -592,7 +594,7 @@ public void ExpandExtensionsPathFallback() public void ExpandExtensionsPathFallbackInErrorMessage() { string extnTargetsFileContentTemplate = @" - + @@ -654,7 +656,7 @@ public void ExpandExtensionsPathFallbackInErrorMessage() public void FallbackImportWithIndirectReference() { string mainTargetsFileContent = @" - + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v99 @@ -663,7 +665,7 @@ public void FallbackImportWithIndirectReference() "; string extnTargetsFileContentTemplate = @" - + @@ -723,13 +725,13 @@ public void FallbackImportWithIndirectReference() public void FallbackImportWithUndefinedProperty() { string mainTargetsFileContent = @" - + "; string extnTargetsFileContentTemplate = @" - + @@ -788,7 +790,7 @@ public void FallbackImportWithFileNotFoundWhenPropertyNotDefined() { // Import something from $(UndefinedProperty) string mainTargetsFileContent = @" - + "; @@ -967,7 +969,7 @@ string GetNewExtensionsPathAndCreateFile(string extnDirName, string relativeFile string GetMainTargetFileContent(string extensionsPathPropertyName = "MSBuildExtensionsPath") { string mainTargetsFileContent = @" - + @@ -981,7 +983,7 @@ string GetMainTargetFileContent(string extensionsPathPropertyName = "MSBuildExte string GetExtensionTargetsFileContent1(string extensionsPathPropertyName = "MSBuildExtensionsPath") { string extnTargetsFileContent1 = @" - + FooBar @@ -999,7 +1001,7 @@ string GetExtensionTargetsFileContent1(string extensionsPathPropertyName = "MSBu string GetExtensionTargetsFileContent2(string extensionsPathPropertyName = "MSBuildExtensionsPath") { string extnTargetsFileContent2 = @" - + Abc diff --git a/src/Build.UnitTests/FixPathOnUnix_Tests.cs b/src/Build.UnitTests/FixPathOnUnix_Tests.cs index d9f16e556a1..01b2865b81e 100644 --- a/src/Build.UnitTests/FixPathOnUnix_Tests.cs +++ b/src/Build.UnitTests/FixPathOnUnix_Tests.cs @@ -9,20 +9,20 @@ namespace Microsoft.Build.UnitTests { [PlatformSpecific(TestPlatforms.AnyUnix)] - public class FixPathOnUnixTests + public class FixPathOnUnixTests { [Fact] public void TestPathFixupInMetadata() { string buildProjectContents = @" - + "; string mainProjectContents = @" - + @@ -61,10 +61,10 @@ public override bool Execute() { foreach (var item in Items) { - Log.LogMessage ($"Item: {item.ItemSpec}"); + Log.LogMessage($"Item: {item.ItemSpec}"); foreach (string name in item.MetadataNames) { - Log.LogMessage ($"ItemMetadata: {name} = {item.GetMetadata(name)}"); + Log.LogMessage($"ItemMetadata: {name} = {item.GetMetadata(name)}"); } } } diff --git a/src/Build.UnitTests/Instance/ProjectInstance_Internal_Tests.cs b/src/Build.UnitTests/Instance/ProjectInstance_Internal_Tests.cs index b5d79282eae..49c9d3a4db5 100644 --- a/src/Build.UnitTests/Instance/ProjectInstance_Internal_Tests.cs +++ b/src/Build.UnitTests/Instance/ProjectInstance_Internal_Tests.cs @@ -44,7 +44,7 @@ public void GetTaskRegistrations() try { string projectFileContent = @" - + @@ -54,7 +54,7 @@ public void GetTaskRegistrations() "; string importContent = @" - + @@ -91,19 +91,19 @@ public void InitialTargetsDefaultTargets() try { string projectFileContent = @" - + "; string import1Content = @" - + "; - string import2Content = @""; + string import2Content = @""; - string import3Content = @""; + string import3Content = @""; string import2Path = ObjectModelHelpers.CreateFileInTempProjectDirectory("import2.targets", import2Content); string import3Path = ObjectModelHelpers.CreateFileInTempProjectDirectory("import3.targets", import3Content); @@ -135,7 +135,7 @@ public void InitialTargetsDefaultTargetsEscaped() try { string projectFileContent = @" - + "; ProjectInstance project = new Project(ProjectRootElement.Create(XmlReader.Create(new StringReader(projectFileContent)))).CreateProjectInstance(); @@ -156,7 +156,7 @@ public void InitialTargetsDefaultTargetsEscaped() public void GetPropertyGroupUnderTarget() { string content = @" - + v1 @@ -188,12 +188,12 @@ public void GetPropertyGroupUnderTarget() public void GetItemGroupUnderTarget() { string content = @" - + - m1 - n1 + m1 + n1 @@ -337,8 +337,8 @@ public void GetSubToolsetVersion() } /// - /// Test ProjectInstance's surfacing of the sub-toolset version when it is overridden by a value in the - /// environment + /// Test ProjectInstance's surfacing of the sub-toolset version when it is overridden by a value in the + /// environment /// [Fact] [Trait("Category", "mono-osx-failing")] @@ -390,8 +390,8 @@ public void GetSubToolsetVersion_FromProjectGlobalProperties() } /// - /// Verify that if a sub-toolset version is passed to the constructor, it all other heuristic methods for - /// getting the sub-toolset version. + /// Verify that if a sub-toolset version is passed to the constructor, it all other heuristic methods for + /// getting the sub-toolset version. /// [Fact] public void GetSubToolsetVersion_FromConstructor() @@ -402,7 +402,7 @@ public void GetSubToolsetVersion_FromConstructor() { Environment.SetEnvironmentVariable("VisualStudioVersion", "ABC"); - string projectContent = @" + string projectContent = @" @@ -532,7 +532,7 @@ public void CloneToolsVersion() Assert.Equal(first.Toolset, second.Toolset); } - + /// /// Cloning project copies toolsversion /// @@ -559,7 +559,7 @@ public void Build() Directory.SetCurrentDirectory(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory); string projectFileContent = @" - + @@ -683,7 +683,7 @@ public void ProjectInstanceCanSerializeEntireStateViaTranslator(string projectCo original.TranslateEntireState = true; - ((ITranslatable) original).Translate(TranslationHelpers.GetWriteTranslator()); + ((ITranslatable)original).Translate(TranslationHelpers.GetWriteTranslator()); var copy = ProjectInstance.FactoryForDeserialization(TranslationHelpers.GetReadTranslator()); Assert.Equal(original, copy, new ProjectInstanceComparer()); @@ -892,7 +892,7 @@ private static ProjectInstance GetProjectInstance(string content, HostServices h if (globalProperties == null) { - // choose some interesting defaults if we weren't explicitly asked to use a set. + // choose some interesting defaults if we weren't explicitly asked to use a set. globalProperties = new Dictionary(StringComparer.OrdinalIgnoreCase); globalProperties.Add("g1", "v1"); globalProperties.Add("g2", "v2"); @@ -928,7 +928,7 @@ private static ProjectInstance GetSampleProjectInstance(HostServices hostService { string toolsVersionSubstring = toolsVersion != null ? "ToolsVersion=\"" + toolsVersion + "\" " : String.Empty; string content = @" - + v1 v2 diff --git a/src/Build.UnitTests/ProjectEvaluationFinishedEventArgs_Tests.cs b/src/Build.UnitTests/ProjectEvaluationFinishedEventArgs_Tests.cs index a61a639da06..7a3b0875d84 100644 --- a/src/Build.UnitTests/ProjectEvaluationFinishedEventArgs_Tests.cs +++ b/src/Build.UnitTests/ProjectEvaluationFinishedEventArgs_Tests.cs @@ -18,7 +18,7 @@ namespace Microsoft.Build.UnitTests { // Although this tests the ProfilerResult API from Microsoft.Build.Framework, it uses the // construction APIs in Microsoft.Build in the test, so this test is in the Microsoft.Build tests - public class ProjectEvaluationFinishedEventArgs_Tests + public class ProjectEvaluationFinishedEventArgs_Tests { /// /// Roundtrip serialization tests for @@ -52,7 +52,7 @@ public static IEnumerable GetProfilerResults() var element = new ProjectRootElement( XmlReader.Create(new MemoryStream(Encoding.UTF8.GetBytes( - ""))), + ""))), new ProjectRootElementCache(false), false, false); yield return new object[] { new ProfilerResult(new Dictionary diff --git a/src/MSBuild.UnitTests/XMake_Tests.cs b/src/MSBuild.UnitTests/XMake_Tests.cs index f7d6b2d7edd..7549c5fbbe4 100644 --- a/src/MSBuild.UnitTests/XMake_Tests.cs +++ b/src/MSBuild.UnitTests/XMake_Tests.cs @@ -451,7 +451,7 @@ public void ExtractSwitchParametersTest() MSBuildApp.ExtractSwitchParameters(commandLineArg, unquotedCommandLineArg, doubleQuotesRemovedFromArg, "p", unquotedCommandLineArg.IndexOf(':'), 1).ShouldBe(":\"foo foo\"=\"bar bar\";\"baz=onga\""); doubleQuotesRemovedFromArg.ShouldBe(6); } - + [Fact] public void ExtractSwitchParametersTestDoubleDash() { @@ -489,7 +489,7 @@ public void ExtractSwitchParametersTestDoubleDash() unquotedCommandLineArg = QuotingUtilities.Unquote(commandLineArg, out doubleQuotesRemovedFromArg); MSBuildApp.ExtractSwitchParameters(commandLineArg, unquotedCommandLineArg, doubleQuotesRemovedFromArg, "p", unquotedCommandLineArg.IndexOf(':'), 2).ShouldBe(":\"foo foo\"=\"bar bar\";\"baz=onga\""); doubleQuotesRemovedFromArg.ShouldBe(6); - } + } [Fact] public void GetLengthOfSwitchIndicatorTest() @@ -695,7 +695,7 @@ public void ConfigurationInvalid() var pathToProjectFile = Path.Combine(startDirectory, "foo.proj"); string projectString = "" + - "" + + "" + "" + ""; File.WriteAllText(pathToProjectFile, projectString); @@ -806,7 +806,7 @@ public void MSBuildEngineLogger() { string projectString = "" + - "" + + "" + "" + ""; string tempdir = Path.GetTempPath(); @@ -1278,10 +1278,10 @@ public void NormalPriorityBuild() private void RunPriorityBuildTest(ProcessPriorityClass expectedPrority, params string[] arguments) { - string[] aggregateArguments = arguments.Union(new[] { " /nr:false /v:diag "}).ToArray(); + string[] aggregateArguments = arguments.Union(new[] { " /nr:false /v:diag " }).ToArray(); string contents = ObjectModelHelpers.CleanupFileContents(@" - + @@ -1706,9 +1706,9 @@ public void TestProcessProjectSwitchDirectoryMultipleProjects() RobustDelete(projectDirectory); } } -#endregion + #endregion -#region ProcessFileLoggerSwitches + #region ProcessFileLoggerSwitches /// /// Test the case where no file logger switches are given, should be no file loggers attached /// @@ -1951,9 +1951,9 @@ public void TestProcessFileLoggerSwitch5() distributedLoggerRecords.Count.ShouldBe(0); // "Expected no distributed loggers to be attached" loggers.Count.ShouldBe(0); // "Expected no central loggers to be attached" } -#endregion + #endregion -#region ProcessConsoleLoggerSwitches + #region ProcessConsoleLoggerSwitches [Fact] public void ProcessConsoleLoggerSwitches() { @@ -2001,14 +2001,14 @@ public void ProcessConsoleLoggerSwitches() distributedLogger.CentralLogger.Parameters.ShouldBe("SHOWPROJECTFILE=TRUE;Parameter1;Parameter;;;parameter;Parameter", StringCompareShould.IgnoreCase); // "Expected parameter in logger to match parameters passed in" distributedLogger.ForwardingLoggerDescription.LoggerSwitchParameters.ShouldBe("SHOWPROJECTFILE=TRUE;Parameter1;Parameter;;;Parameter;Parameter", StringCompareShould.IgnoreCase); // "Expected parameter in logger to match parameter passed in" } -#endregion + #endregion [Fact] public void RestoreFirstReevaluatesImportGraph() { string guid = Guid.NewGuid().ToString("N"); - string projectContents = ObjectModelHelpers.CleanupFileContents($@" + string projectContents = ObjectModelHelpers.CleanupFileContents($@" {Guid.NewGuid():N}.props @@ -2023,7 +2023,7 @@ public void RestoreFirstReevaluatesImportGraph() - + @@ -2043,7 +2043,7 @@ public void RestoreFirstClearsProjectRootElementCache() string guid2 = Guid.NewGuid().ToString("N"); string restoreFirstProps = $"{Guid.NewGuid():N}.props"; - string projectContents = ObjectModelHelpers.CleanupFileContents($@" + string projectContents = ObjectModelHelpers.CleanupFileContents($@" {restoreFirstProps} @@ -2059,7 +2059,7 @@ public void RestoreFirstClearsProjectRootElementCache() - + @@ -2069,7 +2069,7 @@ public void RestoreFirstClearsProjectRootElementCache() IDictionary preExistingProps = new Dictionary { - { restoreFirstProps, $@" + { restoreFirstProps, $@" {guid1} @@ -2090,7 +2090,7 @@ public void RestoreIgnoresMissingImports() string guid2 = Guid.NewGuid().ToString("N"); string restoreFirstProps = $"{Guid.NewGuid():N}.props"; - string projectContents = ObjectModelHelpers.CleanupFileContents($@" + string projectContents = ObjectModelHelpers.CleanupFileContents($@" {restoreFirstProps} @@ -2106,7 +2106,7 @@ public void RestoreIgnoresMissingImports() - + @@ -2116,7 +2116,7 @@ public void RestoreIgnoresMissingImports() IDictionary preExistingProps = new Dictionary { - { restoreFirstProps, $@" + { restoreFirstProps, $@" {guid1} @@ -2180,7 +2180,7 @@ public void RestoreRunsInitialTargets() [Fact] public void MultipleTargetsDoesNotCrash() { - string projectContents = ObjectModelHelpers.CleanupFileContents($@" + string projectContents = ObjectModelHelpers.CleanupFileContents($@" @@ -2225,7 +2225,7 @@ public void MissingOptionalLoggersAreIgnored(string logger) [InlineData("/interactive /p:NuGetInteractive=true")] public void InteractiveSetsBuiltInProperty(string arguments) { - string projectContents = ObjectModelHelpers.CleanupFileContents(@" + string projectContents = ObjectModelHelpers.CleanupFileContents(@" @@ -2245,7 +2245,7 @@ public void InteractiveSetsBuiltInProperty(string arguments) public void BinaryLogContainsImportedFiles() { var testProject = _env.CreateFile("Importer.proj", ObjectModelHelpers.CleanupFileContents(@" - + @@ -2254,7 +2254,7 @@ public void BinaryLogContainsImportedFiles() ")); _env.CreateFile("TestProject.proj", @" - + @@ -2317,7 +2317,7 @@ public void BuildSlnOutOfProc() string testMessage = "Hello from TestProject!"; _env.CreateFile("TestProject.proj", @$" - + @@ -2466,7 +2466,7 @@ private string CopyMSBuild() } } - private string ExecuteMSBuildExeExpectSuccess(string projectContents, IDictionary filesToCreate = null, IDictionary envsToCreate = null, params string[] arguments) + private string ExecuteMSBuildExeExpectSuccess(string projectContents, IDictionary filesToCreate = null, IDictionary envsToCreate = null, params string[] arguments) { (bool result, string output) = ExecuteMSBuildExe(projectContents, filesToCreate, envsToCreate, arguments); diff --git a/src/Shared/UnitTests/ObjectModelHelpers.cs b/src/Shared/UnitTests/ObjectModelHelpers.cs index 72bdbee3979..f97a38f3ba2 100644 --- a/src/Shared/UnitTests/ObjectModelHelpers.cs +++ b/src/Shared/UnitTests/ObjectModelHelpers.cs @@ -122,7 +122,7 @@ internal static void AssertItemEvaluationFromProject(string projectContents, str { return new Project(p, new Dictionary(), MSBuildConstants.CurrentToolsVersion, c) .Items - .Select(i => (TestItem) new ProjectItemTestItemAdapter(i)) + .Select(i => (TestItem)new ProjectItemTestItemAdapter(i)) .ToList(); }, projectContents, @@ -244,7 +244,7 @@ public static implicit operator ProjectItemInstanceTestItemAdapter(ProjectItemIn internal static void AssertItems(string[] expectedItems, ICollection items, Dictionary expectedDirectMetadata = null, bool normalizeSlashes = false) { - var converteditems = items.Select(i => (TestItem) new ProjectItemTestItemAdapter(i)).ToList(); + var converteditems = items.Select(i => (TestItem)new ProjectItemTestItemAdapter(i)).ToList(); AssertItems(expectedItems, converteditems, expectedDirectMetadata, normalizeSlashes); } @@ -271,7 +271,7 @@ internal static void AssertItems(string[] expectedItems, IList items, public static void AssertItems(string[] expectedItems, IList items, Dictionary[] expectedDirectMetadataPerItem, bool normalizeSlashes = false) { - var convertedItems = items.Select(i => (TestItem) new ProjectItemTestItemAdapter(i)).ToList(); + var convertedItems = items.Select(i => (TestItem)new ProjectItemTestItemAdapter(i)).ToList(); AssertItems(expectedItems, convertedItems, expectedDirectMetadataPerItem, normalizeSlashes); } @@ -716,7 +716,7 @@ internal static Project CreateInMemoryProject string toolsVersion /* may be null */ ) { - XmlReaderSettings readerSettings = new XmlReaderSettings {DtdProcessing = DtdProcessing.Ignore}; + XmlReaderSettings readerSettings = new XmlReaderSettings { DtdProcessing = DtdProcessing.Ignore }; Project project = new Project ( @@ -1102,7 +1102,7 @@ internal static string FormatProjectContentsWithItemGroupFragment(string fragmen { return $@" - + {fragment} @@ -1384,8 +1384,8 @@ public static BuildResult BuildProjectFileUsingBuildManager(string projectFile, if (logger != null) { parameters.Loggers = parameters.Loggers == null - ? new[] {logger} - : parameters.Loggers.Concat(new[] {logger}); + ? new[] { logger } + : parameters.Loggers.Concat(new[] { logger }); } var request = new BuildRequestData( @@ -1585,7 +1585,7 @@ internal static TransientTestFile CreateProjectFile( sb.Append(""); - + foreach (var defaultTarget in (defaultTargets ?? string.Empty).Split(MSBuildConstants.SemicolonChar, StringSplitOptions.RemoveEmptyEntries)) { sb.Append(""); @@ -1783,7 +1783,7 @@ internal static void VerifyAssertThrowsInvalidOperation(Action method) /// internal static void VerifyAssertLineByLine(string expected, string actual, bool ignoreFirstLineOfActual, ITestOutputHelper testOutput = null) { - Action LogLine = testOutput == null ? (Action) Console.WriteLine : testOutput.WriteLine; + Action LogLine = testOutput == null ? (Action)Console.WriteLine : testOutput.WriteLine; string[] actualLines = SplitIntoLines(actual); @@ -1934,7 +1934,7 @@ public BuildManagerSession( _env = env; Logger = new MockLogger(_env.Output); - var loggers = new[] {Logger}; + var loggers = new[] { Logger }; var actualBuildParameters = buildParameters ?? new BuildParameters(); diff --git a/src/Tasks.UnitTests/CodeTaskFactoryTests.cs b/src/Tasks.UnitTests/CodeTaskFactoryTests.cs index 95fda75c8df..bf6fc63eb77 100644 --- a/src/Tasks.UnitTests/CodeTaskFactoryTests.cs +++ b/src/Tasks.UnitTests/CodeTaskFactoryTests.cs @@ -26,9 +26,9 @@ public sealed class CodeTaskFactoryTests public void BuildTaskSimpleCodeFactory() { string projectFileContents = @" - + - + @@ -48,17 +48,17 @@ public void BuildTaskSimpleCodeFactory() /// /// Test the simple case where we have a string parameter and we want to log that. - /// Specifically testing that even when the ToolsVersion is post-4.0, and thus - /// Microsoft.Build.Tasks.v4.0.dll is expected to NOT be in MSBuildToolsPath, that + /// Specifically testing that even when the ToolsVersion is post-4.0, and thus + /// Microsoft.Build.Tasks.v4.0.dll is expected to NOT be in MSBuildToolsPath, that /// we will redirect under the covers to use the current tasks instead. /// [Fact] public void BuildTaskSimpleCodeFactory_RedirectFrom4() { string projectFileContents = @" - + - + @@ -79,17 +79,17 @@ public void BuildTaskSimpleCodeFactory_RedirectFrom4() /// /// Test the simple case where we have a string parameter and we want to log that. - /// Specifically testing that even when the ToolsVersion is post-12.0, and thus - /// Microsoft.Build.Tasks.v12.0.dll is expected to NOT be in MSBuildToolsPath, that + /// Specifically testing that even when the ToolsVersion is post-12.0, and thus + /// Microsoft.Build.Tasks.v12.0.dll is expected to NOT be in MSBuildToolsPath, that /// we will redirect under the covers to use the current tasks instead. /// [Fact] public void BuildTaskSimpleCodeFactory_RedirectFrom12() { string projectFileContents = @" - + - + @@ -111,17 +111,17 @@ public void BuildTaskSimpleCodeFactory_RedirectFrom12() /// /// Test the simple case where we have a string parameter and we want to log that. /// Specifically testing that even when the ToolsVersion is post-4.0, and we have redirection - /// logic in place for the AssemblyFile case to deal with Microsoft.Build.Tasks.v4.0.dll not - /// being in MSBuildToolsPath anymore, that this does NOT affect full fusion AssemblyNames -- - /// it's picked up from the GAC, where it is anyway, so there's no need to redirect. + /// logic in place for the AssemblyFile case to deal with Microsoft.Build.Tasks.v4.0.dll not + /// being in MSBuildToolsPath anymore, that this does NOT affect full fusion AssemblyNames -- + /// it's picked up from the GAC, where it is anyway, so there's no need to redirect. /// [Fact] public void BuildTaskSimpleCodeFactory_NoAssemblyNameRedirect() { string projectFileContents = @" - + - + @@ -147,9 +147,9 @@ public void BuildTaskSimpleCodeFactory_NoAssemblyNameRedirect() public void VerifyRequiredAttribute() { string projectFileContents = @" - + - + @@ -174,9 +174,9 @@ public void VerifyRequiredAttribute() public void RuntimeException() { string projectFileContents = @" - + - + @@ -203,9 +203,9 @@ public void RuntimeException() public void EmptyLanguage() { string projectFileContents = @" - + - + @@ -232,9 +232,9 @@ public void EmptyLanguage() public void EmptyType() { string projectFileContents = @" - + - + @@ -261,9 +261,9 @@ public void EmptyType() public void EmptySource() { string projectFileContents = @" - + - + @@ -290,9 +290,9 @@ public void EmptySource() public void EmptyReferenceInclude() { string projectFileContents = @" - + - + @@ -320,9 +320,9 @@ public void EmptyReferenceInclude() public void EmptyUsingNamespace() { string projectFileContents = @" - + - + @@ -349,9 +349,9 @@ public void EmptyUsingNamespace() public void ReferenceNotPath() { string projectFileContents = @" - + - + @@ -378,9 +378,9 @@ public void ReferenceNotPath() public void ReferenceInvalidChars() { string projectFileContents = @" - + - + @@ -408,9 +408,9 @@ public void ReferenceInvalidChars() public void UsingInvalidChars() { string projectFileContents = @" - + - + @@ -438,9 +438,9 @@ public void SourcesInvalidFile() string tempFileName = "Moose_" + Guid.NewGuid().ToString() + ".cs"; string projectFileContents = @" - + - + @@ -466,9 +466,9 @@ public void SourcesInvalidFile() public void MissingCodeElement() { string projectFileContents = @" - + - + @@ -490,9 +490,9 @@ public void MissingCodeElement() public void BuildTaskSimpleCodeFactoryTestExtraUsing() { string projectFileContents = @" - + - + @@ -520,7 +520,7 @@ public void BuildTaskSimpleCodeFactoryTestExtraUsing() public void BuildTaskDateCodeFactory() { string projectFileContents = @" - + @@ -551,7 +551,7 @@ public void BuildTaskDateCodeFactory() public void MethodImplmentationVB() { string projectFileContents = @" - + @@ -583,9 +583,9 @@ End Function public void BuildTaskSimpleCodeFactoryTestSystemVB() { string projectFileContents = @" - + - + @@ -612,9 +612,9 @@ Dim headerRequest As String public void BuildTaskSimpleCodeFactoryTestSystemCS() { string projectFileContents = @" - + - + @@ -634,7 +634,7 @@ public void BuildTaskSimpleCodeFactoryTestSystemCS() } /// - /// Make sure we can pass in extra references than the automatic ones. For example the c# compiler does not pass in + /// Make sure we can pass in extra references than the automatic ones. For example the c# compiler does not pass in /// system.dll. So lets test that case /// [Fact] @@ -656,9 +656,9 @@ public void BuildTaskSimpleCodeFactoryTestExtraReferenceCS() } string projectFileContents = @" - + - + @@ -693,7 +693,7 @@ public void MethodImplementationJScriptNet() } string projectFileContents = @" - + @@ -726,7 +726,7 @@ override function Execute() : System.Boolean public void MethodImplementation() { string projectFileContents = @" - + @@ -759,7 +759,7 @@ public override bool Execute() public void ClassImplementationTest() { string projectFileContents = @" - + @@ -825,7 +825,7 @@ public override bool Execute() public void ClassImplementationTestDoesNotInheritFromITask() { string projectFileContents = @" - + @@ -883,9 +883,9 @@ public bool Execute() public void MultipleCodeElements() { string projectFileContents = @" - + - + @@ -915,9 +915,9 @@ public void MultipleCodeElements() public void ReferenceNestedInCode() { string projectFileContents = @" - + - + @@ -949,9 +949,9 @@ public void ReferenceNestedInCode() public void UnknownElementInTask() { string projectFileContents = @" - + - + @@ -1025,7 +1025,7 @@ public override bool Execute() try { string projectFileContents = @" - + @@ -1061,9 +1061,9 @@ public override bool Execute() public void BuildTaskSimpleCodeFactoryTempDirectoryDoesntExist() { string projectFileContents = @" - + - + @@ -1111,9 +1111,9 @@ public void BuildTaskSimpleCodeFactoryTempDirectoryDoesntExist() public void RedundantMSBuildReferences() { string projectFileContents = @" - + - + @@ -1141,9 +1141,9 @@ public sealed class CodeTaskFactoryTests public void CodeTaskFactoryNotSupported() { string projectFileContents = @" - + - + diff --git a/src/Tasks.UnitTests/DirectoryBuildProjectImportTestBase.cs b/src/Tasks.UnitTests/DirectoryBuildProjectImportTestBase.cs index 87c624583fc..e8f0784d223 100644 --- a/src/Tasks.UnitTests/DirectoryBuildProjectImportTestBase.cs +++ b/src/Tasks.UnitTests/DirectoryBuildProjectImportTestBase.cs @@ -16,7 +16,7 @@ namespace Microsoft.Build.UnitTests abstract public class DirectoryBuildProjectImportTestBase : IDisposable { private const string BasicDirectoryBuildProjectContents = @" - + true @@ -75,7 +75,7 @@ public void DoesNotImportDirectoryBuildProjectIfNotExist() // --------------------- Project project = ObjectModelHelpers.LoadProjectFileInTempProjectDirectory(ObjectModelHelpers.CreateFileInTempProjectDirectory(_projectRelativePath, @" - + @@ -104,7 +104,7 @@ public void DoesNotImportDirectoryBuildProjectWhenDisabled() // --------------------- Project project = ObjectModelHelpers.LoadProjectFileInTempProjectDirectory(ObjectModelHelpers.CreateFileInTempProjectDirectory(_projectRelativePath, $@" - + <{ImportDirectoryBuildProjectPropertyName}>false @@ -135,7 +135,7 @@ public void ImportsDirectoryBuildProjectCustomFile() // --------------------- Project project = ObjectModelHelpers.LoadProjectFileInTempProjectDirectory(ObjectModelHelpers.CreateFileInTempProjectDirectory(_projectRelativePath, $@" - + <{DirectoryBuildProjectPathPropertyName}>{customFilePath} @@ -163,7 +163,7 @@ public void ImportsDirectoryBuildProjectIfExists() // --------------------- Project project = ObjectModelHelpers.LoadProjectFileInTempProjectDirectory(ObjectModelHelpers.CreateFileInTempProjectDirectory(_projectRelativePath, @" - + diff --git a/src/Tasks.UnitTests/NuGetPropsImportTests.cs b/src/Tasks.UnitTests/NuGetPropsImportTests.cs index 41af54c3103..9dd6200a65d 100644 --- a/src/Tasks.UnitTests/NuGetPropsImportTests.cs +++ b/src/Tasks.UnitTests/NuGetPropsImportTests.cs @@ -16,7 +16,7 @@ namespace Microsoft.Build.UnitTests public sealed class NuGetPropsImportTests : IDisposable { private const string NuGetPropsContent = @" - + true @@ -43,7 +43,7 @@ public void ImportNuGetPropsWhenExists() // src\Foo\Foo.csproj // --------------------- ObjectModelHelpers.CreateFileInTempProjectDirectory(projectRelativePath, $@" - + <{NuGetPropsPropertyName}>{nugetPropsRelativePath} @@ -69,7 +69,7 @@ public void ImportNuGetPropsWhenDoesNotExists() // src\Foo\Foo.csproj // --------------------- ObjectModelHelpers.CreateFileInTempProjectDirectory(projectRelativePath, $@" - + <{NuGetPropsPropertyName}>{nugetPropsRelativePath} diff --git a/src/Tasks.UnitTests/ProjectExtensionsImportTestBase.cs b/src/Tasks.UnitTests/ProjectExtensionsImportTestBase.cs index 56e2fbf37de..dae84ce4e97 100644 --- a/src/Tasks.UnitTests/ProjectExtensionsImportTestBase.cs +++ b/src/Tasks.UnitTests/ProjectExtensionsImportTestBase.cs @@ -21,7 +21,7 @@ protected ProjectExtensionsImportTestBase() } protected virtual string BasicProjectImportContents => $@" - + <{PropertyNameToSignalImportSucceeded}>true @@ -52,7 +52,7 @@ public void DoesNotImportProjectIfNotExist() // --------------------- Project project = ObjectModelHelpers.LoadProjectFileInTempProjectDirectory(ObjectModelHelpers.CreateFileInTempProjectDirectory(_projectRelativePath, @" - + @@ -83,7 +83,7 @@ public void DoesNotImportProjectWhenDisabled() // --------------------- Project project = ObjectModelHelpers.LoadProjectFileInTempProjectDirectory(ObjectModelHelpers.CreateFileInTempProjectDirectory(_projectRelativePath, $@" - + <{PropertyNameToEnableImport}>false @@ -115,7 +115,7 @@ public void ImportsProjectIfCustomPath() // --------------------- Project project = ObjectModelHelpers.LoadProjectFileInTempProjectDirectory(ObjectModelHelpers.CreateFileInTempProjectDirectory(_projectRelativePath, $@" - + {Path.GetDirectoryName(CustomImportProjectPath)} @@ -142,7 +142,7 @@ public void ImportsProjectIfExists() // --------------------- Project project = ObjectModelHelpers.LoadProjectFileInTempProjectDirectory(ObjectModelHelpers.CreateFileInTempProjectDirectory(_projectRelativePath, @" - + @@ -160,7 +160,7 @@ public void ImportsProjectIfExists() public void ErrorIfChangedInBodyOfProject() { Project project = ObjectModelHelpers.LoadProjectFileInTempProjectDirectory(ObjectModelHelpers.CreateFileInTempProjectDirectory(_projectRelativePath, @" - + @@ -173,20 +173,20 @@ public void ErrorIfChangedInBodyOfProject() MockLogger logger = new MockLogger(); - project.Build("_CheckForInvalidConfigurationAndPlatform", new[] {logger}).ShouldBeFalse(); + project.Build("_CheckForInvalidConfigurationAndPlatform", new[] { logger }).ShouldBeFalse(); logger.Errors.Select(i => i.Code).FirstOrDefault().ShouldBe("MSB3540"); } /// - /// Ensures that an error is logged if BaseIntermediateOutputPath is modified after it was set by Microsoft.Common.props and + /// Ensures that an error is logged if BaseIntermediateOutputPath is modified after it was set by Microsoft.Common.props and /// EnableBaseIntermediateOutputPathMismatchWarning is 'true'. /// [Fact] public void WarningIfBaseIntermediateOutputPathIsChangedInBodyOfProject() { Project project = ObjectModelHelpers.LoadProjectFileInTempProjectDirectory(ObjectModelHelpers.CreateFileInTempProjectDirectory(_projectRelativePath, @" - + diff --git a/src/Tasks.UnitTests/XamlDataDrivenToolTask_Tests.cs b/src/Tasks.UnitTests/XamlDataDrivenToolTask_Tests.cs index fd4942c91d1..80b0140226a 100644 --- a/src/Tasks.UnitTests/XamlDataDrivenToolTask_Tests.cs +++ b/src/Tasks.UnitTests/XamlDataDrivenToolTask_Tests.cs @@ -89,7 +89,7 @@ public void TestDynamicEnum() } /// - /// Tests the basic string array type + /// Tests the basic string array type /// [Fact] [Trait("Category", "mono-osx-failing")] @@ -104,7 +104,7 @@ public void TestBasicStringArray() } /// - /// Tests the basic string array type, with an array that contains multiple values. + /// Tests the basic string array type, with an array that contains multiple values. /// [Fact] [Trait("Category", "mono-osx-failing")] @@ -226,9 +226,9 @@ private void CheckCommandLine(string expected, string actual) } /// - /// XamlTaskFactory does not, in and of itself, support the idea of "always" switches or default values. At least - /// for Dev10, the workaround is to create a property as usual, and then specify the required values in the .props - /// file. Since these unit tests are just testing the task itself, this method serves as our ".props file". + /// XamlTaskFactory does not, in and of itself, support the idea of "always" switches or default values. At least + /// for Dev10, the workaround is to create a property as usual, and then specify the required values in the .props + /// file. Since these unit tests are just testing the task itself, this method serves as our ".props file". /// public object CreateFakeTask() { @@ -242,19 +242,19 @@ public object CreateFakeTask() } /// - /// Tests for XamlDataDrivenToolTask / XamlTaskFactory in the context of a project file. + /// Tests for XamlDataDrivenToolTask / XamlTaskFactory in the context of a project file. /// public class ProjectFileTests { /// - /// Tests that when a call to a XamlDataDrivenTask fails, the commandline is reported in the error message. + /// Tests that when a call to a XamlDataDrivenTask fails, the commandline is reported in the error message. /// [Fact] [Trait("Category", "mono-osx-failing")] public void CommandLineErrorsReportFullCommandlineAmpersandTemp() { string projectFile = @" - + - /// Tests that when a call to a XamlDataDrivenTask fails, the commandline is reported in the error message. + /// Tests that when a call to a XamlDataDrivenTask fails, the commandline is reported in the error message. /// [Fact] [Trait("Category", "mono-osx-failing")] public void CommandLineErrorsReportFullCommandline() { string projectFile = @" - + - /// Tests that when a call to a XamlDataDrivenTask fails, the commandline is reported in the error message. + /// Tests that when a call to a XamlDataDrivenTask fails, the commandline is reported in the error message. /// [Fact] [Trait("Category", "mono-osx-failing")] public void SquareBracketEscaping() { string projectFile = @" - + - + @@ -303,7 +303,7 @@ public void MissingNamespaceParameters() public void PeekWithoutUsingTask() { string projectContents = @" - + diff --git a/src/Tasks.UnitTests/XmlPoke_Tests.cs b/src/Tasks.UnitTests/XmlPoke_Tests.cs index b532acdc54f..05e3f05860c 100644 --- a/src/Tasks.UnitTests/XmlPoke_Tests.cs +++ b/src/Tasks.UnitTests/XmlPoke_Tests.cs @@ -20,7 +20,7 @@ sealed public class XmlPoke_Tests private const string XmlNamespaceUsedByTests = "http://nsurl"; private const string _xmlFileWithNs = @" - + @@ -29,7 +29,7 @@ sealed public class XmlPoke_Tests "; private const string _xmlFileNoNs = @" - + @@ -273,16 +273,16 @@ public void PokeElement() public void PokeWithoutUsingTask() { string projectContents = @" - + "; - // The task will error, but ContinueOnError means that it will just be a warning. + // The task will error, but ContinueOnError means that it will just be a warning. MockLogger logger = ObjectModelHelpers.BuildProjectExpectSuccess(projectContents); - // Verify that the task was indeed found. + // Verify that the task was indeed found. logger.AssertLogDoesntContain("MSB4036"); } diff --git a/src/Utilities.UnitTests/ToolLocationHelper_Tests.cs b/src/Utilities.UnitTests/ToolLocationHelper_Tests.cs index 965f5a9e2f8..7a1f034a25c 100644 --- a/src/Utilities.UnitTests/ToolLocationHelper_Tests.cs +++ b/src/Utilities.UnitTests/ToolLocationHelper_Tests.cs @@ -761,13 +761,13 @@ public void TestGetDotNetFrameworkSdkRootRegistryKey() // Test out of range .net version. foreach (var vsVersion in EnumVisualStudioVersions()) { - Should.Throw( () => ToolLocationHelper.GetDotNetFrameworkSdkRootRegistryKey((TargetDotNetFrameworkVersion)99, vsVersion) ); + Should.Throw(() => ToolLocationHelper.GetDotNetFrameworkSdkRootRegistryKey((TargetDotNetFrameworkVersion)99, vsVersion)); } // Test out of range visual studio version. foreach (var dotNetVersion in EnumDotNetFrameworkVersions()) { - Should.Throw( () => ToolLocationHelper.GetDotNetFrameworkSdkRootRegistryKey(dotNetVersion, (VisualStudioVersion)99) ); + Should.Throw(() => ToolLocationHelper.GetDotNetFrameworkSdkRootRegistryKey(dotNetVersion, (VisualStudioVersion)99)); } foreach (var vsVersion in EnumVisualStudioVersions()) @@ -779,7 +779,7 @@ public void TestGetDotNetFrameworkSdkRootRegistryKey() ToolLocationHelper.GetDotNetFrameworkSdkRootRegistryKey(TargetDotNetFrameworkVersion.Version20, vsVersion).ShouldBe(FrameworkLocationHelper.fullDotNetFrameworkRegistryKey); // v3.0 - Should.Throw( () => ToolLocationHelper.GetDotNetFrameworkSdkRootRegistryKey(TargetDotNetFrameworkVersion.Version30, vsVersion) ); + Should.Throw(() => ToolLocationHelper.GetDotNetFrameworkSdkRootRegistryKey(TargetDotNetFrameworkVersion.Version30, vsVersion)); // v3.5 ToolLocationHelper.GetDotNetFrameworkSdkRootRegistryKey(TargetDotNetFrameworkVersion.Version35, vsVersion).ShouldBe( @@ -810,39 +810,39 @@ public void TestGetDotNetFrameworkSdkRootRegistryKey() ToolLocationHelper.GetDotNetFrameworkSdkRootRegistryKey(TargetDotNetFrameworkVersion.Version45, VisualStudioVersion.Version140).ShouldBe(fullDotNetFrameworkSdkRegistryPathForV4ToolsOnManagedToolsSDK46); // v4.5.1 - Should.Throw( () => ToolLocationHelper.GetDotNetFrameworkSdkRootRegistryKey(TargetDotNetFrameworkVersion.Version451, VisualStudioVersion.Version100) ); - Should.Throw( () => ToolLocationHelper.GetDotNetFrameworkSdkRootRegistryKey(TargetDotNetFrameworkVersion.Version451, VisualStudioVersion.Version110) ); + Should.Throw(() => ToolLocationHelper.GetDotNetFrameworkSdkRootRegistryKey(TargetDotNetFrameworkVersion.Version451, VisualStudioVersion.Version100)); + Should.Throw(() => ToolLocationHelper.GetDotNetFrameworkSdkRootRegistryKey(TargetDotNetFrameworkVersion.Version451, VisualStudioVersion.Version110)); ToolLocationHelper.GetDotNetFrameworkSdkRootRegistryKey(TargetDotNetFrameworkVersion.Version451, VisualStudioVersion.Version120).ShouldBe(fullDotNetFrameworkSdkRegistryPathForV4ToolsOnManagedToolsSDK81A); ToolLocationHelper.GetDotNetFrameworkSdkRootRegistryKey(TargetDotNetFrameworkVersion.Version451, VisualStudioVersion.Version140).ShouldBe(fullDotNetFrameworkSdkRegistryPathForV4ToolsOnManagedToolsSDK46); // v4.5.2 - Should.Throw( () => ToolLocationHelper.GetDotNetFrameworkSdkRootRegistryKey(TargetDotNetFrameworkVersion.Version452, VisualStudioVersion.Version100) ); - Should.Throw( () => ToolLocationHelper.GetDotNetFrameworkSdkRootRegistryKey(TargetDotNetFrameworkVersion.Version452, VisualStudioVersion.Version110) ); + Should.Throw(() => ToolLocationHelper.GetDotNetFrameworkSdkRootRegistryKey(TargetDotNetFrameworkVersion.Version452, VisualStudioVersion.Version100)); + Should.Throw(() => ToolLocationHelper.GetDotNetFrameworkSdkRootRegistryKey(TargetDotNetFrameworkVersion.Version452, VisualStudioVersion.Version110)); ToolLocationHelper.GetDotNetFrameworkSdkRootRegistryKey(TargetDotNetFrameworkVersion.Version452, VisualStudioVersion.Version120).ShouldBe(fullDotNetFrameworkSdkRegistryPathForV4ToolsOnManagedToolsSDK81A); ToolLocationHelper.GetDotNetFrameworkSdkRootRegistryKey(TargetDotNetFrameworkVersion.Version452, VisualStudioVersion.Version140).ShouldBe(fullDotNetFrameworkSdkRegistryPathForV4ToolsOnManagedToolsSDK46); // v4.6 - Should.Throw( () => ToolLocationHelper.GetDotNetFrameworkSdkRootRegistryKey(TargetDotNetFrameworkVersion.Version46, VisualStudioVersion.Version100) ); - Should.Throw( () => ToolLocationHelper.GetDotNetFrameworkSdkRootRegistryKey(TargetDotNetFrameworkVersion.Version46, VisualStudioVersion.Version110) ); - Should.Throw( () => ToolLocationHelper.GetDotNetFrameworkSdkRootRegistryKey(TargetDotNetFrameworkVersion.Version46, VisualStudioVersion.Version120) ); + Should.Throw(() => ToolLocationHelper.GetDotNetFrameworkSdkRootRegistryKey(TargetDotNetFrameworkVersion.Version46, VisualStudioVersion.Version100)); + Should.Throw(() => ToolLocationHelper.GetDotNetFrameworkSdkRootRegistryKey(TargetDotNetFrameworkVersion.Version46, VisualStudioVersion.Version110)); + Should.Throw(() => ToolLocationHelper.GetDotNetFrameworkSdkRootRegistryKey(TargetDotNetFrameworkVersion.Version46, VisualStudioVersion.Version120)); ToolLocationHelper.GetDotNetFrameworkSdkRootRegistryKey(TargetDotNetFrameworkVersion.Version46, VisualStudioVersion.Version140).ShouldBe(fullDotNetFrameworkSdkRegistryPathForV4ToolsOnManagedToolsSDK46); // v4.6.1 - Should.Throw( () => ToolLocationHelper.GetDotNetFrameworkSdkRootRegistryKey(TargetDotNetFrameworkVersion.Version461, VisualStudioVersion.Version100) ); - Should.Throw( () => ToolLocationHelper.GetDotNetFrameworkSdkRootRegistryKey(TargetDotNetFrameworkVersion.Version461, VisualStudioVersion.Version110) ); - Should.Throw( () => ToolLocationHelper.GetDotNetFrameworkSdkRootRegistryKey(TargetDotNetFrameworkVersion.Version461, VisualStudioVersion.Version120) ); + Should.Throw(() => ToolLocationHelper.GetDotNetFrameworkSdkRootRegistryKey(TargetDotNetFrameworkVersion.Version461, VisualStudioVersion.Version100)); + Should.Throw(() => ToolLocationHelper.GetDotNetFrameworkSdkRootRegistryKey(TargetDotNetFrameworkVersion.Version461, VisualStudioVersion.Version110)); + Should.Throw(() => ToolLocationHelper.GetDotNetFrameworkSdkRootRegistryKey(TargetDotNetFrameworkVersion.Version461, VisualStudioVersion.Version120)); ToolLocationHelper.GetDotNetFrameworkSdkRootRegistryKey(TargetDotNetFrameworkVersion.Version461, VisualStudioVersion.Version140).ShouldBe(fullDotNetFrameworkSdkRegistryPathForV4ToolsOnManagedToolsSDK461); // v4.6.2 - Should.Throw( () => ToolLocationHelper.GetDotNetFrameworkSdkRootRegistryKey(TargetDotNetFrameworkVersion.Version462, VisualStudioVersion.Version100) ); - Should.Throw( () => ToolLocationHelper.GetDotNetFrameworkSdkRootRegistryKey(TargetDotNetFrameworkVersion.Version462, VisualStudioVersion.Version110) ); - Should.Throw( () => ToolLocationHelper.GetDotNetFrameworkSdkRootRegistryKey(TargetDotNetFrameworkVersion.Version462, VisualStudioVersion.Version120) ); + Should.Throw(() => ToolLocationHelper.GetDotNetFrameworkSdkRootRegistryKey(TargetDotNetFrameworkVersion.Version462, VisualStudioVersion.Version100)); + Should.Throw(() => ToolLocationHelper.GetDotNetFrameworkSdkRootRegistryKey(TargetDotNetFrameworkVersion.Version462, VisualStudioVersion.Version110)); + Should.Throw(() => ToolLocationHelper.GetDotNetFrameworkSdkRootRegistryKey(TargetDotNetFrameworkVersion.Version462, VisualStudioVersion.Version120)); ToolLocationHelper.GetDotNetFrameworkSdkRootRegistryKey(TargetDotNetFrameworkVersion.Version462, VisualStudioVersion.Version150).ShouldBe(fullDotNetFrameworkSdkRegistryPathForV4ToolsOnManagedToolsSDK462); // v4.7 - Should.Throw( () => ToolLocationHelper.GetDotNetFrameworkSdkRootRegistryKey(TargetDotNetFrameworkVersion.Version47, VisualStudioVersion.Version100) ); - Should.Throw( () => ToolLocationHelper.GetDotNetFrameworkSdkRootRegistryKey(TargetDotNetFrameworkVersion.Version47, VisualStudioVersion.Version110) ); - Should.Throw( () => ToolLocationHelper.GetDotNetFrameworkSdkRootRegistryKey(TargetDotNetFrameworkVersion.Version47, VisualStudioVersion.Version120) ); + Should.Throw(() => ToolLocationHelper.GetDotNetFrameworkSdkRootRegistryKey(TargetDotNetFrameworkVersion.Version47, VisualStudioVersion.Version100)); + Should.Throw(() => ToolLocationHelper.GetDotNetFrameworkSdkRootRegistryKey(TargetDotNetFrameworkVersion.Version47, VisualStudioVersion.Version110)); + Should.Throw(() => ToolLocationHelper.GetDotNetFrameworkSdkRootRegistryKey(TargetDotNetFrameworkVersion.Version47, VisualStudioVersion.Version120)); ToolLocationHelper.GetDotNetFrameworkSdkRootRegistryKey(TargetDotNetFrameworkVersion.Version47, VisualStudioVersion.Version150).ShouldBe(fullDotNetFrameworkSdkRegistryPathForV4ToolsOnManagedToolsSDK47); // v4.7.1 @@ -874,13 +874,13 @@ public void TestGetDotNetFrameworkSdkInstallKeyValue() // Test out of range .net version. foreach (var vsVersion in EnumVisualStudioVersions()) { - Should.Throw( () => ToolLocationHelper.GetDotNetFrameworkSdkInstallKeyValue((TargetDotNetFrameworkVersion)99, vsVersion) ); + Should.Throw(() => ToolLocationHelper.GetDotNetFrameworkSdkInstallKeyValue((TargetDotNetFrameworkVersion)99, vsVersion)); } // Test out of range visual studio version. foreach (var dotNetVersion in EnumDotNetFrameworkVersions()) { - Should.Throw( () => ToolLocationHelper.GetDotNetFrameworkSdkInstallKeyValue(dotNetVersion, (VisualStudioVersion)99) ); + Should.Throw(() => ToolLocationHelper.GetDotNetFrameworkSdkInstallKeyValue(dotNetVersion, (VisualStudioVersion)99)); } string InstallationFolder = "InstallationFolder"; @@ -894,7 +894,7 @@ public void TestGetDotNetFrameworkSdkInstallKeyValue() ToolLocationHelper.GetDotNetFrameworkSdkInstallKeyValue(TargetDotNetFrameworkVersion.Version20, vsVersion).ShouldBe(FrameworkLocationHelper.dotNetFrameworkSdkInstallKeyValueV20); // v3.0 - Should.Throw( () => ToolLocationHelper.GetDotNetFrameworkSdkInstallKeyValue(TargetDotNetFrameworkVersion.Version30, vsVersion) ); + Should.Throw(() => ToolLocationHelper.GetDotNetFrameworkSdkInstallKeyValue(TargetDotNetFrameworkVersion.Version30, vsVersion)); // v3.5 ToolLocationHelper.GetDotNetFrameworkSdkInstallKeyValue(TargetDotNetFrameworkVersion.Version35, vsVersion).ShouldBe(InstallationFolder); @@ -907,15 +907,15 @@ public void TestGetDotNetFrameworkSdkInstallKeyValue() } // v4.5.1 - Should.Throw( () => ToolLocationHelper.GetDotNetFrameworkSdkInstallKeyValue(TargetDotNetFrameworkVersion.Version451, VisualStudioVersion.Version100) ); - Should.Throw( () => ToolLocationHelper.GetDotNetFrameworkSdkInstallKeyValue(TargetDotNetFrameworkVersion.Version451, VisualStudioVersion.Version110) ); + Should.Throw(() => ToolLocationHelper.GetDotNetFrameworkSdkInstallKeyValue(TargetDotNetFrameworkVersion.Version451, VisualStudioVersion.Version100)); + Should.Throw(() => ToolLocationHelper.GetDotNetFrameworkSdkInstallKeyValue(TargetDotNetFrameworkVersion.Version451, VisualStudioVersion.Version110)); ToolLocationHelper.GetDotNetFrameworkSdkInstallKeyValue(TargetDotNetFrameworkVersion.Version451, VisualStudioVersion.Version120).ShouldBe(InstallationFolder); ToolLocationHelper.GetDotNetFrameworkSdkInstallKeyValue(TargetDotNetFrameworkVersion.Version451, VisualStudioVersion.Version140).ShouldBe(InstallationFolder); // v4.6 - Should.Throw( () => ToolLocationHelper.GetDotNetFrameworkSdkInstallKeyValue(TargetDotNetFrameworkVersion.Version46, VisualStudioVersion.Version100) ); - Should.Throw( () => ToolLocationHelper.GetDotNetFrameworkSdkInstallKeyValue(TargetDotNetFrameworkVersion.Version46, VisualStudioVersion.Version110) ); - Should.Throw( () => ToolLocationHelper.GetDotNetFrameworkSdkInstallKeyValue(TargetDotNetFrameworkVersion.Version46, VisualStudioVersion.Version120) ); + Should.Throw(() => ToolLocationHelper.GetDotNetFrameworkSdkInstallKeyValue(TargetDotNetFrameworkVersion.Version46, VisualStudioVersion.Version100)); + Should.Throw(() => ToolLocationHelper.GetDotNetFrameworkSdkInstallKeyValue(TargetDotNetFrameworkVersion.Version46, VisualStudioVersion.Version110)); + Should.Throw(() => ToolLocationHelper.GetDotNetFrameworkSdkInstallKeyValue(TargetDotNetFrameworkVersion.Version46, VisualStudioVersion.Version120)); ToolLocationHelper.GetDotNetFrameworkSdkInstallKeyValue(TargetDotNetFrameworkVersion.Version46, VisualStudioVersion.Version140).ShouldBe(InstallationFolder); } @@ -930,13 +930,13 @@ public void GetPathToDotNetFrameworkSdk() // Test out of range .net version. foreach (var vsVersion in EnumVisualStudioVersions()) { - Should.Throw( () => ToolLocationHelper.GetPathToDotNetFrameworkSdk((TargetDotNetFrameworkVersion)99, vsVersion) ); + Should.Throw(() => ToolLocationHelper.GetPathToDotNetFrameworkSdk((TargetDotNetFrameworkVersion)99, vsVersion)); } // Test out of range visual studio version. foreach (var dotNetVersion in EnumDotNetFrameworkVersions()) { - Should.Throw( () => ToolLocationHelper.GetPathToDotNetFrameworkSdk(dotNetVersion, (VisualStudioVersion)99) ); + Should.Throw(() => ToolLocationHelper.GetPathToDotNetFrameworkSdk(dotNetVersion, (VisualStudioVersion)99)); } string pathToSdk35InstallRoot = Path.Combine(FrameworkLocationHelper.programFiles32, @"Microsoft SDKs\Windows\v7.0A\"); @@ -970,7 +970,7 @@ public void GetPathToDotNetFrameworkSdk() ToolLocationHelper.GetPathToDotNetFrameworkSdk(TargetDotNetFrameworkVersion.Version20, vsVersion).ShouldBe(FrameworkLocationHelper.PathToDotNetFrameworkSdkV20); // v3.0 - Should.Throw( () => ToolLocationHelper.GetPathToDotNetFrameworkSdk(TargetDotNetFrameworkVersion.Version30, vsVersion) ); + Should.Throw(() => ToolLocationHelper.GetPathToDotNetFrameworkSdk(TargetDotNetFrameworkVersion.Version30, vsVersion)); // v3.5 ToolLocationHelper.GetPathToDotNetFrameworkSdk(TargetDotNetFrameworkVersion.Version35, vsVersion).ShouldBe(pathToSdk35InstallRoot); @@ -989,15 +989,15 @@ public void GetPathToDotNetFrameworkSdk() ToolLocationHelper.GetPathToDotNetFrameworkSdk(TargetDotNetFrameworkVersion.Version45, VisualStudioVersion.Version140).ShouldBe(pathToSdkV4InstallRootOnVS14); // v4.5.1 - Should.Throw( () => ToolLocationHelper.GetPathToDotNetFrameworkSdk(TargetDotNetFrameworkVersion.Version451, VisualStudioVersion.Version100) ); - Should.Throw( () => ToolLocationHelper.GetPathToDotNetFrameworkSdk(TargetDotNetFrameworkVersion.Version451, VisualStudioVersion.Version110) ); + Should.Throw(() => ToolLocationHelper.GetPathToDotNetFrameworkSdk(TargetDotNetFrameworkVersion.Version451, VisualStudioVersion.Version100)); + Should.Throw(() => ToolLocationHelper.GetPathToDotNetFrameworkSdk(TargetDotNetFrameworkVersion.Version451, VisualStudioVersion.Version110)); ToolLocationHelper.GetPathToDotNetFrameworkSdk(TargetDotNetFrameworkVersion.Version451, VisualStudioVersion.Version120).ShouldBe(pathToSdkV4InstallRootOnVS12); ToolLocationHelper.GetPathToDotNetFrameworkSdk(TargetDotNetFrameworkVersion.Version451, VisualStudioVersion.Version140).ShouldBe(pathToSdkV4InstallRootOnVS14); // v4.6 - Should.Throw( () => ToolLocationHelper.GetPathToDotNetFrameworkSdk(TargetDotNetFrameworkVersion.Version46, VisualStudioVersion.Version100) ); - Should.Throw( () => ToolLocationHelper.GetPathToDotNetFrameworkSdk(TargetDotNetFrameworkVersion.Version46, VisualStudioVersion.Version110) ); - Should.Throw( () => ToolLocationHelper.GetPathToDotNetFrameworkSdk(TargetDotNetFrameworkVersion.Version46, VisualStudioVersion.Version120) ); + Should.Throw(() => ToolLocationHelper.GetPathToDotNetFrameworkSdk(TargetDotNetFrameworkVersion.Version46, VisualStudioVersion.Version100)); + Should.Throw(() => ToolLocationHelper.GetPathToDotNetFrameworkSdk(TargetDotNetFrameworkVersion.Version46, VisualStudioVersion.Version110)); + Should.Throw(() => ToolLocationHelper.GetPathToDotNetFrameworkSdk(TargetDotNetFrameworkVersion.Version46, VisualStudioVersion.Version120)); ToolLocationHelper.GetPathToDotNetFrameworkSdk(TargetDotNetFrameworkVersion.Version46, VisualStudioVersion.Version140).ShouldBe(pathToSdkV4InstallRootOnVS14); } @@ -1010,7 +1010,7 @@ public void GetPathToWindowsSdk() // Test out of range .net version. foreach (var vsVersion in EnumVisualStudioVersions()) { - Should.Throw( () => ToolLocationHelper.GetPathToWindowsSdk((TargetDotNetFrameworkVersion)99, vsVersion) ); + Should.Throw(() => ToolLocationHelper.GetPathToWindowsSdk((TargetDotNetFrameworkVersion)99, vsVersion)); } string pathToWindowsSdkV80 = GetRegistryValueHelper(RegistryHive.LocalMachine, RegistryView.Registry32, @"SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.0", "InstallationFolder"); @@ -1021,7 +1021,7 @@ public void GetPathToWindowsSdk() // v1.1, v2.0, v3.0, v3.5, v4.0 foreach (var dotNetVersion in EnumDotNetFrameworkVersions().Where(v => v <= TargetDotNetFrameworkVersion.Version40)) { - Should.Throw( () => ToolLocationHelper.GetPathToWindowsSdk(dotNetVersion, vsVersion) ); + Should.Throw(() => ToolLocationHelper.GetPathToWindowsSdk(dotNetVersion, vsVersion)); } // v4.5 @@ -1098,7 +1098,7 @@ public void VerifyToolsetAndToolLocationHelperAgree() string projectContents = ObjectModelHelpers.CleanupFileContents(@" - + @@ -1151,9 +1151,9 @@ public void VerifyToolsetAndToolLocationHelperAgree() public void VerifyToolsetAndToolLocationHelperAgreeWhenVisualStudioVersionIsEmpty() { string projectContents = @" - + - + @@ -1193,9 +1193,9 @@ public void VerifyToolsetAndToolLocationHelperAgreeWhenVisualStudioVersionIsEmpt public void VerifyToolsetAndToolLocationHelperAgreeWhenVisualStudioVersionIs10() { string projectContents = @" - + - + @@ -1237,9 +1237,9 @@ public void VerifyToolsetAndToolLocationHelperAgreeWhenVisualStudioVersionIs10() public void VerifyToolsetAndToolLocationHelperAgreeWhenVisualStudioVersionIs11() { string projectContents = @" - + - + @@ -2732,7 +2732,7 @@ public void GetPathToReferenceAssembliesWithCustomTargetFrameworkRootInFallbackP } private void CheckGetPathToReferenceAssemblies(TestEnvironment env, string customFrameworkDir, string fallbackSearchPaths, Func> getPathToReferenceAssemblies) - { + { string frameworkName = "Foo Framework"; string frameworkVersion = "0.1"; string frameworkVersionWithV = "v" + frameworkVersion; @@ -2751,8 +2751,8 @@ private void CheckGetPathToReferenceAssemblies(TestEnvironment env, string custo { stdLibPaths.Count.ShouldBe(1); stdLibPaths[0].ShouldBe(Path.Combine(customFrameworkDir, frameworkName, frameworkVersionWithV) + Path.DirectorySeparatorChar, stdLibPaths[0]); - } - } + } + } [Fact] public void GetPathToReferenceAssembliesWithNullTargetFrameworkRootPath() @@ -2935,21 +2935,21 @@ private string GetDotNetFrameworkReferenceAssemblies(TargetDotNetFrameworkVersio switch (version) { case TargetDotNetFrameworkVersion.Version40: - { - return DotNetReferenceAssemblies40Installed ? DotNet40ReferenceAssemblyPath : null; - } + { + return DotNetReferenceAssemblies40Installed ? DotNet40ReferenceAssemblyPath : null; + } case TargetDotNetFrameworkVersion.Version35: - { - return DotNetReferenceAssemblies35Installed ? DotNet35ReferenceAssemblyPath : null; - } + { + return DotNetReferenceAssemblies35Installed ? DotNet35ReferenceAssemblyPath : null; + } case TargetDotNetFrameworkVersion.Version30: - { - return DotNetReferenceAssemblies30Installed ? DotNet30ReferenceAssemblyPath : null; - } + { + return DotNetReferenceAssemblies30Installed ? DotNet30ReferenceAssemblyPath : null; + } default: - { - return null; - } + { + return null; + } } } @@ -2962,25 +2962,25 @@ private string GetDotNetFramework(TargetDotNetFrameworkVersion version) switch (version) { case TargetDotNetFrameworkVersion.Version20: - { - return DotNet20Installed ? DotNet20FrameworkPath : null; - } + { + return DotNet20Installed ? DotNet20FrameworkPath : null; + } case TargetDotNetFrameworkVersion.Version30: - { - return DotNet30Installed ? DotNet30FrameworkPath : null; - } + { + return DotNet30Installed ? DotNet30FrameworkPath : null; + } case TargetDotNetFrameworkVersion.Version35: - { - return DotNet35Installed ? DotNet35FrameworkPath : null; - } + { + return DotNet35Installed ? DotNet35FrameworkPath : null; + } case TargetDotNetFrameworkVersion.Version40: - { - return DotNet40Installed ? DotNet40FrameworkPath : null; - } + { + return DotNet40Installed ? DotNet40FrameworkPath : null; + } default: - { - return null; - } + { + return null; + } } } } @@ -3176,7 +3176,7 @@ public void ResolveFromDirectoryInvalidChar() // Try a path with invalid chars which does not exist string directoryWithInvalidChars = "c:\\<>?"; - var paths = new List {directoryWithInvalidChars}; + var paths = new List { directoryWithInvalidChars }; Should.Throw(() => { ToolLocationHelper.GatherSDKListFromDirectory(paths, targetPlatform); }); } @@ -3709,7 +3709,7 @@ public void VerifyGetInstalledSDKLocations2() 8.0" + @"" + testDirectoryRoot + "" + @"$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation('SDkWithManifest, Version=2.0','MyPlatform','8.0', '$(SDKDirectoryRoot)','')) - $([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation('SDkWithManifest, Version=V2.0','MyPlatform','8.0', '$(SDKDirectoryRoot)','')) + $([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation('SDkWithManifest, Version=V2.0','MyPlatform','8.0', '$(SDKDirectoryRoot)','')) $([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformSDKLocation('MyPlatform','8.0', '$(SDKDirectoryRoot)','')) $([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformSDKDisplayName('MyPlatform','8.0', '$(SDKDirectoryRoot)', '')) @@ -4120,7 +4120,7 @@ public void GetPlatformsForSDKWithInstalledTargetPlatformsNoMatch() [Fact] public void GetPlatformsForSDKWithMatchingPlatformNotMatchingVersion() { - ToolLocationHelper.GetPlatformsForSDK("MyPlatform", new Version("0.0.0.0"), new[] {_fakeStructureRoot}, null).Any().ShouldBeFalse(); + ToolLocationHelper.GetPlatformsForSDK("MyPlatform", new Version("0.0.0.0"), new[] { _fakeStructureRoot }, null).Any().ShouldBeFalse(); } /// @@ -4130,7 +4130,7 @@ public void GetPlatformsForSDKWithMatchingPlatformNotMatchingVersion() [Fact] public void GetPlatformsForSDKForLegacyPlatformSDK() { - ToolLocationHelper.GetPlatformsForSDK("Windows", new Version("8.0"), new[] {_fakeStructureRoot}, null).Any().ShouldBeFalse(); + ToolLocationHelper.GetPlatformsForSDK("Windows", new Version("8.0"), new[] { _fakeStructureRoot }, null).Any().ShouldBeFalse(); } /// @@ -4203,13 +4203,13 @@ public void VerifyFindRootFolderWhereAllFilesExist() string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "VerifyFindRootFolderWhereAllFilesExist"); string[] rootDirectories = new string[] { Path.Combine(testDirectoryRoot, "Root1"), Path.Combine(testDirectoryRoot, "Root2") }; - - for(int i = 0; i < rootDirectories.Length; i++) + + for (int i = 0; i < rootDirectories.Length; i++) { // create directory string subdir = Path.Combine(rootDirectories[i], "Subdir"); Directory.CreateDirectory(subdir); - var fileInSubDir = string.Format("file{0}.txt", i+1); + var fileInSubDir = string.Format("file{0}.txt", i + 1); File.Create(Path.Combine(rootDirectories[i], "file1.txt")).Close(); File.Create(Path.Combine(subdir, fileInSubDir)).Close(); } @@ -4846,17 +4846,17 @@ private static RegistryKey GetBaseKey(RegistryHive hive, RegistryView view) switch (hive) { case RegistryHive.CurrentUser: - { - return Registry.CurrentUser; - } + { + return Registry.CurrentUser; + } case RegistryHive.LocalMachine: - { - return Registry.LocalMachine; - } + { + return Registry.LocalMachine; + } default: - { - return null; - } + { + return null; + } } } #endif