From e26374f55edef2558297646b249f74b0ccb34e12 Mon Sep 17 00:00:00 2001 From: Jeff Kluge Date: Wed, 7 Sep 2016 14:01:54 -0700 Subject: [PATCH 1/2] Fix mixed tabs in EscapingInProjects_Tests.cs --- .../UnitTests/EscapingInProjects_Tests.cs | 122 +++++++++--------- 1 file changed, 61 insertions(+), 61 deletions(-) diff --git a/src/XMakeBuildEngine/UnitTests/EscapingInProjects_Tests.cs b/src/XMakeBuildEngine/UnitTests/EscapingInProjects_Tests.cs index 5e254600f7f..514c97e0fd7 100644 --- a/src/XMakeBuildEngine/UnitTests/EscapingInProjects_Tests.cs +++ b/src/XMakeBuildEngine/UnitTests/EscapingInProjects_Tests.cs @@ -919,23 +919,23 @@ public class FullProjectsUsingMicrosoftCommonTargets Project(`{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}`) = `Class;!@(foo)'^(Library1`, `Class;!@(foo)'^(Library1\Class;!@(foo)'^(Library1.csproj`, `{0B4B78CC-C752-43C2-BE9A-319D20216129}` EndProject Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {770F2381-8C39-49E9-8C96-0538FA4349A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {770F2381-8C39-49E9-8C96-0538FA4349A7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {770F2381-8C39-49E9-8C96-0538FA4349A7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {770F2381-8C39-49E9-8C96-0538FA4349A7}.Release|Any CPU.Build.0 = Release|Any CPU - {0B4B78CC-C752-43C2-BE9A-319D20216129}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0B4B78CC-C752-43C2-BE9A-319D20216129}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0B4B78CC-C752-43C2-BE9A-319D20216129}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0B4B78CC-C752-43C2-BE9A-319D20216129}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {770F2381-8C39-49E9-8C96-0538FA4349A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {770F2381-8C39-49E9-8C96-0538FA4349A7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {770F2381-8C39-49E9-8C96-0538FA4349A7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {770F2381-8C39-49E9-8C96-0538FA4349A7}.Release|Any CPU.Build.0 = Release|Any CPU + {0B4B78CC-C752-43C2-BE9A-319D20216129}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0B4B78CC-C752-43C2-BE9A-319D20216129}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0B4B78CC-C752-43C2-BE9A-319D20216129}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0B4B78CC-C752-43C2-BE9A-319D20216129}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection EndGlobal "; @@ -975,9 +975,9 @@ public void SemicolonInConfiguration() ObjectModelHelpers.CreateFileInTempProjectDirectory("Class1.cs", @" namespace ClassLibrary16 { - public class Class1 - { - } + public class Class1 + { + } } "); @@ -1039,9 +1039,9 @@ public void SemicolonInConfiguration_UsingTaskHost() ObjectModelHelpers.CreateFileInTempProjectDirectory("Class1.cs", @" namespace ClassLibrary16 { - public class Class1 - { - } + public class Class1 + { + } } "); @@ -1103,9 +1103,9 @@ public void SemicolonInAssemblyName() ObjectModelHelpers.CreateFileInTempProjectDirectory("Class1.cs", @" namespace ClassLibrary16 { - public class Class1 - { - } + public class Class1 + { + } } "); @@ -1161,9 +1161,9 @@ public void SemicolonInAssemblyName_UsingTaskHost() ObjectModelHelpers.CreateFileInTempProjectDirectory("Class1.cs", @" namespace ClassLibrary16 { - public class Class1 - { - } + public class Class1 + { + } } "); @@ -1219,9 +1219,9 @@ public void DollarSignInAssemblyName() ObjectModelHelpers.CreateFileInTempProjectDirectory("Class1.cs", @" namespace ClassLibrary16 { - public class Class1 - { - } + public class Class1 + { + } } "); @@ -1277,9 +1277,9 @@ public void DollarSignInAssemblyName_UsingTaskHost() ObjectModelHelpers.CreateFileInTempProjectDirectory("Class1.cs", @" namespace ClassLibrary16 { - public class Class1 - { - } + public class Class1 + { + } } "); @@ -1335,9 +1335,9 @@ public void SemicolonInSourceCodeFilename() ObjectModelHelpers.CreateFileInTempProjectDirectory("Class;1.cs", @" namespace ClassLibrary16 { - public class Class1 - { - } + public class Class1 + { + } } "); @@ -1393,9 +1393,9 @@ public void SemicolonInSourceCodeFilename_UsingTaskHost() ObjectModelHelpers.CreateFileInTempProjectDirectory("Class;1.cs", @" namespace ClassLibrary16 { - public class Class1 - { - } + public class Class1 + { + } } "); @@ -1499,13 +1499,13 @@ public void SolutionWithLotsaCrazyCharacters() namespace Console____foo____Application1 { - class Program - { - static void Main(string[] args) - { - Class____foo____Library1.Class1 foo = new Class____foo____Library1.Class1(); - } - } + class Program + { + static void Main(string[] args) + { + Class____foo____Library1.Class1 foo = new Class____foo____Library1.Class1(); + } + } } "); @@ -1566,9 +1566,9 @@ static void Main(string[] args) @" namespace Class____foo____Library1 { - public class Class1 - { - } + public class Class1 + { + } } "); @@ -1670,13 +1670,13 @@ public void SolutionWithLotsaCrazyCharacters_UsingTaskHost() namespace Console____foo____Application1 { - class Program - { - static void Main(string[] args) - { - Class____foo____Library1.Class1 foo = new Class____foo____Library1.Class1(); - } - } + class Program + { + static void Main(string[] args) + { + Class____foo____Library1.Class1 foo = new Class____foo____Library1.Class1(); + } + } } "); @@ -1737,9 +1737,9 @@ static void Main(string[] args) @" namespace Class____foo____Library1 { - public class Class1 - { - } + public class Class1 + { + } } "); From 862ce619a23877cbfad54fd4acd547ef92f499b3 Mon Sep 17 00:00:00 2001 From: Jeff Kluge Date: Tue, 6 Sep 2016 09:42:31 -0700 Subject: [PATCH 2/2] Implement wild card import of project extensions. These extensions will generally come from package management systems by writing to a file named: $(MSBuildProjectExtensionsPath)\$(MSBuildProjectFile)..props Each package management system should use a unique moniker to avoid collisions. It is a wild-card import so the order of the import is based on the file system's ordering. Fixes #784 - Included unit tests - Fix tests that broke when BaseIntermedateOutputPath was moved. Current import order is: 1. directory build props 2. project extension props 3. project extension targets 4. directory build targets --- .../UnitTests/EscapingInProjects_Tests.cs | 8 + .../Microsoft.Common.CurrentVersion.targets | 2 - src/XMakeTasks/Microsoft.Common.props | 27 ++++ src/XMakeTasks/Microsoft.Common.targets | 13 ++ .../Microsoft.Build.Tasks.UnitTests.csproj | 10 +- .../ProjectExtensionsImportTestBase.cs | 152 ++++++++++++++++++ .../ProjectExtensionsPropsImportTest.cs | 20 +++ .../ProjectExtensionsTargetsImportTest.cs | 20 +++ 8 files changed, 246 insertions(+), 6 deletions(-) create mode 100644 src/XMakeTasks/UnitTests/ProjectExtensionsImportTestBase.cs create mode 100644 src/XMakeTasks/UnitTests/ProjectExtensionsPropsImportTest.cs create mode 100644 src/XMakeTasks/UnitTests/ProjectExtensionsTargetsImportTest.cs diff --git a/src/XMakeBuildEngine/UnitTests/EscapingInProjects_Tests.cs b/src/XMakeBuildEngine/UnitTests/EscapingInProjects_Tests.cs index 514c97e0fd7..8f7eb4469ee 100644 --- a/src/XMakeBuildEngine/UnitTests/EscapingInProjects_Tests.cs +++ b/src/XMakeBuildEngine/UnitTests/EscapingInProjects_Tests.cs @@ -952,6 +952,7 @@ public void SemicolonInConfiguration() // --------------------- ObjectModelHelpers.CreateFileInTempProjectDirectory("foo.csproj", @" + Debug AnyCPU @@ -1016,6 +1017,7 @@ public void SemicolonInConfiguration_UsingTaskHost() // --------------------- ObjectModelHelpers.CreateFileInTempProjectDirectory("foo.csproj", @" + Debug AnyCPU @@ -1080,6 +1082,7 @@ public void SemicolonInAssemblyName() // --------------------- ObjectModelHelpers.CreateFileInTempProjectDirectory("foo.csproj", @" + Debug AnyCPU @@ -1138,6 +1141,7 @@ public void SemicolonInAssemblyName_UsingTaskHost() // --------------------- ObjectModelHelpers.CreateFileInTempProjectDirectory("foo.csproj", @" + Debug AnyCPU @@ -1196,6 +1200,7 @@ public void DollarSignInAssemblyName() // --------------------- ObjectModelHelpers.CreateFileInTempProjectDirectory("foo.csproj", @" + Debug AnyCPU @@ -1254,6 +1259,7 @@ public void DollarSignInAssemblyName_UsingTaskHost() // --------------------- ObjectModelHelpers.CreateFileInTempProjectDirectory("foo.csproj", @" + Debug AnyCPU @@ -1312,6 +1318,7 @@ public void SemicolonInSourceCodeFilename() // --------------------- ObjectModelHelpers.CreateFileInTempProjectDirectory("foo.csproj", @" + Debug AnyCPU @@ -1370,6 +1377,7 @@ public void SemicolonInSourceCodeFilename_UsingTaskHost() // --------------------- ObjectModelHelpers.CreateFileInTempProjectDirectory("foo.csproj", @" + Debug AnyCPU diff --git a/src/XMakeTasks/Microsoft.Common.CurrentVersion.targets b/src/XMakeTasks/Microsoft.Common.CurrentVersion.targets index 07cf4d3df57..e2d3bf8fa5e 100644 --- a/src/XMakeTasks/Microsoft.Common.CurrentVersion.targets +++ b/src/XMakeTasks/Microsoft.Common.CurrentVersion.targets @@ -321,8 +321,6 @@ Copyright (C) Microsoft Corporation. All rights reserved. true false - obj\ - $(BaseIntermediateOutputPath)\ $(MSBuildProjectFile).FileListAbsolute.txt false diff --git a/src/XMakeTasks/Microsoft.Common.props b/src/XMakeTasks/Microsoft.Common.props index 2ddcd634121..23d580520dc 100644 --- a/src/XMakeTasks/Microsoft.Common.props +++ b/src/XMakeTasks/Microsoft.Common.props @@ -31,6 +31,33 @@ Copyright (C) Microsoft Corporation. All rights reserved. + + + + obj\ + $(BaseIntermediateOutputPath)\ + $(BaseIntermediateOutputPath) + + $([System.IO.Path]::Combine('$(MSBuildProjectDirectory)', '$(MSBuildProjectExtensionsPath)')) + $(MSBuildProjectExtensionsPath)\ + true + + + + + + true + + + + true diff --git a/src/XMakeTasks/UnitTests/Microsoft.Build.Tasks.UnitTests.csproj b/src/XMakeTasks/UnitTests/Microsoft.Build.Tasks.UnitTests.csproj index 2c5dda08a5a..00b47c6f967 100644 --- a/src/XMakeTasks/UnitTests/Microsoft.Build.Tasks.UnitTests.csproj +++ b/src/XMakeTasks/UnitTests/Microsoft.Build.Tasks.UnitTests.csproj @@ -1,4 +1,4 @@ - +