diff --git a/build/Targets/Imports.targets b/build/Targets/Imports.targets index 34eb71f01671adf257893ea02c2e98a4a327e65e..aac2932152c7d18e40cc65a5d89cf163d9b970b6 100644 --- a/build/Targets/Imports.targets +++ b/build/Targets/Imports.targets @@ -10,6 +10,7 @@ + <_IsAnyUnitTest>true $(OutDir)UnitTests\$(MSBuildProjectName)\ @@ -17,6 +18,7 @@ <_CopyReferences>false <_CopyProjectReferences>false + <_IsAnyUnitTest>true $(OutDir)Dlls\$(MSBuildProjectName)\ @@ -42,12 +44,6 @@ $(OutDir)Vsix\$(MSBuildProjectName)\ - - - - $(OutDir)Ignore\$(MSBuildProjectName)\ - - @@ -346,6 +342,8 @@ + + + + + + - - - - - + $(NuGetPackageRoot)\Microsoft.Net.Compilers\$(ToolsetCompilerPackageVersion)\tools diff --git a/build/Targets/README.md b/build/Targets/README.md index d7a3bf242c8890ff29c5f2318b3736e7fe2d3e62..019e4a9587b697f66d4dc4837f2ed6d1ee376ddf 100644 --- a/build/Targets/README.md +++ b/build/Targets/README.md @@ -8,6 +8,20 @@ To accomplish this all of the build logic is contained in our central targets fi The individual project files contain declaritive information only. They inherit their build logic by importing [Settings.props](Settings.props) at the start and [Imports.targets](Imports.targets) at the conclusion. +## General rules + +There are a set of general rules to follow for props and targets files: + +- props files + - Do use Import for props files. + - Do not use Import for targets files. + - Do use UsingTask elements. + - Do not use Target elements +- targets files + - Do use Import for targets files. + - Do not use Import for props files. + - Do use Task elements. + ## Files This section describes the purpose and layout of the important files here. diff --git a/build/Targets/Settings.props b/build/Targets/Settings.props index c6c3737e7a70f9dea114e12e1c4b27ad396b033f..9ec2d0b1b409e73845cfed4fe86efe0392a81d78 100644 --- a/build/Targets/Settings.props +++ b/build/Targets/Settings.props @@ -1,4 +1,4 @@ - + @@ -252,26 +252,4 @@ - - - - - - - - - - - - - diff --git a/cibuild.cmd b/cibuild.cmd index 81ff26d78085fe330823641338f749c1e318b808..4fd0ae5164df0b1f51a79a2624db24b3665bc6bf 100644 --- a/cibuild.cmd +++ b/cibuild.cmd @@ -120,7 +120,7 @@ echo Running RepoUtil REM Verify the state of our project.jsons echo Running BuildBoss -.\Binaries\%BuildConfiguration%\Exes\BuildBoss\BuildBoss.exe Roslyn.sln Compilers.sln src\Samples\Samples.sln CrossPlatform.sln || goto :BuildFailed +.\Binaries\%BuildConfiguration%\Exes\BuildBoss\BuildBoss.exe Roslyn.sln Compilers.sln src\Samples\Samples.sln CrossPlatform.sln build\Targets || goto :BuildFailed REM Ensure caller sees successful exit. exit /b 0 diff --git a/src/Compilers/CSharp/Test/CommandLine/CSharpCommandLineTest.csproj b/src/Compilers/CSharp/Test/CommandLine/CSharpCommandLineTest.csproj index 86cda88c8ddbcd6e723be77b80da79e7000e4619..b4b96e995764c30d5b681d72d52d4d3bceb698da 100644 --- a/src/Compilers/CSharp/Test/CommandLine/CSharpCommandLineTest.csproj +++ b/src/Compilers/CSharp/Test/CommandLine/CSharpCommandLineTest.csproj @@ -92,5 +92,4 @@ - - \ No newline at end of file + diff --git a/src/Compilers/CSharp/Test/Emit/CSharpCompilerEmitTest.csproj b/src/Compilers/CSharp/Test/Emit/CSharpCompilerEmitTest.csproj index dc2e2c54ee9a8285fae1343f43a09a1debd6e8c7..b3acc136eaf831c2d1df2d97c80319a7baba4e57 100644 --- a/src/Compilers/CSharp/Test/Emit/CSharpCompilerEmitTest.csproj +++ b/src/Compilers/CSharp/Test/Emit/CSharpCompilerEmitTest.csproj @@ -193,5 +193,4 @@ - - \ No newline at end of file + diff --git a/src/Compilers/CSharp/Test/Semantic/CSharpCompilerSemanticTest.csproj b/src/Compilers/CSharp/Test/Semantic/CSharpCompilerSemanticTest.csproj index 546d4781f4c52385da61dee6301b5eb822c30582..bb6fb32140c9a1534aba854fa2196554dbcbf750 100644 --- a/src/Compilers/CSharp/Test/Semantic/CSharpCompilerSemanticTest.csproj +++ b/src/Compilers/CSharp/Test/Semantic/CSharpCompilerSemanticTest.csproj @@ -156,5 +156,4 @@ - - \ No newline at end of file + diff --git a/src/Compilers/CSharp/Test/Symbol/CSharpCompilerSymbolTest.csproj b/src/Compilers/CSharp/Test/Symbol/CSharpCompilerSymbolTest.csproj index ffbec41e6cb923ee0143af94ad429807c69ac8f9..4c1ed0070fe642b9675a985c1e627255ff8f1dff 100644 --- a/src/Compilers/CSharp/Test/Symbol/CSharpCompilerSymbolTest.csproj +++ b/src/Compilers/CSharp/Test/Symbol/CSharpCompilerSymbolTest.csproj @@ -195,5 +195,4 @@ - - \ No newline at end of file + diff --git a/src/Compilers/CSharp/Test/Syntax/CSharpCompilerSyntaxTest.csproj b/src/Compilers/CSharp/Test/Syntax/CSharpCompilerSyntaxTest.csproj index e4c859ae8fa61b835af8b1b2b55f4db13ee8505a..4b113fe67a44c26cf11bae33fed46ecc357d7ca0 100644 --- a/src/Compilers/CSharp/Test/Syntax/CSharpCompilerSyntaxTest.csproj +++ b/src/Compilers/CSharp/Test/Syntax/CSharpCompilerSyntaxTest.csproj @@ -150,5 +150,4 @@ - diff --git a/src/Compilers/CSharp/Test/WinRT/CSharpWinRTTest.csproj b/src/Compilers/CSharp/Test/WinRT/CSharpWinRTTest.csproj index a64b1a307e2e271b162250512da1056781d60b09..db44732f4725a131677da05aa2ad3e99f6b6f60a 100644 --- a/src/Compilers/CSharp/Test/WinRT/CSharpWinRTTest.csproj +++ b/src/Compilers/CSharp/Test/WinRT/CSharpWinRTTest.csproj @@ -65,5 +65,4 @@ - - \ No newline at end of file + diff --git a/src/Compilers/Core/CodeAnalysisTest/CodeAnalysisTest.csproj b/src/Compilers/Core/CodeAnalysisTest/CodeAnalysisTest.csproj index 3f284f1421c26446398a1a7fd326b25257fcab99..5d3ff6e2acc17ad387ba45e751b3f10102c83097 100644 --- a/src/Compilers/Core/CodeAnalysisTest/CodeAnalysisTest.csproj +++ b/src/Compilers/Core/CodeAnalysisTest/CodeAnalysisTest.csproj @@ -179,5 +179,4 @@ - - \ No newline at end of file + diff --git a/src/Compilers/Core/MSBuildTaskTests/MSBuildTaskTests.csproj b/src/Compilers/Core/MSBuildTaskTests/MSBuildTaskTests.csproj index b56456713772b35ef34e04cee8319bd0317fe90c..fbefafd7b45ef1bd447b8045f82bfaa2e49d4110 100644 --- a/src/Compilers/Core/MSBuildTaskTests/MSBuildTaskTests.csproj +++ b/src/Compilers/Core/MSBuildTaskTests/MSBuildTaskTests.csproj @@ -90,5 +90,4 @@ - - \ No newline at end of file + diff --git a/src/Compilers/Server/VBCSCompilerTests/VBCSCompilerTests.csproj b/src/Compilers/Server/VBCSCompilerTests/VBCSCompilerTests.csproj index dc78e4f2983252d3a16766913a20455cb9c191d3..953a0f7ffd300ee8d26764fe4f01c6886402e408 100644 --- a/src/Compilers/Server/VBCSCompilerTests/VBCSCompilerTests.csproj +++ b/src/Compilers/Server/VBCSCompilerTests/VBCSCompilerTests.csproj @@ -115,5 +115,4 @@ - - \ No newline at end of file + diff --git a/src/Compilers/Test/Utilities/CSharp.Desktop/CSharpCompilerTestUtilities.Desktop.csproj b/src/Compilers/Test/Utilities/CSharp.Desktop/CSharpCompilerTestUtilities.Desktop.csproj index ed426cc995ece544cf21619668a616c3e0b3e3a4..f1dd7086cd3c745a64a1271c6b2cce3609b3c161 100644 --- a/src/Compilers/Test/Utilities/CSharp.Desktop/CSharpCompilerTestUtilities.Desktop.csproj +++ b/src/Compilers/Test/Utilities/CSharp.Desktop/CSharpCompilerTestUtilities.Desktop.csproj @@ -115,5 +115,4 @@ - - \ No newline at end of file + diff --git a/src/Compilers/Test/Utilities/CSharp/CSharpCompilerTestUtilities.csproj b/src/Compilers/Test/Utilities/CSharp/CSharpCompilerTestUtilities.csproj index 13423dd634e64073ac6f091dcc5eec7f58f08ae5..5ac723f4c2d4596debfdd6b985c98f656cd50c1d 100644 --- a/src/Compilers/Test/Utilities/CSharp/CSharpCompilerTestUtilities.csproj +++ b/src/Compilers/Test/Utilities/CSharp/CSharpCompilerTestUtilities.csproj @@ -75,10 +75,9 @@ - - \ No newline at end of file + diff --git a/src/Compilers/Test/Utilities/VisualBasic/BasicCompilerTestUtilities.vbproj b/src/Compilers/Test/Utilities/VisualBasic/BasicCompilerTestUtilities.vbproj index f6f7448bd8bf716f0edbeaa014c9fdf47a8eb59f..b24427277bbba846fae5880256fa03de39dce3ee 100644 --- a/src/Compilers/Test/Utilities/VisualBasic/BasicCompilerTestUtilities.vbproj +++ b/src/Compilers/Test/Utilities/VisualBasic/BasicCompilerTestUtilities.vbproj @@ -112,5 +112,4 @@ - - \ No newline at end of file + diff --git a/src/Compilers/VisualBasic/Test/CommandLine/BasicCommandLineTest.vbproj b/src/Compilers/VisualBasic/Test/CommandLine/BasicCommandLineTest.vbproj index 918b6b2d270321b2a84fa699d813a6dab98c77fe..94996244de63e5e569309a99eda7013e8f36e396 100644 --- a/src/Compilers/VisualBasic/Test/CommandLine/BasicCommandLineTest.vbproj +++ b/src/Compilers/VisualBasic/Test/CommandLine/BasicCommandLineTest.vbproj @@ -134,5 +134,4 @@ - - \ No newline at end of file + diff --git a/src/Compilers/VisualBasic/Test/Emit/BasicCompilerEmitTest.vbproj b/src/Compilers/VisualBasic/Test/Emit/BasicCompilerEmitTest.vbproj index 3c805fbeab8f002b3bfbc91fdd951cd90aba597d..6cb8e65eaabbedc7f93d1fb069a100401d5ea769 100644 --- a/src/Compilers/VisualBasic/Test/Emit/BasicCompilerEmitTest.vbproj +++ b/src/Compilers/VisualBasic/Test/Emit/BasicCompilerEmitTest.vbproj @@ -261,5 +261,4 @@ - - \ No newline at end of file + diff --git a/src/Compilers/VisualBasic/Test/Semantic/BasicCompilerSemanticTest.vbproj b/src/Compilers/VisualBasic/Test/Semantic/BasicCompilerSemanticTest.vbproj index c08f0a008e8c0148a9e585fda898fcf150437b8a..b116c63bacd766b089a31c3646fe1b8fc632fe47 100644 --- a/src/Compilers/VisualBasic/Test/Semantic/BasicCompilerSemanticTest.vbproj +++ b/src/Compilers/VisualBasic/Test/Semantic/BasicCompilerSemanticTest.vbproj @@ -227,5 +227,4 @@ - - \ No newline at end of file + diff --git a/src/Compilers/VisualBasic/Test/Symbol/BasicCompilerSymbolTest.vbproj b/src/Compilers/VisualBasic/Test/Symbol/BasicCompilerSymbolTest.vbproj index 304023889cae0dc19cc97f279145af8dc81af957..87d0dcf8057335e213e1f58c4a33e2b4b2da48a6 100644 --- a/src/Compilers/VisualBasic/Test/Symbol/BasicCompilerSymbolTest.vbproj +++ b/src/Compilers/VisualBasic/Test/Symbol/BasicCompilerSymbolTest.vbproj @@ -176,5 +176,4 @@ - - \ No newline at end of file + diff --git a/src/Compilers/VisualBasic/Test/Syntax/BasicCompilerSyntaxTest.vbproj b/src/Compilers/VisualBasic/Test/Syntax/BasicCompilerSyntaxTest.vbproj index 8ae3f260cca84ed7528ac34f76c24d64a6793e41..48f3758e04ac6943f4d6e0fb3662bd497c57c653 100644 --- a/src/Compilers/VisualBasic/Test/Syntax/BasicCompilerSyntaxTest.vbproj +++ b/src/Compilers/VisualBasic/Test/Syntax/BasicCompilerSyntaxTest.vbproj @@ -161,5 +161,4 @@ - - \ No newline at end of file + diff --git a/src/EditorFeatures/CSharpTest/CSharpEditorServicesTest.csproj b/src/EditorFeatures/CSharpTest/CSharpEditorServicesTest.csproj index 72a5d4da14a7dba101d0d96052de648248bfbd3d..92158b66eecbcfa59189c64db7367b84cd6f0aa7 100644 --- a/src/EditorFeatures/CSharpTest/CSharpEditorServicesTest.csproj +++ b/src/EditorFeatures/CSharpTest/CSharpEditorServicesTest.csproj @@ -600,5 +600,4 @@ - - \ No newline at end of file + diff --git a/src/EditorFeatures/CSharpTest2/CSharpEditorServicesTest2.csproj b/src/EditorFeatures/CSharpTest2/CSharpEditorServicesTest2.csproj index bc9a958e42245ca50146d24cca35155d770da461..52690b83e74a2914cf06c5f916246fbb848789d3 100644 --- a/src/EditorFeatures/CSharpTest2/CSharpEditorServicesTest2.csproj +++ b/src/EditorFeatures/CSharpTest2/CSharpEditorServicesTest2.csproj @@ -304,5 +304,4 @@ - - \ No newline at end of file + diff --git a/src/EditorFeatures/Test/EditorServicesTest.csproj b/src/EditorFeatures/Test/EditorServicesTest.csproj index 7d057b51ce0c5684949278af13b9cf660142b273..48723237616f89288c40118f917acbbd755d2441 100644 --- a/src/EditorFeatures/Test/EditorServicesTest.csproj +++ b/src/EditorFeatures/Test/EditorServicesTest.csproj @@ -260,5 +260,4 @@ - diff --git a/src/EditorFeatures/Test2/EditorServicesTest2.vbproj b/src/EditorFeatures/Test2/EditorServicesTest2.vbproj index 9919b34498df0a4327a54ed60af6059487e09436..55398ebd72a6f4c0e2d3d2aa62e919ebe7f46db7 100644 --- a/src/EditorFeatures/Test2/EditorServicesTest2.vbproj +++ b/src/EditorFeatures/Test2/EditorServicesTest2.vbproj @@ -337,5 +337,4 @@ - diff --git a/src/EditorFeatures/TestUtilities/ServicesTestUtilities.csproj b/src/EditorFeatures/TestUtilities/ServicesTestUtilities.csproj index 96e9fc3c8a7d92bbcf1ac8d766c62db66c2d694f..33126d50af94996712ff65126775755d346599ed 100644 --- a/src/EditorFeatures/TestUtilities/ServicesTestUtilities.csproj +++ b/src/EditorFeatures/TestUtilities/ServicesTestUtilities.csproj @@ -287,5 +287,4 @@ - diff --git a/src/EditorFeatures/VisualBasicTest/BasicEditorServicesTest.vbproj b/src/EditorFeatures/VisualBasicTest/BasicEditorServicesTest.vbproj index 18e1cda4fcdd6f4537782d41e75e02e17cafc0c0..53798e538962b8ce0d2e0ca21e6a1d9dc0216e24 100644 --- a/src/EditorFeatures/VisualBasicTest/BasicEditorServicesTest.vbproj +++ b/src/EditorFeatures/VisualBasicTest/BasicEditorServicesTest.vbproj @@ -701,5 +701,4 @@ - - \ No newline at end of file + diff --git a/src/ExpressionEvaluator/CSharp/Test/ExpressionCompiler/CSharpExpressionCompilerTest.csproj b/src/ExpressionEvaluator/CSharp/Test/ExpressionCompiler/CSharpExpressionCompilerTest.csproj index 190fd28b036f8c6f21d9087a1687a3b2f5661e96..9c9f2dbe6106360f7e421309ff01c96b081c410b 100644 --- a/src/ExpressionEvaluator/CSharp/Test/ExpressionCompiler/CSharpExpressionCompilerTest.csproj +++ b/src/ExpressionEvaluator/CSharp/Test/ExpressionCompiler/CSharpExpressionCompilerTest.csproj @@ -113,5 +113,4 @@ - - \ No newline at end of file + diff --git a/src/ExpressionEvaluator/CSharp/Test/ResultProvider/CSharpResultProviderTest.csproj b/src/ExpressionEvaluator/CSharp/Test/ResultProvider/CSharpResultProviderTest.csproj index 69ed316311523f09dd1bc1d9f5a9be8a502d5848..15f7bf489223ff531466f917f1d267236b29ac86 100644 --- a/src/ExpressionEvaluator/CSharp/Test/ResultProvider/CSharpResultProviderTest.csproj +++ b/src/ExpressionEvaluator/CSharp/Test/ResultProvider/CSharpResultProviderTest.csproj @@ -104,5 +104,4 @@ - - \ No newline at end of file + diff --git a/src/ExpressionEvaluator/Core/Test/ExpressionCompiler/ExpressionCompilerTestUtilities.csproj b/src/ExpressionEvaluator/Core/Test/ExpressionCompiler/ExpressionCompilerTestUtilities.csproj index 09e25310f4960d4f76dea0126cc6fc82b03e951e..4fa081059643688b4ff9c42e70d6e34d196ce505 100644 --- a/src/ExpressionEvaluator/Core/Test/ExpressionCompiler/ExpressionCompilerTestUtilities.csproj +++ b/src/ExpressionEvaluator/Core/Test/ExpressionCompiler/ExpressionCompilerTestUtilities.csproj @@ -83,5 +83,4 @@ - - \ No newline at end of file + diff --git a/src/ExpressionEvaluator/Core/Test/ResultProvider/ResultProviderTestUtilities.csproj b/src/ExpressionEvaluator/Core/Test/ResultProvider/ResultProviderTestUtilities.csproj index 8c5d436c6ea63d0d6b5f19e44ff84e4224c48d49..64498a3f4d6745b412abefa97caea61ae9a67cee 100644 --- a/src/ExpressionEvaluator/Core/Test/ResultProvider/ResultProviderTestUtilities.csproj +++ b/src/ExpressionEvaluator/Core/Test/ResultProvider/ResultProviderTestUtilities.csproj @@ -166,5 +166,4 @@ - - \ No newline at end of file + diff --git a/src/ExpressionEvaluator/VisualBasic/Test/ExpressionCompiler/BasicExpressionCompilerTest.vbproj b/src/ExpressionEvaluator/VisualBasic/Test/ExpressionCompiler/BasicExpressionCompilerTest.vbproj index 05e1e989af843af96daf4de556f3abc2f5eceb5a..9f20094838f0c31cb3df1f7731da4e0a78322025 100644 --- a/src/ExpressionEvaluator/VisualBasic/Test/ExpressionCompiler/BasicExpressionCompilerTest.vbproj +++ b/src/ExpressionEvaluator/VisualBasic/Test/ExpressionCompiler/BasicExpressionCompilerTest.vbproj @@ -112,5 +112,4 @@ - - \ No newline at end of file + diff --git a/src/ExpressionEvaluator/VisualBasic/Test/ResultProvider/BasicResultProviderTest.vbproj b/src/ExpressionEvaluator/VisualBasic/Test/ResultProvider/BasicResultProviderTest.vbproj index a5db78a041e823d8e9ca156c8e648fdd99126b63..8678aeeb9a43cd8938377a5c6d7b29485ef2827c 100644 --- a/src/ExpressionEvaluator/VisualBasic/Test/ResultProvider/BasicResultProviderTest.vbproj +++ b/src/ExpressionEvaluator/VisualBasic/Test/ResultProvider/BasicResultProviderTest.vbproj @@ -94,5 +94,4 @@ - - \ No newline at end of file + diff --git a/src/Interactive/HostTest/InteractiveHostTest.csproj b/src/Interactive/HostTest/InteractiveHostTest.csproj index b9bda87260b910abbb74891698c6af240a6d8d08..f611ae7504d7eb3bc33afe4f84ed1aa94a8e20c1 100644 --- a/src/Interactive/HostTest/InteractiveHostTest.csproj +++ b/src/Interactive/HostTest/InteractiveHostTest.csproj @@ -169,5 +169,4 @@ - - \ No newline at end of file + diff --git a/src/Samples/CSharp/APISampleUnitTests/APISampleUnitTestsCS.csproj b/src/Samples/CSharp/APISampleUnitTests/APISampleUnitTestsCS.csproj index 2d53674f72c1fe839a63be0115f4f29bf83926df..a777d7e2e4546489f7c55268d2df4eab57e71f9c 100644 --- a/src/Samples/CSharp/APISampleUnitTests/APISampleUnitTestsCS.csproj +++ b/src/Samples/CSharp/APISampleUnitTests/APISampleUnitTestsCS.csproj @@ -57,5 +57,4 @@ - - \ No newline at end of file + diff --git a/src/Samples/CSharp/ConvertToConditional/Test/ConvertToConditionalCS.UnitTests.csproj b/src/Samples/CSharp/ConvertToConditional/Test/ConvertToConditionalCS.UnitTests.csproj index 296b8487cf1bb3eb7fffc102cb1ae26972717db1..3b0a59fee6f33b5c2f2c658b65d633794a563bbc 100644 --- a/src/Samples/CSharp/ConvertToConditional/Test/ConvertToConditionalCS.UnitTests.csproj +++ b/src/Samples/CSharp/ConvertToConditional/Test/ConvertToConditionalCS.UnitTests.csproj @@ -83,5 +83,4 @@ - - \ No newline at end of file + diff --git a/src/Samples/CSharp/ImplementNotifyPropertyChanged/Test/ImplementNotifyPropertyChangedCS.UnitTests.csproj b/src/Samples/CSharp/ImplementNotifyPropertyChanged/Test/ImplementNotifyPropertyChangedCS.UnitTests.csproj index 10992d095fcf754ffcb8f48076f0c591cc85dd41..37034d4ee1e81d2f523d845229f908ad8d868cb9 100644 --- a/src/Samples/CSharp/ImplementNotifyPropertyChanged/Test/ImplementNotifyPropertyChangedCS.UnitTests.csproj +++ b/src/Samples/CSharp/ImplementNotifyPropertyChanged/Test/ImplementNotifyPropertyChangedCS.UnitTests.csproj @@ -82,5 +82,4 @@ - - \ No newline at end of file + diff --git a/src/Samples/VisualBasic/APISampleUnitTests/APISampleUnitTestsVB.vbproj b/src/Samples/VisualBasic/APISampleUnitTests/APISampleUnitTestsVB.vbproj index bfa6b3eec95f3a9e9aa390f2e35f1f39e78ee84e..31fa00514c171cc53530fd6961e085743ee5962e 100644 --- a/src/Samples/VisualBasic/APISampleUnitTests/APISampleUnitTestsVB.vbproj +++ b/src/Samples/VisualBasic/APISampleUnitTests/APISampleUnitTestsVB.vbproj @@ -74,5 +74,4 @@ - - \ No newline at end of file + diff --git a/src/Samples/VisualBasic/ConvertToAutoProperty/Test/ConvertToAutoPropertyVB.UnitTests.vbproj b/src/Samples/VisualBasic/ConvertToAutoProperty/Test/ConvertToAutoPropertyVB.UnitTests.vbproj index 4db2e776ce1c76e6c62b60681c9700f217f6c268..8632f25cf92284fc989b6c55c9be78ff2b806cc4 100644 --- a/src/Samples/VisualBasic/ConvertToAutoProperty/Test/ConvertToAutoPropertyVB.UnitTests.vbproj +++ b/src/Samples/VisualBasic/ConvertToAutoProperty/Test/ConvertToAutoPropertyVB.UnitTests.vbproj @@ -98,5 +98,4 @@ - - \ No newline at end of file + diff --git a/src/Samples/VisualBasic/ImplementNotifyPropertyChanged/Test/ImplementNotifyPropertyChangedVB.UnitTests.vbproj b/src/Samples/VisualBasic/ImplementNotifyPropertyChanged/Test/ImplementNotifyPropertyChangedVB.UnitTests.vbproj index 738690e10baf14eb7e1538ec8598f2a6fda292be..c0703746883d1f0ba67c8d7122769528acca89bf 100644 --- a/src/Samples/VisualBasic/ImplementNotifyPropertyChanged/Test/ImplementNotifyPropertyChangedVB.UnitTests.vbproj +++ b/src/Samples/VisualBasic/ImplementNotifyPropertyChanged/Test/ImplementNotifyPropertyChangedVB.UnitTests.vbproj @@ -92,5 +92,4 @@ - - \ No newline at end of file + diff --git a/src/Samples/VisualBasic/RemoveByVal/Test/RemoveByValVB.UnitTests.vbproj b/src/Samples/VisualBasic/RemoveByVal/Test/RemoveByValVB.UnitTests.vbproj index de21888e549a101e9b4b3a7928ca89d9b22bb64c..fc5e732cca2aa025349947c73c9bd7ab2b38226f 100644 --- a/src/Samples/VisualBasic/RemoveByVal/Test/RemoveByValVB.UnitTests.vbproj +++ b/src/Samples/VisualBasic/RemoveByVal/Test/RemoveByValVB.UnitTests.vbproj @@ -114,5 +114,4 @@ - - \ No newline at end of file + diff --git a/src/Scripting/CSharpTest.Desktop/CSharpScriptingTest.Desktop.csproj b/src/Scripting/CSharpTest.Desktop/CSharpScriptingTest.Desktop.csproj index a1f08617f668920f816a574077209f59fb9b6c50..043af18dd97f5d98440a01265d61881a3c1250a2 100644 --- a/src/Scripting/CSharpTest.Desktop/CSharpScriptingTest.Desktop.csproj +++ b/src/Scripting/CSharpTest.Desktop/CSharpScriptingTest.Desktop.csproj @@ -90,5 +90,4 @@ - - \ No newline at end of file + diff --git a/src/Scripting/CSharpTest/CSharpScriptingTest.csproj b/src/Scripting/CSharpTest/CSharpScriptingTest.csproj index 1182e7d1a92da9097b4e7b75d2a84c949f344659..4f30db7afcd0adeaf645f71164f7f1dcbb91f1ab 100644 --- a/src/Scripting/CSharpTest/CSharpScriptingTest.csproj +++ b/src/Scripting/CSharpTest/CSharpScriptingTest.csproj @@ -79,5 +79,4 @@ - diff --git a/src/Scripting/CoreTest.Desktop/ScriptingTest.Desktop.csproj b/src/Scripting/CoreTest.Desktop/ScriptingTest.Desktop.csproj index baf856fdcc08ac062f97dbb2b619bda3f93fa024..8bf40afcd144438b1891eb6693b1b76e1b3af7b5 100644 --- a/src/Scripting/CoreTest.Desktop/ScriptingTest.Desktop.csproj +++ b/src/Scripting/CoreTest.Desktop/ScriptingTest.Desktop.csproj @@ -66,5 +66,4 @@ - - \ No newline at end of file + diff --git a/src/Scripting/CoreTest/ScriptingTest.csproj b/src/Scripting/CoreTest/ScriptingTest.csproj index c96e148f3874c734360ae2720ae9014f7da8cba9..b5b4ba570255320264836947663fecc36f7dca7d 100644 --- a/src/Scripting/CoreTest/ScriptingTest.csproj +++ b/src/Scripting/CoreTest/ScriptingTest.csproj @@ -80,5 +80,4 @@ - diff --git a/src/Scripting/VisualBasicTest.Desktop/BasicScriptingTest.Desktop.vbproj b/src/Scripting/VisualBasicTest.Desktop/BasicScriptingTest.Desktop.vbproj index 4eb6d439a82d46a10044bb2c2b5d21ade1cf00c2..59abdb2656f20ab62e11b724a6463e9f52789703 100644 --- a/src/Scripting/VisualBasicTest.Desktop/BasicScriptingTest.Desktop.vbproj +++ b/src/Scripting/VisualBasicTest.Desktop/BasicScriptingTest.Desktop.vbproj @@ -81,5 +81,4 @@ - - \ No newline at end of file + diff --git a/src/Scripting/VisualBasicTest/BasicScriptingTest.vbproj b/src/Scripting/VisualBasicTest/BasicScriptingTest.vbproj index 665e2bee461976d9943d24845aa144bbb31b1f3c..a5ade8c6361a18928ee3299b37e2649e9da62110 100644 --- a/src/Scripting/VisualBasicTest/BasicScriptingTest.vbproj +++ b/src/Scripting/VisualBasicTest/BasicScriptingTest.vbproj @@ -74,5 +74,4 @@ - diff --git a/src/Test/Utilities/Desktop/TestUtilities.Desktop.csproj b/src/Test/Utilities/Desktop/TestUtilities.Desktop.csproj index 8768a18fe3bf906c04eca141ac6f02d29ec29620..028ecbd52faf928992a5e15804927910534a4c23 100644 --- a/src/Test/Utilities/Desktop/TestUtilities.Desktop.csproj +++ b/src/Test/Utilities/Desktop/TestUtilities.Desktop.csproj @@ -167,5 +167,4 @@ - diff --git a/src/Test/Utilities/Portable.FX45/TestUtilities.FX45.csproj b/src/Test/Utilities/Portable.FX45/TestUtilities.FX45.csproj index 653be41fbe954993e1edffddc3c5ee308bb3b091..eb957b47901375419ff577664af4796e4bbbf3e0 100644 --- a/src/Test/Utilities/Portable.FX45/TestUtilities.FX45.csproj +++ b/src/Test/Utilities/Portable.FX45/TestUtilities.FX45.csproj @@ -113,5 +113,4 @@ - diff --git a/src/Test/Utilities/Portable/TestUtilities.csproj b/src/Test/Utilities/Portable/TestUtilities.csproj index 386a0ee943b3be15381ffc34182b47907910ce4d..fd5712d4d174992dc86a05fd64bdb5b22d6b7d7e 100644 --- a/src/Test/Utilities/Portable/TestUtilities.csproj +++ b/src/Test/Utilities/Portable/TestUtilities.csproj @@ -123,6 +123,5 @@ - diff --git a/src/Tools/BuildBoss/BuildBoss.csproj b/src/Tools/BuildBoss/BuildBoss.csproj index 46926cc2b41c69945f16d6c0febd576df82cb968..6906e59fafbf8855f1c6db9f5b7b93ea270b5018 100644 --- a/src/Tools/BuildBoss/BuildBoss.csproj +++ b/src/Tools/BuildBoss/BuildBoss.csproj @@ -32,6 +32,7 @@ + diff --git a/src/Tools/BuildBoss/Program.cs b/src/Tools/BuildBoss/Program.cs index f498b82abfeffd05f7b16d2201609721fba835a4..dfad0899c1e9a4eeb9c137902291f5f7cdbe4e75 100644 --- a/src/Tools/BuildBoss/Program.cs +++ b/src/Tools/BuildBoss/Program.cs @@ -11,18 +11,25 @@ namespace BuildBoss { internal static class Program { - internal static int Main(string[] solutionFilePaths) + internal static int Main(string[] args) { - if (solutionFilePaths.Length == 0) + if (args.Length == 0) { Usage(); return 1; } var allGood = true; - foreach (var solutionFilePath in solutionFilePaths) + foreach (var arg in args) { - allGood &= ProcessSolution(solutionFilePath); + if (SharedUtil.IsSolutionFile(arg)) + { + allGood &= ProcessSolution(arg); + } + else + { + allGood &= ProcessTargets(arg); + } } return allGood ? 0 : 1; @@ -78,6 +85,23 @@ private static bool ProcessProject(string solutionPath, ProjectData projectData, return true; } + private static bool ProcessTargets(string targets) + { + var checker = new TargetsCheckerUtil(targets); + var textWriter = new StringWriter(); + if (checker.CheckAll(textWriter)) + { + Console.WriteLine($"Processing {Path.GetFileName(targets)} passed"); + return true; + } + else + { + Console.WriteLine($"Processing {Path.GetFileName(targets)} FAILED"); + Console.WriteLine(textWriter.ToString()); + return false; + } + } + private static void Usage() { Console.WriteLine($"BuildBoss "); diff --git a/src/Tools/BuildBoss/ProjectUtil.cs b/src/Tools/BuildBoss/ProjectUtil.cs index 7428ffb583c9feb88b76a3ec93769149078647a3..9f374d719178584b3aff043a2146696fe2bdc318 100644 --- a/src/Tools/BuildBoss/ProjectUtil.cs +++ b/src/Tools/BuildBoss/ProjectUtil.cs @@ -16,6 +16,11 @@ internal class ProjectUtil private readonly XDocument _document; private readonly XmlNamespaceManager _manager; + internal ProjectUtil(string filePath) :this(new ProjectKey(filePath), XDocument.Load(filePath)) + { + + } + internal ProjectUtil(ProjectKey key, XDocument document) { _key = key; @@ -89,11 +94,23 @@ internal IEnumerable GetAllPropertyGroupElements() } } + internal IEnumerable GetTargets() + { + return _document.XPathSelectElements("//mb:Target", _manager); + } + internal IEnumerable GetImports() { return _document.XPathSelectElements("//mb:Import", _manager); } + internal IEnumerable GetImportProjects() + { + return GetImports() + .Select(x => x.Attribute("Project")?.Value) + .Where(x => !string.IsNullOrEmpty(x)); + } + internal IEnumerable GetItemGroup() { return _document.XPathSelectElements("//mb:ItemGroup", _manager); diff --git a/src/Tools/BuildBoss/README.md b/src/Tools/BuildBoss/README.md index 4d5d824b23a4412bdd198c476939a8b553307089..f337131ae4a2c7b4bcdea5b1ab97df76c084a482 100644 --- a/src/Tools/BuildBoss/README.md +++ b/src/Tools/BuildBoss/README.md @@ -31,3 +31,4 @@ Our build process depends on being able to correctly classify our projects. Thi This could be done using MSBuild targets but the logic is hard to follow and complicates the build. It's easier to verify here. + diff --git a/src/Tools/BuildBoss/SharedUtil.cs b/src/Tools/BuildBoss/SharedUtil.cs index 3471e80cdcd0fc9fbc199b9f931dd76e19601c15..4fda101b2499520009783e56e51e9808c224ae51 100644 --- a/src/Tools/BuildBoss/SharedUtil.cs +++ b/src/Tools/BuildBoss/SharedUtil.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -13,5 +14,10 @@ internal static class SharedUtil internal static Uri MSBuildNamespaceUri { get; } = new Uri(MSBuildNamespaceUriRaw); internal static XNamespace MSBuildNamespace { get; } = XNamespace.Get(MSBuildNamespaceUriRaw); internal static Encoding Encoding { get; } = Encoding.UTF8; + + internal static bool IsSolutionFile(string path) => Path.GetExtension(path) == ".sln"; + internal static bool IsPropsFile(string path) => Path.GetExtension(path) == ".props"; + internal static bool IsTargetsFile(string path) => Path.GetExtension(path) == ".targets"; + internal static bool IsXslt(string path) => Path.GetExtension(path) == ".xslt"; } } diff --git a/src/Tools/BuildBoss/TargetsCheckerUtil.cs b/src/Tools/BuildBoss/TargetsCheckerUtil.cs new file mode 100644 index 0000000000000000000000000000000000000000..7024fa96e1ae988fc43836dfeb1c935d1083eb63 --- /dev/null +++ b/src/Tools/BuildBoss/TargetsCheckerUtil.cs @@ -0,0 +1,119 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BuildBoss +{ + internal sealed class TargetsCheckerUtil + { + private readonly string _targetDir; + + internal TargetsCheckerUtil(string targetDir) + { + _targetDir = targetDir; + } + + internal bool CheckAll(TextWriter textWriter) + { + var allGood = true; + + foreach (var filePath in Directory.GetFiles(_targetDir)) + { + var fileName = Path.GetFileName(filePath); + if (fileName == "README.md") + { + continue; + } + + textWriter.WriteLine($"Checking {fileName}"); + if (SharedUtil.IsPropsFile(filePath)) + { + allGood &= CheckProps(new ProjectUtil(filePath), textWriter); + } + else if (SharedUtil.IsTargetsFile(filePath)) + { + allGood &= CheckTargets(new ProjectUtil(filePath), textWriter); + } + else if (SharedUtil.IsXslt(filePath)) + { + // Nothing to verify + } + else + { + textWriter.WriteLine("Unrecognized file type"); + allGood = false; + } + } + + return allGood; + } + + private bool CheckProps(ProjectUtil util, TextWriter textWriter) + { + var allGood = true; + foreach (var project in GetImportProjects(util)) + { + if (!SharedUtil.IsPropsFile(project)) + { + textWriter.WriteLine($"Props files should only Import other props files"); + allGood = false; + } + } + + if (util.GetTargets().Any()) + { + textWriter.WriteLine($"Props files should not contain elements"); + allGood = false; + } + + return allGood; + } + + private bool CheckTargets(ProjectUtil util, TextWriter textWriter) + { + var allGood = true; + foreach (var project in GetImportProjects(util)) + { + if (SharedUtil.IsPropsFile(project)) + { + textWriter.WriteLine($"Targets files should not Import props files"); + allGood = false; + } + } + + return allGood; + } + + private static IEnumerable GetImportProjects(ProjectUtil util) + { + foreach (var project in util.GetImportProjects()) + { + if (IsReplacedValue(project)) + { + continue; + } + + yield return project; + } + } + + /// + /// Is this a whole replaced MSBuild value like $(Trick) + /// + private static bool IsReplacedValue(string value) + { + if (value.Length <= 3) + { + return false; + } + + return + value[0] == '$' && + value[1] == '(' && + value[value.Length - 1] == ')'; + } + } +} diff --git a/src/VisualStudio/CSharp/Test/CSharpVisualStudioTest.csproj b/src/VisualStudio/CSharp/Test/CSharpVisualStudioTest.csproj index 5f1b9e4f18d74c54e07df5424537133e38dbce4c..10ed0be968fca12117031152b8d58a1c5897e7a8 100644 --- a/src/VisualStudio/CSharp/Test/CSharpVisualStudioTest.csproj +++ b/src/VisualStudio/CSharp/Test/CSharpVisualStudioTest.csproj @@ -260,5 +260,4 @@ - - \ No newline at end of file + diff --git a/src/VisualStudio/Core/Test.Next/VisualStudioTest.Next.csproj b/src/VisualStudio/Core/Test.Next/VisualStudioTest.Next.csproj index 28fbf171988aa64261d591a76598079a582183ff..3e0f822bd613eb905e6217b34c40cdfc8b4369f1 100644 --- a/src/VisualStudio/Core/Test.Next/VisualStudioTest.Next.csproj +++ b/src/VisualStudio/Core/Test.Next/VisualStudioTest.Next.csproj @@ -199,5 +199,4 @@ - diff --git a/src/VisualStudio/Core/Test/ServicesVisualStudioTest.vbproj b/src/VisualStudio/Core/Test/ServicesVisualStudioTest.vbproj index 08d76775f8f0894c97c22a495ba6804826c4ee5a..0a3ef55cdd50292b0cc9c174246eb231d024165e 100644 --- a/src/VisualStudio/Core/Test/ServicesVisualStudioTest.vbproj +++ b/src/VisualStudio/Core/Test/ServicesVisualStudioTest.vbproj @@ -431,5 +431,4 @@ - - \ No newline at end of file + diff --git a/src/VisualStudio/IntegrationTests/VisualStudioIntegrationTests.csproj b/src/VisualStudio/IntegrationTests/VisualStudioIntegrationTests.csproj index c4a023ba9b82ab02ab9e53e437a1047290e4ba69..5af5eb0884734840b08eefb1cf8b9ece28b24cfb 100644 --- a/src/VisualStudio/IntegrationTests/VisualStudioIntegrationTests.csproj +++ b/src/VisualStudio/IntegrationTests/VisualStudioIntegrationTests.csproj @@ -202,5 +202,4 @@ - diff --git a/src/Workspaces/CSharpTest/CSharpServicesTest.csproj b/src/Workspaces/CSharpTest/CSharpServicesTest.csproj index 03530e454ce62dc04fafa8bfe5cbff5c283f0e76..4436f5b0dcb6fbc87d4bd78387556d456a6562e2 100644 --- a/src/Workspaces/CSharpTest/CSharpServicesTest.csproj +++ b/src/Workspaces/CSharpTest/CSharpServicesTest.csproj @@ -87,5 +87,4 @@ - - \ No newline at end of file + diff --git a/src/Workspaces/CoreTest/ServicesTest.csproj b/src/Workspaces/CoreTest/ServicesTest.csproj index 09cc1147fefdcaf3cc0686f5436e84acb6e5f649..c442cc8a48d3d492656a29377cf0746a4194cd2f 100644 --- a/src/Workspaces/CoreTest/ServicesTest.csproj +++ b/src/Workspaces/CoreTest/ServicesTest.csproj @@ -145,5 +145,4 @@ - - \ No newline at end of file + diff --git a/src/Workspaces/VisualBasicTest/VisualBasicServicesTest.vbproj b/src/Workspaces/VisualBasicTest/VisualBasicServicesTest.vbproj index faecb98e1e37a07d1936d4b81ea8641207312068..e58cf9b0fc4180e0e18a9c3cc96377e390539619 100644 --- a/src/Workspaces/VisualBasicTest/VisualBasicServicesTest.vbproj +++ b/src/Workspaces/VisualBasicTest/VisualBasicServicesTest.vbproj @@ -120,5 +120,4 @@ - - \ No newline at end of file +