From 4cb2633b6ecb588a47f790dc2e0922aabd4e5c89 Mon Sep 17 00:00:00 2001 From: duncanp-sonar Date: Wed, 17 Nov 2021 11:07:58 +0000 Subject: [PATCH] Update supported Roslyn version to v4 Fixes #123 * removed manual binding redirects file * added dummy project with conflicting package resfs to force auto-regen of binding directs * enable end-to-end tests for Roslyn v3 and v4 --- PluginGenerator.sln | 10 ++- RoslynPluginGenerator/App.config | 82 ------------------- ...Qube.Plugins.Roslyn.PluginGenerator.csproj | 8 +- RoslynV1Resfs/RoslynV1Refs.csproj | 33 ++++++++ Tests/IntegrationTests/EndToEndTests.cs | 4 +- .../IntegrationTests/IntegrationTests.csproj | 2 +- .../DiagnosticAssemblyScannerTests.cs | 4 +- ...s.Roslyn.RoslynPluginGeneratorTests.csproj | 12 +-- 8 files changed, 53 insertions(+), 102 deletions(-) delete mode 100644 RoslynPluginGenerator/App.config create mode 100644 RoslynV1Resfs/RoslynV1Refs.csproj diff --git a/PluginGenerator.sln b/PluginGenerator.sln index b4b212f..f3e613e 100644 --- a/PluginGenerator.sln +++ b/PluginGenerator.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.0.31815.197 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31613.86 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{AEB50389-D3DD-4EF3-9974-109BC5F20646}" EndProject @@ -38,6 +38,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RoslynAnalyzer333", "Tests\ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RoslynAnalyzer298", "Tests\ExampleAnalyzers\RoslynAnalyzer298\RoslynAnalyzer298.csproj", "{4AD02214-637F-40A7-990E-9EA7FDFCB108}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RoslynV1Refs", "RoslynV1Resfs\RoslynV1Refs.csproj", "{60280BDB-61A9-4FC8-A9A9-62E04BF6644E}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -92,6 +94,10 @@ Global {4AD02214-637F-40A7-990E-9EA7FDFCB108}.Debug|Any CPU.Build.0 = Debug|Any CPU {4AD02214-637F-40A7-990E-9EA7FDFCB108}.Release|Any CPU.ActiveCfg = Release|Any CPU {4AD02214-637F-40A7-990E-9EA7FDFCB108}.Release|Any CPU.Build.0 = Release|Any CPU + {60280BDB-61A9-4FC8-A9A9-62E04BF6644E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {60280BDB-61A9-4FC8-A9A9-62E04BF6644E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {60280BDB-61A9-4FC8-A9A9-62E04BF6644E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {60280BDB-61A9-4FC8-A9A9-62E04BF6644E}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/RoslynPluginGenerator/App.config b/RoslynPluginGenerator/App.config deleted file mode 100644 index 4d36bc7..0000000 --- a/RoslynPluginGenerator/App.config +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/RoslynPluginGenerator/SonarQube.Plugins.Roslyn.PluginGenerator.csproj b/RoslynPluginGenerator/SonarQube.Plugins.Roslyn.PluginGenerator.csproj index 765e2f5..efd8f31 100644 --- a/RoslynPluginGenerator/SonarQube.Plugins.Roslyn.PluginGenerator.csproj +++ b/RoslynPluginGenerator/SonarQube.Plugins.Roslyn.PluginGenerator.csproj @@ -12,15 +12,12 @@ - + + - - - - True @@ -62,6 +59,7 @@ {db16ccfa-b97f-4c5e-a99a-a6062ecf5d98} SonarQube.Plugins.PluginGenerator + diff --git a/RoslynV1Resfs/RoslynV1Refs.csproj b/RoslynV1Resfs/RoslynV1Refs.csproj new file mode 100644 index 0000000..adf0bfd --- /dev/null +++ b/RoslynV1Resfs/RoslynV1Refs.csproj @@ -0,0 +1,33 @@ + + + + + + net48 + + + + + + + + + + + + + + + + + + + diff --git a/Tests/IntegrationTests/EndToEndTests.cs b/Tests/IntegrationTests/EndToEndTests.cs index 3da9e80..2da3765 100644 --- a/Tests/IntegrationTests/EndToEndTests.cs +++ b/Tests/IntegrationTests/EndToEndTests.cs @@ -55,8 +55,8 @@ public async Task Execute_MissingArgs_Fails() [DataRow("RoslynAnalyzer10:1.0.0")] [DataRow("RoslynAnalyzer11:1.0.0")] [DataRow("wintellect.analyzers")] - //[DataRow("RoslynV298")] - //[DataRow("RoslynV333")] + [DataRow("RoslynV298")] + [DataRow("RoslynV333")] public async Task Execute_ExampleAnalyzers_Succeeds(string analyzerArg) { var exeFilePath = GetExeFilePath(); diff --git a/Tests/IntegrationTests/IntegrationTests.csproj b/Tests/IntegrationTests/IntegrationTests.csproj index 3c1225e..1c0de2c 100644 --- a/Tests/IntegrationTests/IntegrationTests.csproj +++ b/Tests/IntegrationTests/IntegrationTests.csproj @@ -17,7 +17,7 @@ - + diff --git a/Tests/RoslynPluginGeneratorTests/DiagnosticAssemblyScannerTests.cs b/Tests/RoslynPluginGeneratorTests/DiagnosticAssemblyScannerTests.cs index cdcd1af..eab1140 100644 --- a/Tests/RoslynPluginGeneratorTests/DiagnosticAssemblyScannerTests.cs +++ b/Tests/RoslynPluginGeneratorTests/DiagnosticAssemblyScannerTests.cs @@ -148,8 +148,8 @@ public void InstantiateDiags_MultipleAssemblies_AnalyzersFound() [TestMethod] [DataRow(typeof(RoslynAnalyzer10.ExampleAnalyzer2), 1)] [DataRow(typeof(RoslynAnalyzer11.CSharpAnalyzer), 3)] - //[DataRow(typeof(RoslynAnalyzer298.RoslynAnalyzer298Analyzer), 1)] - //[DataRow(typeof(RoslynAnalyzer333.RoslynAnalyzer333Analyzer), 1)] + [DataRow(typeof(RoslynAnalyzer298.RoslynAnalyzer298Analyzer), 1)] + [DataRow(typeof(RoslynAnalyzer333.RoslynAnalyzer333Analyzer), 1)] public void InstantiateDiags_DifferentRoslynVersions_AnalyzersFound(Type typeInTargetAssembly, int expectedAnalyzerCount) { // Arrange diff --git a/Tests/RoslynPluginGeneratorTests/SonarQube.Plugins.Roslyn.RoslynPluginGeneratorTests.csproj b/Tests/RoslynPluginGeneratorTests/SonarQube.Plugins.Roslyn.RoslynPluginGeneratorTests.csproj index 46cf94c..c3be681 100644 --- a/Tests/RoslynPluginGeneratorTests/SonarQube.Plugins.Roslyn.RoslynPluginGeneratorTests.csproj +++ b/Tests/RoslynPluginGeneratorTests/SonarQube.Plugins.Roslyn.RoslynPluginGeneratorTests.csproj @@ -7,7 +7,7 @@ - + @@ -19,11 +19,7 @@ - - - + @@ -31,7 +27,7 @@ - + + \ No newline at end of file