From 953ae8e4d2b3e877746775af9e11d0614d3d322b Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Fri, 26 May 2023 16:46:36 -0700 Subject: [PATCH 1/8] Update to latest SDKs and packages --- .github/workflows/build.yml | 6 +++-- .github/workflows/tests-net6.yml | 6 +++-- .github/workflows/tests.yml | 6 +++-- .pipelines/init.yml | 10 ++++++-- build.json | 7 +++--- build/Packages.props | 24 +++++++++---------- global.json | 4 ++-- omnisharp.json | 2 +- src/OmniSharp.Abstractions/Configuration.cs | 2 +- .../ImportCompletionBenchmarks.cs | 2 +- .../OverrideCompletionBenchmarks.cs | 2 +- src/OmniSharp.Benchmarks/Program.cs | 2 +- src/OmniSharp.Http.Driver/app.config | 24 +++++++++---------- .../app.config | 24 +++++++++---------- src/OmniSharp.Script/ScriptContextProvider.cs | 2 +- src/OmniSharp.Stdio.Driver/app.config | 24 +++++++++---------- .../AllowUnsafe/AllowUnsafe.csproj | 2 +- .../CSharp8AndNullableContext.csproj | 2 +- .../App/App.csproj | 2 +- .../Lib1/Lib1.csproj | 2 +- .../Lib2/Lib2.csproj | 2 +- .../ExternAlias.App/ExternAlias.App.csproj | 2 +- .../ExternAlias.App2/ExternAlias.App2.csproj | 2 +- .../test-projects/ExternAlias/global.json | 4 ++-- .../HelloWorldSlim/HelloWorldSlim.csproj | 2 +- .../test-projects/Net60Project/global.json | 4 ++-- .../test-projects/Net70Project/global.json | 4 ++-- .../Net80Project/Net80Project.csproj | 8 +++++++ .../test-projects/Net80Project/Program.cs | 12 ++++++++++ .../test-projects/Net80Project/global.json | 5 ++++ .../NetStandardAndNetCoreApp.csproj | 6 ++--- .../ProjectAndSolution.csproj | 2 +- .../Project/ProjectAndSolutionFilter.csproj | 2 +- .../ProjectAndSolutionWithGlobs.csproj | 2 +- ...rojectAndSolutionWithProjectSection.csproj | 2 +- .../ProjectWithMultiAdditionalFiles.csproj | 2 +- .../ProjectWithNoAdditionalFiles.csproj | 2 +- .../ProjectWithSingleAdditionalFiles.csproj | 2 +- .../ProjectWithAnalyzers.csproj | 2 +- ...ProjectWithAnalyzersAndEditorConfig.csproj | 2 +- .../ConsumingProject/ConsumingProject.csproj | 2 +- .../ProjectWithComplexAnalyzers.csproj | 2 +- .../ProjectWithDisabledAnalyzers.csproj | 2 +- .../ProjectWithDisabledAnalyzers2.csproj | 2 +- .../ProjectWithGeneratedFile.csproj | 14 +++++------ .../ProjectWithMismatchedFileName.csproj | 2 +- .../ProjectWithMissingType.csproj | 2 +- .../ProjectWithMultiTFMLib/App/App.csproj | 2 +- .../ProjectWithMultiTFMLib/Lib/Lib.csproj | 2 +- .../Project/Project.csproj | 2 +- ...ProjectWithWildcardPackageReference.csproj | 2 +- .../App/App.csproj | 2 +- .../TwoProjectsWithSolution/App/App.csproj | 2 +- .../TwoProjectsWithSolution/Lib/Lib.csproj | 2 +- .../App/App.csproj | 4 ++-- .../Lib/Lib.csproj | 4 ++-- .../WarningsAsErrors/WarningsAsErrors.csproj | 2 +- test-assets/test-projects/global.json | 4 ++-- .../DotnetCoreScriptSimple/main.csx | 2 +- .../DotnetCoreScriptWithNuget/main.csx | 2 +- .../ProjectFileInfoTests.cs | 14 +++++------ .../ProjectLoadListenerTests.cs | 18 +++++++++++--- .../WorkspaceInformationTests.cs | 22 ++++++++--------- .../AbstractGoToDefinitionFacts.cs | 2 +- .../CustomRoslynAnalyzerFacts.cs | 2 +- .../FindReferencesFacts.cs | 2 +- .../FindSymbolsFacts.cs | 4 ++-- .../GotoTypeDefinitionFacts.cs | 2 +- .../SourceGeneratorFacts.cs | 2 +- .../WorkspaceInformationTests.cs | 2 +- .../OmniSharp.Tests/DotNetCliServiceFacts.cs | 2 +- tests/app.config | 24 +++++++++---------- 72 files changed, 214 insertions(+), 164 deletions(-) create mode 100644 test-assets/test-projects/Net80Project/Net80Project.csproj create mode 100644 test-assets/test-projects/Net80Project/Program.cs create mode 100644 test-assets/test-projects/Net80Project/global.json diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 71c5636ece..c9cae05b16 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,8 +1,9 @@ name: 'Build' env: - DotNetVersion: "7.0.100-rc.1.22431.12" - DotNetVersion2: "6.0.202" + DotNetVersion: "8.0.100-preview.4.23260.5" + DotNetVersion2: "7.0.302" + DotNetVersion3: "6.0.408" NuGetVersion: "5.7.0" MonoVersion: "6.12.0" Artifacts: ${{ github.workspace }}/artifacts/ @@ -53,6 +54,7 @@ jobs: uses: actions/setup-dotnet@v3 with: dotnet-version: | + ${{ env.DotNetVersion3 }} ${{ env.DotNetVersion2 }} ${{ env.DotNetVersion }} diff --git a/.github/workflows/tests-net6.yml b/.github/workflows/tests-net6.yml index 82d5ec043c..694d303209 100644 --- a/.github/workflows/tests-net6.yml +++ b/.github/workflows/tests-net6.yml @@ -1,8 +1,9 @@ name: 'Tests net6.0' env: - DotNetVersion: "7.0.100-rc.1.22431.12" - DotNetVersion2: "6.0.202" + DotNetVersion: "8.0.100-preview.4.23260.5" + DotNetVersion2: "7.0.302" + DotNetVersion3: "6.0.408" NuGetVersion: "5.7.0" MonoVersion: "6.12.0" Artifacts: ${{ github.workspace }}/artifacts/ @@ -57,6 +58,7 @@ jobs: uses: actions/setup-dotnet@v3 with: dotnet-version: | + ${{ env.DotNetVersion3 }} ${{ env.DotNetVersion2 }} ${{ env.DotNetVersion }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8c4713ec0b..596d768bcc 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,8 +1,9 @@ name: 'Tests' env: - DotNetVersion: "7.0.100-rc.1.22431.12" - DotNetVersion2: "6.0.202" + DotNetVersion: "8.0.100-preview.4.23260.5" + DotNetVersion2: "7.0.302" + DotNetVersion3: "6.0.408" NuGetVersion: "5.7.0" MonoVersion: "6.12.0" Artifacts: ${{ github.workspace }}/artifacts/ @@ -54,6 +55,7 @@ jobs: uses: actions/setup-dotnet@v3 with: dotnet-version: | + ${{ env.DotNetVersion3 }} ${{ env.DotNetVersion2 }} ${{ env.DotNetVersion }} diff --git a/.pipelines/init.yml b/.pipelines/init.yml index c4f9dc1a69..c44370684a 100644 --- a/.pipelines/init.yml +++ b/.pipelines/init.yml @@ -1,8 +1,9 @@ parameters: # Configuration: Release Verbosity: Normal - DotNetVersion: "7.0.100-rc.1.22431.12" - DotNetVersion2: "6.0.202" + DotNetVersion: "8.0.100-preview.4.23260.5" + DotNetVersion2: "7.0.302" + DotNetVersion3: "6.0.408" CakeVersion: "1.1.0" NuGetVersion: "5.7.0" MonoVersion: '' @@ -29,6 +30,11 @@ steps: inputs: packageType: 'sdk' version: ${{ parameters.DotNetVersion2 }} + - task: UseDotNet@2 + displayName: Install dotnet $(DotNetVersion3) + inputs: + packageType: 'sdk' + version: ${{ parameters.DotNetVersion3 }} - task: DotNetCoreCLI@2 displayName: 'dotnet install cake' inputs: diff --git a/build.json b/build.json index 7036a21842..1ac8d1d07a 100644 --- a/build.json +++ b/build.json @@ -2,8 +2,9 @@ "DotNetInstallScriptURL": "https://dot.net/v1", "DotNetChannel": "Preview", "DotNetVersions": [ - "6.0.202", - "7.0.100-rc.1.22431.12" + "6.0.408", + "7.0.302", + "8.0.100-preview.4.23260.5" ], "RequiredMonoVersion": "6.6.0", "DownloadURL": "https://roslynomnisharp.blob.core.windows.net/ext", @@ -53,4 +54,4 @@ "RestoreOnlyTestAssets": [ "ProjectWithMissingType" ] -} +} \ No newline at end of file diff --git a/build/Packages.props b/build/Packages.props index 20d612e7e5..0d41fcd38e 100644 --- a/build/Packages.props +++ b/build/Packages.props @@ -2,11 +2,11 @@ - 6.0.0 - 17.4.1 - 17.3.1 - 6.4.0-preview.1.53 - 4.6.0-3.23153.5 + 7.0.0 + 17.6.0 + 17.6.3 + 6.7.0-preview.1.20 + 4.7.0-2.23225.15 2.4.1 @@ -65,7 +65,7 @@ - + @@ -82,13 +82,13 @@ - - - - + + + + - - + + diff --git a/global.json b/global.json index 0e4bf1e91e..106562d795 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "7.0.100-rc.1.22431.12", + "version": "8.0.100-preview.4.23260.5", "rollForward": "patch" } -} +} \ No newline at end of file diff --git a/omnisharp.json b/omnisharp.json index adc812a53f..c2ae26ad95 100644 --- a/omnisharp.json +++ b/omnisharp.json @@ -1,7 +1,7 @@ { "script": { "enableScriptNuGetReferences": true, - "defaultTargetFramework": "netcoreapp3.1" + "defaultTargetFramework": "net6.0" }, "FormattingOptions": { "enableEditorConfigSupport": true diff --git a/src/OmniSharp.Abstractions/Configuration.cs b/src/OmniSharp.Abstractions/Configuration.cs index bbf725618c..8e3fe1cb76 100644 --- a/src/OmniSharp.Abstractions/Configuration.cs +++ b/src/OmniSharp.Abstractions/Configuration.cs @@ -4,7 +4,7 @@ internal static class Configuration { public static bool ZeroBasedIndices = false; - public const string RoslynVersion = "4.6.0.0"; + public const string RoslynVersion = "4.7.0.0"; public const string RoslynPublicKeyToken = "31bf3856ad364e35"; public readonly static string RoslynFeatures = GetRoslynAssemblyFullName("Microsoft.CodeAnalysis.Features"); diff --git a/src/OmniSharp.Benchmarks/ImportCompletionBenchmarks.cs b/src/OmniSharp.Benchmarks/ImportCompletionBenchmarks.cs index 638e644ba4..d7390a9afb 100644 --- a/src/OmniSharp.Benchmarks/ImportCompletionBenchmarks.cs +++ b/src/OmniSharp.Benchmarks/ImportCompletionBenchmarks.cs @@ -18,7 +18,7 @@ public class ImportCompletionBenchmarks : HostBase [GlobalSetup] public async Task SetupAsync() { - Setup(new KeyValuePair("RoslynExtensionsOptions:EnableImportCompletion", "true")); + Setup(new KeyValuePair("RoslynExtensionsOptions:EnableImportCompletion", "true")); var builder = new StringBuilder(); diff --git a/src/OmniSharp.Benchmarks/OverrideCompletionBenchmarks.cs b/src/OmniSharp.Benchmarks/OverrideCompletionBenchmarks.cs index e1ae47d0ce..a8f1afffcb 100644 --- a/src/OmniSharp.Benchmarks/OverrideCompletionBenchmarks.cs +++ b/src/OmniSharp.Benchmarks/OverrideCompletionBenchmarks.cs @@ -20,7 +20,7 @@ public class OverrideCompletionBenchmarks : HostBase [GlobalSetup] public async Task SetupAsync() { - Setup(new KeyValuePair( "RoslynExtensionsOptions:EnableImportCompletion", "true" )); + Setup(new KeyValuePair("RoslynExtensionsOptions:EnableImportCompletion", "true")); var builder = new StringBuilder(); diff --git a/src/OmniSharp.Benchmarks/Program.cs b/src/OmniSharp.Benchmarks/Program.cs index 6cd57b00d1..55f39e97aa 100644 --- a/src/OmniSharp.Benchmarks/Program.cs +++ b/src/OmniSharp.Benchmarks/Program.cs @@ -18,7 +18,7 @@ protected override void DisposeCore(bool disposing) OmniSharpTestHost.Dispose(); } - public void Setup(params KeyValuePair[]? configuration) + public void Setup(params KeyValuePair[]? configuration) { var builder = new Microsoft.Extensions.Configuration.ConfigurationBuilder().AddInMemoryCollection(configuration); OmniSharpTestHost = OmniSharpTestHost.Create(configurationData: builder.Build()); diff --git a/src/OmniSharp.Http.Driver/app.config b/src/OmniSharp.Http.Driver/app.config index 4db76b59d6..0b3bb5d325 100644 --- a/src/OmniSharp.Http.Driver/app.config +++ b/src/OmniSharp.Http.Driver/app.config @@ -7,35 +7,35 @@ - + - + - + - + - + - + - + - + @@ -56,19 +56,19 @@ - + - + - + - + diff --git a/src/OmniSharp.LanguageServerProtocol/app.config b/src/OmniSharp.LanguageServerProtocol/app.config index cf6a6217d0..2209f6ebac 100644 --- a/src/OmniSharp.LanguageServerProtocol/app.config +++ b/src/OmniSharp.LanguageServerProtocol/app.config @@ -7,35 +7,35 @@ - + - + - + - + - + - + - + - + @@ -56,19 +56,19 @@ - + - + - + - + diff --git a/src/OmniSharp.Script/ScriptContextProvider.cs b/src/OmniSharp.Script/ScriptContextProvider.cs index f4ae9e61b6..d11f01e93c 100644 --- a/src/OmniSharp.Script/ScriptContextProvider.cs +++ b/src/OmniSharp.Script/ScriptContextProvider.cs @@ -90,7 +90,7 @@ public ScriptContext CreateScriptContext(ScriptOptions scriptOptions, string[] a } catch (Exception e) { - _logger.LogError("Failed to resolve compilation dependencies", e); + _logger.LogError(e, "Failed to resolve compilation dependencies"); compilationDependencies = Array.Empty(); } diff --git a/src/OmniSharp.Stdio.Driver/app.config b/src/OmniSharp.Stdio.Driver/app.config index 4db76b59d6..0b3bb5d325 100644 --- a/src/OmniSharp.Stdio.Driver/app.config +++ b/src/OmniSharp.Stdio.Driver/app.config @@ -7,35 +7,35 @@ - + - + - + - + - + - + - + - + @@ -56,19 +56,19 @@ - + - + - + - + diff --git a/test-assets/test-projects/AllowUnsafe/AllowUnsafe.csproj b/test-assets/test-projects/AllowUnsafe/AllowUnsafe.csproj index f1d7d7ab98..cbe281e9f4 100644 --- a/test-assets/test-projects/AllowUnsafe/AllowUnsafe.csproj +++ b/test-assets/test-projects/AllowUnsafe/AllowUnsafe.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net6.0 true diff --git a/test-assets/test-projects/CSharp8AndNullableContext/CSharp8AndNullableContext.csproj b/test-assets/test-projects/CSharp8AndNullableContext/CSharp8AndNullableContext.csproj index acf7852d50..4bd0ed5470 100644 --- a/test-assets/test-projects/CSharp8AndNullableContext/CSharp8AndNullableContext.csproj +++ b/test-assets/test-projects/CSharp8AndNullableContext/CSharp8AndNullableContext.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net6.0 8.0 enable diff --git a/test-assets/test-projects/DeepProjectTransitiveReference/App/App.csproj b/test-assets/test-projects/DeepProjectTransitiveReference/App/App.csproj index 63dddac66e..18edc0929f 100644 --- a/test-assets/test-projects/DeepProjectTransitiveReference/App/App.csproj +++ b/test-assets/test-projects/DeepProjectTransitiveReference/App/App.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net6.0 diff --git a/test-assets/test-projects/DeepProjectTransitiveReference/Lib1/Lib1.csproj b/test-assets/test-projects/DeepProjectTransitiveReference/Lib1/Lib1.csproj index 8b93623e25..6a703b54da 100644 --- a/test-assets/test-projects/DeepProjectTransitiveReference/Lib1/Lib1.csproj +++ b/test-assets/test-projects/DeepProjectTransitiveReference/Lib1/Lib1.csproj @@ -1,7 +1,7 @@ - netstandard1.3 + netstandard2.0 diff --git a/test-assets/test-projects/DeepProjectTransitiveReference/Lib2/Lib2.csproj b/test-assets/test-projects/DeepProjectTransitiveReference/Lib2/Lib2.csproj index b81db56b71..9f5c4f4abb 100644 --- a/test-assets/test-projects/DeepProjectTransitiveReference/Lib2/Lib2.csproj +++ b/test-assets/test-projects/DeepProjectTransitiveReference/Lib2/Lib2.csproj @@ -1,7 +1,7 @@ - netstandard1.3 + netstandard2.0 diff --git a/test-assets/test-projects/ExternAlias/ExternAlias.App/ExternAlias.App.csproj b/test-assets/test-projects/ExternAlias/ExternAlias.App/ExternAlias.App.csproj index a18c438aaa..0735b3d98c 100644 --- a/test-assets/test-projects/ExternAlias/ExternAlias.App/ExternAlias.App.csproj +++ b/test-assets/test-projects/ExternAlias/ExternAlias.App/ExternAlias.App.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net6.0 diff --git a/test-assets/test-projects/ExternAlias/ExternAlias.App2/ExternAlias.App2.csproj b/test-assets/test-projects/ExternAlias/ExternAlias.App2/ExternAlias.App2.csproj index 131a422446..a5308c1347 100644 --- a/test-assets/test-projects/ExternAlias/ExternAlias.App2/ExternAlias.App2.csproj +++ b/test-assets/test-projects/ExternAlias/ExternAlias.App2/ExternAlias.App2.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net6.0 ExternAlias.App diff --git a/test-assets/test-projects/ExternAlias/global.json b/test-assets/test-projects/ExternAlias/global.json index 50e1aed9e7..16a59b4002 100644 --- a/test-assets/test-projects/ExternAlias/global.json +++ b/test-assets/test-projects/ExternAlias/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "6.0.202" + "version": "6.0.408" } -} +} \ No newline at end of file diff --git a/test-assets/test-projects/HelloWorldSlim/HelloWorldSlim.csproj b/test-assets/test-projects/HelloWorldSlim/HelloWorldSlim.csproj index 96868b4f13..adbde6e061 100644 --- a/test-assets/test-projects/HelloWorldSlim/HelloWorldSlim.csproj +++ b/test-assets/test-projects/HelloWorldSlim/HelloWorldSlim.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net6.0 \ No newline at end of file diff --git a/test-assets/test-projects/Net60Project/global.json b/test-assets/test-projects/Net60Project/global.json index 50e1aed9e7..16a59b4002 100644 --- a/test-assets/test-projects/Net60Project/global.json +++ b/test-assets/test-projects/Net60Project/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "6.0.202" + "version": "6.0.408" } -} +} \ No newline at end of file diff --git a/test-assets/test-projects/Net70Project/global.json b/test-assets/test-projects/Net70Project/global.json index 5ea7808c65..e7a6251dc2 100644 --- a/test-assets/test-projects/Net70Project/global.json +++ b/test-assets/test-projects/Net70Project/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "7.0.100-rc.1.22431.12" + "version": "7.0.302" } -} +} \ No newline at end of file diff --git a/test-assets/test-projects/Net80Project/Net80Project.csproj b/test-assets/test-projects/Net80Project/Net80Project.csproj new file mode 100644 index 0000000000..a269962b55 --- /dev/null +++ b/test-assets/test-projects/Net80Project/Net80Project.csproj @@ -0,0 +1,8 @@ + + + + Exe + net8.0 + + + diff --git a/test-assets/test-projects/Net80Project/Program.cs b/test-assets/test-projects/Net80Project/Program.cs new file mode 100644 index 0000000000..dbae8113d5 --- /dev/null +++ b/test-assets/test-projects/Net80Project/Program.cs @@ -0,0 +1,12 @@ +ο»Ώusing System; + +namespace ProjectAndSolution +{ + class Program + { + static void Main(string[] args) + { + Console.WriteLine("Hello World!"); + } + } +} diff --git a/test-assets/test-projects/Net80Project/global.json b/test-assets/test-projects/Net80Project/global.json new file mode 100644 index 0000000000..49e7f1ad73 --- /dev/null +++ b/test-assets/test-projects/Net80Project/global.json @@ -0,0 +1,5 @@ +{ + "sdk": { + "version": "8.0.100-preview.4.23260.5" + } +} \ No newline at end of file diff --git a/test-assets/test-projects/NetStandardAndNetCoreApp/NetStandardAndNetCoreApp.csproj b/test-assets/test-projects/NetStandardAndNetCoreApp/NetStandardAndNetCoreApp.csproj index a05cf6d3b9..9c51a7030d 100644 --- a/test-assets/test-projects/NetStandardAndNetCoreApp/NetStandardAndNetCoreApp.csproj +++ b/test-assets/test-projects/NetStandardAndNetCoreApp/NetStandardAndNetCoreApp.csproj @@ -1,15 +1,15 @@ - netcoreapp3.1;netstandard1.5 + net6.0;netstandard1.5 - + exe NETCOREAPP;$(DefineConstants) - + 13.0.1 diff --git a/test-assets/test-projects/ProjectAndSolution/ProjectAndSolution.csproj b/test-assets/test-projects/ProjectAndSolution/ProjectAndSolution.csproj index c73e0d1692..41f1d5ad4b 100644 --- a/test-assets/test-projects/ProjectAndSolution/ProjectAndSolution.csproj +++ b/test-assets/test-projects/ProjectAndSolution/ProjectAndSolution.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net6.0 diff --git a/test-assets/test-projects/ProjectAndSolutionFilter/Project/ProjectAndSolutionFilter.csproj b/test-assets/test-projects/ProjectAndSolutionFilter/Project/ProjectAndSolutionFilter.csproj index c73e0d1692..41f1d5ad4b 100644 --- a/test-assets/test-projects/ProjectAndSolutionFilter/Project/ProjectAndSolutionFilter.csproj +++ b/test-assets/test-projects/ProjectAndSolutionFilter/Project/ProjectAndSolutionFilter.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net6.0 diff --git a/test-assets/test-projects/ProjectAndSolutionWithGlobs/ProjectAndSolutionWithGlobs.csproj b/test-assets/test-projects/ProjectAndSolutionWithGlobs/ProjectAndSolutionWithGlobs.csproj index b92f0c19a3..679654eccd 100644 --- a/test-assets/test-projects/ProjectAndSolutionWithGlobs/ProjectAndSolutionWithGlobs.csproj +++ b/test-assets/test-projects/ProjectAndSolutionWithGlobs/ProjectAndSolutionWithGlobs.csproj @@ -1,7 +1,7 @@ Exe - netcoreapp3.1 + net6.0 diff --git a/test-assets/test-projects/ProjectAndSolutionWithProjectSection/ProjectAndSolutionWithProjectSection.csproj b/test-assets/test-projects/ProjectAndSolutionWithProjectSection/ProjectAndSolutionWithProjectSection.csproj index c73e0d1692..41f1d5ad4b 100644 --- a/test-assets/test-projects/ProjectAndSolutionWithProjectSection/ProjectAndSolutionWithProjectSection.csproj +++ b/test-assets/test-projects/ProjectAndSolutionWithProjectSection/ProjectAndSolutionWithProjectSection.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net6.0 diff --git a/test-assets/test-projects/ProjectWithAdditionalFiles/ProjectWithMultiAdditionalFiles.csproj b/test-assets/test-projects/ProjectWithAdditionalFiles/ProjectWithMultiAdditionalFiles.csproj index 1137d827f9..d482e9e333 100644 --- a/test-assets/test-projects/ProjectWithAdditionalFiles/ProjectWithMultiAdditionalFiles.csproj +++ b/test-assets/test-projects/ProjectWithAdditionalFiles/ProjectWithMultiAdditionalFiles.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net6.0 7.1 diff --git a/test-assets/test-projects/ProjectWithAdditionalFiles/ProjectWithNoAdditionalFiles.csproj b/test-assets/test-projects/ProjectWithAdditionalFiles/ProjectWithNoAdditionalFiles.csproj index ce6a6cbf4f..268c222bfb 100644 --- a/test-assets/test-projects/ProjectWithAdditionalFiles/ProjectWithNoAdditionalFiles.csproj +++ b/test-assets/test-projects/ProjectWithAdditionalFiles/ProjectWithNoAdditionalFiles.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net6.0 7.1 diff --git a/test-assets/test-projects/ProjectWithAdditionalFiles/ProjectWithSingleAdditionalFiles.csproj b/test-assets/test-projects/ProjectWithAdditionalFiles/ProjectWithSingleAdditionalFiles.csproj index 550f4c0290..39c656612e 100644 --- a/test-assets/test-projects/ProjectWithAdditionalFiles/ProjectWithSingleAdditionalFiles.csproj +++ b/test-assets/test-projects/ProjectWithAdditionalFiles/ProjectWithSingleAdditionalFiles.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net6.0 7.1 diff --git a/test-assets/test-projects/ProjectWithAnalyzers/ProjectWithAnalyzers.csproj b/test-assets/test-projects/ProjectWithAnalyzers/ProjectWithAnalyzers.csproj index b77a5e741d..761dbf3956 100644 --- a/test-assets/test-projects/ProjectWithAnalyzers/ProjectWithAnalyzers.csproj +++ b/test-assets/test-projects/ProjectWithAnalyzers/ProjectWithAnalyzers.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net6.0 7.1 default.ruleset ./nugets/ diff --git a/test-assets/test-projects/ProjectWithAnalyzersAndEditorConfig/ProjectWithAnalyzersAndEditorConfig.csproj b/test-assets/test-projects/ProjectWithAnalyzersAndEditorConfig/ProjectWithAnalyzersAndEditorConfig.csproj index 08de1c9281..348e3991b5 100644 --- a/test-assets/test-projects/ProjectWithAnalyzersAndEditorConfig/ProjectWithAnalyzersAndEditorConfig.csproj +++ b/test-assets/test-projects/ProjectWithAnalyzersAndEditorConfig/ProjectWithAnalyzersAndEditorConfig.csproj @@ -1,7 +1,7 @@ Exe - netcoreapp3.1 + net6.0 7.1 diff --git a/test-assets/test-projects/ProjectWithAnalyzersFromReference/ConsumingProject/ConsumingProject.csproj b/test-assets/test-projects/ProjectWithAnalyzersFromReference/ConsumingProject/ConsumingProject.csproj index 92621e3e96..690dc14adc 100644 --- a/test-assets/test-projects/ProjectWithAnalyzersFromReference/ConsumingProject/ConsumingProject.csproj +++ b/test-assets/test-projects/ProjectWithAnalyzersFromReference/ConsumingProject/ConsumingProject.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net6.0 diff --git a/test-assets/test-projects/ProjectWithComplexAnalyzers/ProjectWithComplexAnalyzers.csproj b/test-assets/test-projects/ProjectWithComplexAnalyzers/ProjectWithComplexAnalyzers.csproj index 55b7899436..97647f21c6 100644 --- a/test-assets/test-projects/ProjectWithComplexAnalyzers/ProjectWithComplexAnalyzers.csproj +++ b/test-assets/test-projects/ProjectWithComplexAnalyzers/ProjectWithComplexAnalyzers.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net6.0 ./nugets/ diff --git a/test-assets/test-projects/ProjectWithDisabledAnalyzers/ProjectWithDisabledAnalyzers.csproj b/test-assets/test-projects/ProjectWithDisabledAnalyzers/ProjectWithDisabledAnalyzers.csproj index 000d145d15..a8ad2b9779 100644 --- a/test-assets/test-projects/ProjectWithDisabledAnalyzers/ProjectWithDisabledAnalyzers.csproj +++ b/test-assets/test-projects/ProjectWithDisabledAnalyzers/ProjectWithDisabledAnalyzers.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net6.0 ./nugets/ false diff --git a/test-assets/test-projects/ProjectWithDisabledAnalyzers2/ProjectWithDisabledAnalyzers2.csproj b/test-assets/test-projects/ProjectWithDisabledAnalyzers2/ProjectWithDisabledAnalyzers2.csproj index ff74b1a67d..4c61d94cf4 100644 --- a/test-assets/test-projects/ProjectWithDisabledAnalyzers2/ProjectWithDisabledAnalyzers2.csproj +++ b/test-assets/test-projects/ProjectWithDisabledAnalyzers2/ProjectWithDisabledAnalyzers2.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net6.0 ./nugets/ false diff --git a/test-assets/test-projects/ProjectWithGeneratedFile/ProjectWithGeneratedFile.csproj b/test-assets/test-projects/ProjectWithGeneratedFile/ProjectWithGeneratedFile.csproj index f90860ac07..5946c9e344 100755 --- a/test-assets/test-projects/ProjectWithGeneratedFile/ProjectWithGeneratedFile.csproj +++ b/test-assets/test-projects/ProjectWithGeneratedFile/ProjectWithGeneratedFile.csproj @@ -4,30 +4,30 @@ MSBuild:CompileGeneratedFiles - - - + + - + Exe - netcoreapp3.1 + net6.0 diff --git a/test-assets/test-projects/ProjectWithMismatchedFileName/ProjectWithMismatchedFileName.csproj b/test-assets/test-projects/ProjectWithMismatchedFileName/ProjectWithMismatchedFileName.csproj index c73e0d1692..41f1d5ad4b 100644 --- a/test-assets/test-projects/ProjectWithMismatchedFileName/ProjectWithMismatchedFileName.csproj +++ b/test-assets/test-projects/ProjectWithMismatchedFileName/ProjectWithMismatchedFileName.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net6.0 diff --git a/test-assets/test-projects/ProjectWithMissingType/ProjectWithMissingType.csproj b/test-assets/test-projects/ProjectWithMissingType/ProjectWithMissingType.csproj index 488f691671..901ab23c3f 100644 --- a/test-assets/test-projects/ProjectWithMissingType/ProjectWithMissingType.csproj +++ b/test-assets/test-projects/ProjectWithMissingType/ProjectWithMissingType.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net6.0 diff --git a/test-assets/test-projects/ProjectWithMultiTFMLib/App/App.csproj b/test-assets/test-projects/ProjectWithMultiTFMLib/App/App.csproj index 73d5163d32..117060789f 100644 --- a/test-assets/test-projects/ProjectWithMultiTFMLib/App/App.csproj +++ b/test-assets/test-projects/ProjectWithMultiTFMLib/App/App.csproj @@ -6,7 +6,7 @@ Exe - netcoreapp3.1 + net6.0 diff --git a/test-assets/test-projects/ProjectWithMultiTFMLib/Lib/Lib.csproj b/test-assets/test-projects/ProjectWithMultiTFMLib/Lib/Lib.csproj index 895941aa5f..12a2c056c6 100644 --- a/test-assets/test-projects/ProjectWithMultiTFMLib/Lib/Lib.csproj +++ b/test-assets/test-projects/ProjectWithMultiTFMLib/Lib/Lib.csproj @@ -1,7 +1,7 @@ - netstandard1.3;netstandard2.0 + netstandard1.5;netstandard2.0 diff --git a/test-assets/test-projects/ProjectWithParentEditorConfig/Project/Project.csproj b/test-assets/test-projects/ProjectWithParentEditorConfig/Project/Project.csproj index 08de1c9281..348e3991b5 100644 --- a/test-assets/test-projects/ProjectWithParentEditorConfig/Project/Project.csproj +++ b/test-assets/test-projects/ProjectWithParentEditorConfig/Project/Project.csproj @@ -1,7 +1,7 @@ Exe - netcoreapp3.1 + net6.0 7.1 diff --git a/test-assets/test-projects/ProjectWithWildcardPackageReference/ProjectWithWildcardPackageReference.csproj b/test-assets/test-projects/ProjectWithWildcardPackageReference/ProjectWithWildcardPackageReference.csproj index e6ad3d2a97..7f59cc13e3 100644 --- a/test-assets/test-projects/ProjectWithWildcardPackageReference/ProjectWithWildcardPackageReference.csproj +++ b/test-assets/test-projects/ProjectWithWildcardPackageReference/ProjectWithWildcardPackageReference.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net6.0 test_wildcard diff --git a/test-assets/test-projects/TwoProjectsWithAnalyzerSuppressor/App/App.csproj b/test-assets/test-projects/TwoProjectsWithAnalyzerSuppressor/App/App.csproj index 5757a5c6b8..1f166dea97 100644 --- a/test-assets/test-projects/TwoProjectsWithAnalyzerSuppressor/App/App.csproj +++ b/test-assets/test-projects/TwoProjectsWithAnalyzerSuppressor/App/App.csproj @@ -1,7 +1,7 @@ Exe - netcoreapp3.1 + net6.0 diff --git a/test-assets/test-projects/TwoProjectsWithSolution/App/App.csproj b/test-assets/test-projects/TwoProjectsWithSolution/App/App.csproj index 73d5163d32..117060789f 100644 --- a/test-assets/test-projects/TwoProjectsWithSolution/App/App.csproj +++ b/test-assets/test-projects/TwoProjectsWithSolution/App/App.csproj @@ -6,7 +6,7 @@ Exe - netcoreapp3.1 + net6.0 diff --git a/test-assets/test-projects/TwoProjectsWithSolution/Lib/Lib.csproj b/test-assets/test-projects/TwoProjectsWithSolution/Lib/Lib.csproj index b81db56b71..9f5c4f4abb 100644 --- a/test-assets/test-projects/TwoProjectsWithSolution/Lib/Lib.csproj +++ b/test-assets/test-projects/TwoProjectsWithSolution/Lib/Lib.csproj @@ -1,7 +1,7 @@ - netstandard1.3 + netstandard2.0 diff --git a/test-assets/test-projects/TwoProjectsWithSolutionAndCustomConfigurations/App/App.csproj b/test-assets/test-projects/TwoProjectsWithSolutionAndCustomConfigurations/App/App.csproj index 4ab768dec6..ad1eb14348 100644 --- a/test-assets/test-projects/TwoProjectsWithSolutionAndCustomConfigurations/App/App.csproj +++ b/test-assets/test-projects/TwoProjectsWithSolutionAndCustomConfigurations/App/App.csproj @@ -10,12 +10,12 @@ Exe - netcoreapp3.1 + net6.0 Exe - netcoreapp3.1 + net6.0 diff --git a/test-assets/test-projects/TwoProjectsWithSolutionAndCustomConfigurations/Lib/Lib.csproj b/test-assets/test-projects/TwoProjectsWithSolutionAndCustomConfigurations/Lib/Lib.csproj index 913be0853e..741cd330c9 100644 --- a/test-assets/test-projects/TwoProjectsWithSolutionAndCustomConfigurations/Lib/Lib.csproj +++ b/test-assets/test-projects/TwoProjectsWithSolutionAndCustomConfigurations/Lib/Lib.csproj @@ -5,11 +5,11 @@ - netstandard1.3 + netstandard2.0 - netstandard1.3 + netstandard2.0 diff --git a/test-assets/test-projects/WarningsAsErrors/WarningsAsErrors.csproj b/test-assets/test-projects/WarningsAsErrors/WarningsAsErrors.csproj index ef9cd6d52b..9400d0ae00 100644 --- a/test-assets/test-projects/WarningsAsErrors/WarningsAsErrors.csproj +++ b/test-assets/test-projects/WarningsAsErrors/WarningsAsErrors.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net6.0 CS7081 nullable,CS1998,CS7080,CS7081 CS7080,CS7082 diff --git a/test-assets/test-projects/global.json b/test-assets/test-projects/global.json index 50e1aed9e7..16a59b4002 100644 --- a/test-assets/test-projects/global.json +++ b/test-assets/test-projects/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "6.0.202" + "version": "6.0.408" } -} +} \ No newline at end of file diff --git a/test-assets/test-scripts/DotnetCoreScriptSimple/main.csx b/test-assets/test-scripts/DotnetCoreScriptSimple/main.csx index 69aa55ae07..cff79afb32 100644 --- a/test-assets/test-scripts/DotnetCoreScriptSimple/main.csx +++ b/test-assets/test-scripts/DotnetCoreScriptSimple/main.csx @@ -1,2 +1,2 @@ -#! "netcoreapp3.1" +#! "net6.0" Console.WriteLine("Hello world!"); diff --git a/test-assets/test-scripts/DotnetCoreScriptWithNuget/main.csx b/test-assets/test-scripts/DotnetCoreScriptWithNuget/main.csx index 1967fcf721..500ade5dc1 100644 --- a/test-assets/test-scripts/DotnetCoreScriptWithNuget/main.csx +++ b/test-assets/test-scripts/DotnetCoreScriptWithNuget/main.csx @@ -1,4 +1,4 @@ -#! "netcoreapp3.1" +#! "net6.0" #r "nuget: Newtonsoft.Json,11.0.2" using Newtonsoft.Json; diff --git a/tests/OmniSharp.MSBuild.Tests/ProjectFileInfoTests.cs b/tests/OmniSharp.MSBuild.Tests/ProjectFileInfoTests.cs index 7b202ffb08..be2e656541 100644 --- a/tests/OmniSharp.MSBuild.Tests/ProjectFileInfoTests.cs +++ b/tests/OmniSharp.MSBuild.Tests/ProjectFileInfoTests.cs @@ -85,9 +85,9 @@ public async Task HelloWorldSlim_has_correct_property_values() Assert.NotNull(projectFileInfo); Assert.Equal(projectFilePath, projectFileInfo.FilePath); var targetFramework = Assert.Single(projectFileInfo.TargetFrameworks); - Assert.Equal("netcoreapp3.1", targetFramework); - Assert.Equal("bin/Debug/netcoreapp3.1/", projectFileInfo.OutputPath.EnsureForwardSlashes()); - Assert.Equal("obj/Debug/netcoreapp3.1/", projectFileInfo.IntermediateOutputPath.EnsureForwardSlashes()); + Assert.Equal("net6.0", targetFramework); + Assert.Equal("bin/Debug/net6.0/", projectFileInfo.OutputPath.EnsureForwardSlashes()); + Assert.Equal("obj/Debug/net6.0/", projectFileInfo.IntermediateOutputPath.EnsureForwardSlashes()); Assert.Equal(3, projectFileInfo.SourceFiles.Length); // Program.cs, AssemblyInfo.cs, AssemblyAttributes.cs Assert.Equal("Debug", projectFileInfo.Configuration); Assert.Equal("AnyCPU", projectFileInfo.Platform); @@ -112,10 +112,10 @@ public async Task NetStandardAndNetCoreApp_has_correct_property_values() Assert.NotNull(projectFileInfo); Assert.Equal(projectFilePath, projectFileInfo.FilePath); Assert.Equal(2, projectFileInfo.TargetFrameworks.Length); - Assert.Equal("netcoreapp3.1", projectFileInfo.TargetFrameworks[0]); + Assert.Equal("net6.0", projectFileInfo.TargetFrameworks[0]); Assert.Equal("netstandard1.5", projectFileInfo.TargetFrameworks[1]); - Assert.Equal("bin/Debug/netcoreapp3.1/", projectFileInfo.OutputPath.EnsureForwardSlashes()); - Assert.Equal("obj/Debug/netcoreapp3.1/", projectFileInfo.IntermediateOutputPath.EnsureForwardSlashes()); + Assert.Equal("bin/Debug/net6.0/", projectFileInfo.OutputPath.EnsureForwardSlashes()); + Assert.Equal("obj/Debug/net6.0/", projectFileInfo.IntermediateOutputPath.EnsureForwardSlashes()); Assert.Equal(3, projectFileInfo.SourceFiles.Length); // Program.cs, AssemblyInfo.cs, AssemblyAttributes.cs Assert.Equal("Debug", projectFileInfo.Configuration); Assert.Equal("AnyCPU", projectFileInfo.Platform); @@ -134,7 +134,7 @@ public async Task CSharp8AndNullableContext_has_correct_property_values() Assert.NotNull(projectFileInfo); Assert.Equal(projectFilePath, projectFileInfo.FilePath); var targetFramework = Assert.Single(projectFileInfo.TargetFrameworks); - Assert.Equal("netcoreapp3.1", targetFramework); + Assert.Equal("net6.0", targetFramework); Assert.Equal(LanguageVersion.CSharp8, projectFileInfo.LanguageVersion); Assert.Equal(NullableContextOptions.Enable, projectFileInfo.NullableContextOptions); Assert.Equal("Debug", projectFileInfo.Configuration); diff --git a/tests/OmniSharp.MSBuild.Tests/ProjectLoadListenerTests.cs b/tests/OmniSharp.MSBuild.Tests/ProjectLoadListenerTests.cs index d414f7c760..2feea8e9c4 100644 --- a/tests/OmniSharp.MSBuild.Tests/ProjectLoadListenerTests.cs +++ b/tests/OmniSharp.MSBuild.Tests/ProjectLoadListenerTests.cs @@ -150,7 +150,7 @@ public async Task If_there_are_multiple_target_frameworks_they_are_emitted() Assert.Single(emitter.ReceivedMessages); var tfm = emitter.ReceivedMessages[0].TargetFrameworks.ToArray(); Assert.Equal(2, tfm.Count()); - Assert.Equal("netstandard1.3", tfm[0]); + Assert.Equal("netstandard2.0", tfm[0]); Assert.Equal("netstandard2.0", tfm[1]); } @@ -220,7 +220,7 @@ public async Task The_correct_sdk_version_is_emitted_NET6() using var testProject = await TestAssets.Instance.GetTestProjectAsync("Net60Project"); using var host = CreateMSBuildTestHost(testProject.Directory, emitter.AsExportDescriptionProvider(LoggerFactory)); Assert.Single(emitter.ReceivedMessages); - Assert.Equal(GetHashedFileExtension("6.0.202"), emitter.ReceivedMessages[0].SdkVersion); + Assert.Equal(GetHashedFileExtension("6.0.408"), emitter.ReceivedMessages[0].SdkVersion); } [ConditionalFact(typeof(NonMonoRuntimeOnly))] @@ -232,7 +232,19 @@ public async Task The_correct_sdk_version_is_emitted_NET7() using var testProject = await TestAssets.Instance.GetTestProjectAsync("Net70Project"); using var host = CreateMSBuildTestHost(testProject.Directory, emitter.AsExportDescriptionProvider(LoggerFactory)); Assert.Single(emitter.ReceivedMessages); - Assert.Equal(GetHashedFileExtension("7.0.100-rc.1.22431.12"), emitter.ReceivedMessages[0].SdkVersion); + Assert.Equal(GetHashedFileExtension("7.0.302"), emitter.ReceivedMessages[0].SdkVersion); + } + + [ConditionalFact(typeof(NonMonoRuntimeOnly))] + public async Task The_correct_sdk_version_is_emitted_NET8() + { + // Arrange + var emitter = new ProjectLoadTestEventEmitter(); + + using var testProject = await TestAssets.Instance.GetTestProjectAsync("Net80Project"); + using var host = CreateMSBuildTestHost(testProject.Directory, emitter.AsExportDescriptionProvider(LoggerFactory)); + Assert.Single(emitter.ReceivedMessages); + Assert.Equal(GetHashedFileExtension("8.0.100-preview.4.23260.5"), emitter.ReceivedMessages[0].SdkVersion); } private string GetHashedFileExtension(string fileExtension) diff --git a/tests/OmniSharp.MSBuild.Tests/WorkspaceInformationTests.cs b/tests/OmniSharp.MSBuild.Tests/WorkspaceInformationTests.cs index c67e87cea3..0ec14da797 100644 --- a/tests/OmniSharp.MSBuild.Tests/WorkspaceInformationTests.cs +++ b/tests/OmniSharp.MSBuild.Tests/WorkspaceInformationTests.cs @@ -30,8 +30,8 @@ public async Task TestProjectAndSolution() var project = Assert.Single(workspaceInfo.Projects); Assert.Equal("ProjectAndSolution", project.AssemblyName); - Assert.Equal("bin/Debug/netcoreapp3.1/", project.OutputPath.EnsureForwardSlashes()); - Assert.Equal("obj/Debug/netcoreapp3.1/", project.IntermediateOutputPath.EnsureForwardSlashes()); + Assert.Equal("bin/Debug/net6.0/", project.OutputPath.EnsureForwardSlashes()); + Assert.Equal("obj/Debug/net6.0/", project.IntermediateOutputPath.EnsureForwardSlashes()); var expectedTargetPath = $"{testProject.Directory}/{project.OutputPath}ProjectAndSolution.dll".EnsureForwardSlashes(); Assert.Equal(expectedTargetPath, project.TargetPath.EnsureForwardSlashes()); Assert.Equal("Debug", project.Configuration); @@ -41,7 +41,7 @@ public async Task TestProjectAndSolution() Assert.Equal(".NETCoreApp,Version=v3.1", project.TargetFramework); var targetFramework = Assert.Single(project.TargetFrameworks); - Assert.Equal("netcoreapp3.1", targetFramework.ShortName); + Assert.Equal("net6.0", targetFramework.ShortName); } [Fact] @@ -57,8 +57,8 @@ public async Task TestProjectAndSolutionFilter() var project = Assert.Single(workspaceInfo.Projects); Assert.Equal("ProjectAndSolutionFilter", project.AssemblyName); - Assert.Equal("bin/Debug/netcoreapp3.1/", project.OutputPath.EnsureForwardSlashes()); - Assert.Equal("obj/Debug/netcoreapp3.1/", project.IntermediateOutputPath.EnsureForwardSlashes()); + Assert.Equal("bin/Debug/net6.0/", project.OutputPath.EnsureForwardSlashes()); + Assert.Equal("obj/Debug/net6.0/", project.IntermediateOutputPath.EnsureForwardSlashes()); var expectedTargetPath = $"{testProject.Directory}/Project/{project.OutputPath}ProjectAndSolutionFilter.dll".EnsureForwardSlashes(); Assert.Equal(expectedTargetPath, project.TargetPath.EnsureForwardSlashes()); Assert.Equal("Debug", project.Configuration); @@ -68,7 +68,7 @@ public async Task TestProjectAndSolutionFilter() Assert.Equal(".NETCoreApp,Version=v3.1", project.TargetFramework); var targetFramework = Assert.Single(project.TargetFrameworks); - Assert.Equal("netcoreapp3.1", targetFramework.ShortName); + Assert.Equal("net6.0", targetFramework.ShortName); } } @@ -83,7 +83,7 @@ public async Task ProjectAndSolutionWithProjectSection() Assert.NotNull(workspaceInfo.Projects); var project = Assert.Single(workspaceInfo.Projects); Assert.Equal(".NETCoreApp,Version=v3.1", project.TargetFramework); - Assert.Equal("netcoreapp3.1", project.TargetFrameworks[0].ShortName); + Assert.Equal("net6.0", project.TargetFrameworks[0].ShortName); } [ConditionalFact(typeof(NonMonoRuntimeOnly))] @@ -128,12 +128,12 @@ public async Task TwoProjectsWithSolution() var firstProject = workspaceInfo.Projects[0]; Assert.Equal("App.csproj", Path.GetFileName(firstProject.Path)); Assert.Equal(".NETCoreApp,Version=v3.1", firstProject.TargetFramework); - Assert.Equal("netcoreapp3.1", firstProject.TargetFrameworks[0].ShortName); + Assert.Equal("net6.0", firstProject.TargetFrameworks[0].ShortName); var secondProject = workspaceInfo.Projects[1]; Assert.Equal("Lib.csproj", Path.GetFileName(secondProject.Path)); Assert.Equal(".NETStandard,Version=v1.3", secondProject.TargetFramework); - Assert.Equal("netstandard1.3", secondProject.TargetFrameworks[0].ShortName); + Assert.Equal("netstandard2.0", secondProject.TargetFrameworks[0].ShortName); } [Fact(Skip = "https://github.com/dotnet/msbuild/pull/7642")] @@ -151,12 +151,12 @@ public async Task TwoProjectsWithSolutionAndCustomConfigurations() var firstProject = workspaceInfo.Projects[0]; Assert.Equal("App.csproj", Path.GetFileName(firstProject.Path)); Assert.Equal(".NETCoreApp,Version=v3.1", firstProject.TargetFramework); - Assert.Equal("netcoreapp3.1", firstProject.TargetFrameworks[0].ShortName); + Assert.Equal("net6.0", firstProject.TargetFrameworks[0].ShortName); var secondProject = workspaceInfo.Projects[1]; Assert.Equal("Lib.csproj", Path.GetFileName(secondProject.Path)); Assert.Equal(".NETStandard,Version=v1.3", secondProject.TargetFramework); - Assert.Equal("netstandard1.3", secondProject.TargetFrameworks[0].ShortName); + Assert.Equal("netstandard2.0", secondProject.TargetFrameworks[0].ShortName); } [Fact] diff --git a/tests/OmniSharp.Roslyn.CSharp.Tests/AbstractGoToDefinitionFacts.cs b/tests/OmniSharp.Roslyn.CSharp.Tests/AbstractGoToDefinitionFacts.cs index 81bf7322a0..4169788de8 100644 --- a/tests/OmniSharp.Roslyn.CSharp.Tests/AbstractGoToDefinitionFacts.cs +++ b/tests/OmniSharp.Roslyn.CSharp.Tests/AbstractGoToDefinitionFacts.cs @@ -533,7 +533,7 @@ public void M(Generated g) TestHelpers.AddProjectToWorkspace(SharedOmniSharpTestHost.Workspace, "project.csproj", - new[] { "netcoreapp3.1" }, + new[] { "net6.0" }, new[] { testFile }, analyzerRefs: ImmutableArray.Create(new TestGeneratorReference( context => context.AddSource("GeneratedFile", generatedTestFile.Content.Code)))); diff --git a/tests/OmniSharp.Roslyn.CSharp.Tests/CustomRoslynAnalyzerFacts.cs b/tests/OmniSharp.Roslyn.CSharp.Tests/CustomRoslynAnalyzerFacts.cs index 83e8be56d4..c17aedea1c 100644 --- a/tests/OmniSharp.Roslyn.CSharp.Tests/CustomRoslynAnalyzerFacts.cs +++ b/tests/OmniSharp.Roslyn.CSharp.Tests/CustomRoslynAnalyzerFacts.cs @@ -301,7 +301,7 @@ private ProjectId AddProjectWithFile(OmniSharpTestHost host, TestFile testFile, return TestHelpers.AddProjectToWorkspace( host.Workspace, "project.csproj", - new[] { "netcoreapp3.1" }, + new[] { "net6.0" }, new[] { testFile }, analyzerRefs: analyzerReferences) .Single(); diff --git a/tests/OmniSharp.Roslyn.CSharp.Tests/FindReferencesFacts.cs b/tests/OmniSharp.Roslyn.CSharp.Tests/FindReferencesFacts.cs index 7039012f0e..fefafc2c44 100644 --- a/tests/OmniSharp.Roslyn.CSharp.Tests/FindReferencesFacts.cs +++ b/tests/OmniSharp.Roslyn.CSharp.Tests/FindReferencesFacts.cs @@ -568,7 +568,7 @@ class C TestHelpers.AddProjectToWorkspace(SharedOmniSharpTestHost.Workspace, "project.csproj", - new[] { "netcoreapp3.1" }, + new[] { "net6.0" }, new[] { testFile }, analyzerRefs: ImmutableArray.Create(new TestGeneratorReference( context => context.AddSource("GeneratedFile", Source)))); diff --git a/tests/OmniSharp.Roslyn.CSharp.Tests/FindSymbolsFacts.cs b/tests/OmniSharp.Roslyn.CSharp.Tests/FindSymbolsFacts.cs index 6c9dab8d32..71215b3bb6 100644 --- a/tests/OmniSharp.Roslyn.CSharp.Tests/FindSymbolsFacts.cs +++ b/tests/OmniSharp.Roslyn.CSharp.Tests/FindSymbolsFacts.cs @@ -359,7 +359,7 @@ public class Generated TestHelpers.AddProjectToWorkspace(SharedOmniSharpTestHost.Workspace, "project.csproj", - new[] { "netcoreapp3.1" }, + new[] { "net6.0" }, Array.Empty(), analyzerRefs: ImmutableArray.Create(new TestGeneratorReference( context => context.AddSource("GeneratedFile", Source)))); @@ -392,7 +392,7 @@ partial Generated TestHelpers.AddProjectToWorkspace(SharedOmniSharpTestHost.Workspace, "project.csproj", - new[] { "netcoreapp3.1" }, + new[] { "net6.0" }, new[] { testFile }, analyzerRefs: ImmutableArray.Create(new TestGeneratorReference( context => context.AddSource("GeneratedFile", Source)))); diff --git a/tests/OmniSharp.Roslyn.CSharp.Tests/GotoTypeDefinitionFacts.cs b/tests/OmniSharp.Roslyn.CSharp.Tests/GotoTypeDefinitionFacts.cs index efe7451853..cc57e37a29 100644 --- a/tests/OmniSharp.Roslyn.CSharp.Tests/GotoTypeDefinitionFacts.cs +++ b/tests/OmniSharp.Roslyn.CSharp.Tests/GotoTypeDefinitionFacts.cs @@ -469,7 +469,7 @@ public void M(Generated gen) TestHelpers.AddProjectToWorkspace(SharedOmniSharpTestHost.Workspace, "project.csproj", - new[] { "netcoreapp3.1" }, + new[] { "net6.0" }, new[] { testFile }, analyzerRefs: ImmutableArray.Create(new TestGeneratorReference( context => context.AddSource("GeneratedFile", generatedTestFile.Content.Code)))); diff --git a/tests/OmniSharp.Roslyn.CSharp.Tests/SourceGeneratorFacts.cs b/tests/OmniSharp.Roslyn.CSharp.Tests/SourceGeneratorFacts.cs index e4cb5b1eef..4f879c4038 100644 --- a/tests/OmniSharp.Roslyn.CSharp.Tests/SourceGeneratorFacts.cs +++ b/tests/OmniSharp.Roslyn.CSharp.Tests/SourceGeneratorFacts.cs @@ -45,7 +45,7 @@ class GeneratedCode TestFile testFile = new TestFile(Path, Code); TestHelpers.AddProjectToWorkspace(SharedOmniSharpTestHost.Workspace, "project.csproj", - new[] { "netcoreapp3.1" }, + new[] { "net6.0" }, new[] { testFile }, otherFiles: null, ImmutableArray.Create(reference)); diff --git a/tests/OmniSharp.Script.Tests/WorkspaceInformationTests.cs b/tests/OmniSharp.Script.Tests/WorkspaceInformationTests.cs index 626d4949c2..e1d31934f0 100644 --- a/tests/OmniSharp.Script.Tests/WorkspaceInformationTests.cs +++ b/tests/OmniSharp.Script.Tests/WorkspaceInformationTests.cs @@ -20,7 +20,7 @@ public class WorkspaceInformationTests : AbstractTestFixture private static Dictionary s_netCoreScriptingConfiguration = new Dictionary { ["script:enableScriptNuGetReferences"] = "true", - ["script:defaultTargetFramework"] = "netcoreapp3.1" + ["script:defaultTargetFramework"] = "net6.0" }; public WorkspaceInformationTests(ITestOutputHelper output) diff --git a/tests/OmniSharp.Tests/DotNetCliServiceFacts.cs b/tests/OmniSharp.Tests/DotNetCliServiceFacts.cs index fb781dc538..01e504f99c 100644 --- a/tests/OmniSharp.Tests/DotNetCliServiceFacts.cs +++ b/tests/OmniSharp.Tests/DotNetCliServiceFacts.cs @@ -7,7 +7,7 @@ namespace OmniSharp.Tests { public class DotNetCliServiceFacts : AbstractTestFixture { - private const string DotNetVersion = "7.0.100-rc.1.22431.12"; + private const string DotNetVersion = "8.0.100-preview.4.23260.5"; private int Major { get; } private int Minor { get; } private int Patch { get; } diff --git a/tests/app.config b/tests/app.config index 53b48f3aa8..85111ca908 100644 --- a/tests/app.config +++ b/tests/app.config @@ -7,52 +7,52 @@ - + - + - + - + - + - + - + - + - + - + - + - + From 43e6210b916cdde798bf4b5b5de7e0342c383975 Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Tue, 30 May 2023 23:31:14 -0700 Subject: [PATCH 2/8] Fix up tests --- build/Packages.props | 2 +- .../GetTestStartInfoFacts.cs | 6 +++--- tests/OmniSharp.DotNetTest.Tests/RunTestFacts.cs | 14 +++++++------- .../ProjectFileInfoTests.cs | 3 +-- .../ProjectLoadListenerTests.cs | 2 +- .../WorkspaceInformationTests.cs | 16 ++++++++-------- 6 files changed, 21 insertions(+), 22 deletions(-) diff --git a/build/Packages.props b/build/Packages.props index 0d41fcd38e..235117349e 100644 --- a/build/Packages.props +++ b/build/Packages.props @@ -4,7 +4,7 @@ 7.0.0 17.6.0 - 17.6.3 + 17.3.2 6.7.0-preview.1.20 4.7.0-2.23225.15 2.4.1 diff --git a/tests/OmniSharp.DotNetTest.Tests/GetTestStartInfoFacts.cs b/tests/OmniSharp.DotNetTest.Tests/GetTestStartInfoFacts.cs index b00e277be9..5843a187aa 100644 --- a/tests/OmniSharp.DotNetTest.Tests/GetTestStartInfoFacts.cs +++ b/tests/OmniSharp.DotNetTest.Tests/GetTestStartInfoFacts.cs @@ -23,7 +23,7 @@ await GetDotNetTestStartInfoAsync( XunitTestProject, methodName: "Main.Test.MainTest.Test", testFramework: "xunit", - targetFrameworkVersion: ".NETCoreApp,Version=v3.1", + targetFrameworkVersion: ".NETCoreApp,Version=v6.0", assert: AssertCorrectness); } @@ -34,7 +34,7 @@ await GetDotNetTestStartInfoAsync( NUnitTestProject, methodName: "Main.Test.MainTest.Test", testFramework: "nunit", - targetFrameworkVersion: ".NETCoreApp,Version=v3.1", + targetFrameworkVersion: ".NETCoreApp,Version=v6.0", assert: AssertCorrectness); } @@ -45,7 +45,7 @@ await GetDotNetTestStartInfoAsync( MSTestProject, methodName: "Main.Test.MainTest.Test", testFramework: "mstest", - targetFrameworkVersion: ".NETCoreApp,Version=v3.1", + targetFrameworkVersion: ".NETCoreApp,Version=v6.0", assert: AssertCorrectness); } diff --git a/tests/OmniSharp.DotNetTest.Tests/RunTestFacts.cs b/tests/OmniSharp.DotNetTest.Tests/RunTestFacts.cs index 359bd7ac49..92f481c590 100644 --- a/tests/OmniSharp.DotNetTest.Tests/RunTestFacts.cs +++ b/tests/OmniSharp.DotNetTest.Tests/RunTestFacts.cs @@ -65,7 +65,7 @@ await RunDotNetTestAsync( methodName: "Main.Test.MainTest.Test", testFramework: "xunit", shouldPass: true, - targetFrameworkVersion: ".NETCoreApp,Version=v3.1"); + targetFrameworkVersion: ".NETCoreApp,Version=v6.0"); } [Fact] @@ -76,7 +76,7 @@ await RunDotNetTestAsync( methodName: "Main.Test.MainTest.DataDrivenTest1", testFramework: "xunit", shouldPass: false, - targetFrameworkVersion: ".NETCoreApp,Version=v3.1"); + targetFrameworkVersion: ".NETCoreApp,Version=v6.0"); } [Fact] @@ -87,7 +87,7 @@ await RunDotNetTestAsync( methodName: "Main.Test.MainTest.DataDrivenTest2", testFramework: "xunit", shouldPass: true, - targetFrameworkVersion: ".NETCoreApp,Version=v3.1"); + targetFrameworkVersion: ".NETCoreApp,Version=v6.0"); } [Fact] @@ -98,7 +98,7 @@ await RunDotNetTestAsync( methodName: "Main.Test.MainTest.UsesDisplayName", testFramework: "xunit", shouldPass: true, - targetFrameworkVersion: ".NETCoreApp,Version=v3.1"); + targetFrameworkVersion: ".NETCoreApp,Version=v6.0"); } [Fact] @@ -109,7 +109,7 @@ public async Task RunXunitTestWithSimilarName() methodName: "Main.Test.MainTest.TestWithSimilarName", testFramework: "xunit", shouldPass: true, - targetFrameworkVersion: ".NETCoreApp,Version=v3.1"); + targetFrameworkVersion: ".NETCoreApp,Version=v6.0"); Assert.Single(response.Results); } @@ -122,7 +122,7 @@ public async Task RunXunitFailingTest() methodName: "Main.Test.MainTest.FailingTest", testFramework: "xunit", shouldPass: false, - targetFrameworkVersion: ".NETCoreApp,Version=v3.1"); + targetFrameworkVersion: ".NETCoreApp,Version=v6.0"); Assert.Single(response.Results); Assert.NotEmpty(response.Results[0].ErrorMessage); @@ -137,7 +137,7 @@ public async Task RunXunitStandardOutputIsReturned() methodName: "Main.Test.MainTest.CheckStandardOutput", testFramework: "xunit", shouldPass: true, - targetFrameworkVersion: ".NETCoreApp,Version=v3.1"); + targetFrameworkVersion: ".NETCoreApp,Version=v6.0"); Assert.Single(response.Results); Assert.NotEmpty(response.Results[0].StandardOutput); diff --git a/tests/OmniSharp.MSBuild.Tests/ProjectFileInfoTests.cs b/tests/OmniSharp.MSBuild.Tests/ProjectFileInfoTests.cs index be2e656541..d9f2fd67d9 100644 --- a/tests/OmniSharp.MSBuild.Tests/ProjectFileInfoTests.cs +++ b/tests/OmniSharp.MSBuild.Tests/ProjectFileInfoTests.cs @@ -239,8 +239,7 @@ public async Task ProjectReferenceProducingAnalyzerItems() var projectFilePath = Path.Combine(testProject.Directory, "ConsumingProject", "ConsumingProject.csproj"); var projectFileInfo = CreateProjectFileInfo(_sharedOmniSharpHostFixture.OmniSharpTestHost, testProject, projectFilePath); Assert.Empty(projectFileInfo.ProjectReferences); - var analyzerFileReference = Assert.Single(projectFileInfo.Analyzers); - Assert.EndsWith("Analyzer.dll", analyzerFileReference); + Assert.Single(projectFileInfo.Analyzers.Where(path => Path.GetFileName(path) == "Analyzer.dll")); } } } diff --git a/tests/OmniSharp.MSBuild.Tests/ProjectLoadListenerTests.cs b/tests/OmniSharp.MSBuild.Tests/ProjectLoadListenerTests.cs index 2feea8e9c4..dd91b4dd93 100644 --- a/tests/OmniSharp.MSBuild.Tests/ProjectLoadListenerTests.cs +++ b/tests/OmniSharp.MSBuild.Tests/ProjectLoadListenerTests.cs @@ -150,7 +150,7 @@ public async Task If_there_are_multiple_target_frameworks_they_are_emitted() Assert.Single(emitter.ReceivedMessages); var tfm = emitter.ReceivedMessages[0].TargetFrameworks.ToArray(); Assert.Equal(2, tfm.Count()); - Assert.Equal("netstandard2.0", tfm[0]); + Assert.Equal("netstandard1.5", tfm[0]); Assert.Equal("netstandard2.0", tfm[1]); } diff --git a/tests/OmniSharp.MSBuild.Tests/WorkspaceInformationTests.cs b/tests/OmniSharp.MSBuild.Tests/WorkspaceInformationTests.cs index 0ec14da797..d6a9b8d879 100644 --- a/tests/OmniSharp.MSBuild.Tests/WorkspaceInformationTests.cs +++ b/tests/OmniSharp.MSBuild.Tests/WorkspaceInformationTests.cs @@ -39,7 +39,7 @@ public async Task TestProjectAndSolution() Assert.True(project.IsExe); Assert.False(project.IsUnityProject); - Assert.Equal(".NETCoreApp,Version=v3.1", project.TargetFramework); + Assert.Equal(".NETCoreApp,Version=v6.0", project.TargetFramework); var targetFramework = Assert.Single(project.TargetFrameworks); Assert.Equal("net6.0", targetFramework.ShortName); } @@ -66,7 +66,7 @@ public async Task TestProjectAndSolutionFilter() Assert.True(project.IsExe); Assert.False(project.IsUnityProject); - Assert.Equal(".NETCoreApp,Version=v3.1", project.TargetFramework); + Assert.Equal(".NETCoreApp,Version=v6.0", project.TargetFramework); var targetFramework = Assert.Single(project.TargetFrameworks); Assert.Equal("net6.0", targetFramework.ShortName); } @@ -82,7 +82,7 @@ public async Task ProjectAndSolutionWithProjectSection() Assert.Equal("ProjectAndSolutionWithProjectSection.sln", Path.GetFileName(workspaceInfo.SolutionPath)); Assert.NotNull(workspaceInfo.Projects); var project = Assert.Single(workspaceInfo.Projects); - Assert.Equal(".NETCoreApp,Version=v3.1", project.TargetFramework); + Assert.Equal(".NETCoreApp,Version=v6.0", project.TargetFramework); Assert.Equal("net6.0", project.TargetFrameworks[0].ShortName); } @@ -127,12 +127,12 @@ public async Task TwoProjectsWithSolution() var firstProject = workspaceInfo.Projects[0]; Assert.Equal("App.csproj", Path.GetFileName(firstProject.Path)); - Assert.Equal(".NETCoreApp,Version=v3.1", firstProject.TargetFramework); + Assert.Equal(".NETCoreApp,Version=v6.0", firstProject.TargetFramework); Assert.Equal("net6.0", firstProject.TargetFrameworks[0].ShortName); var secondProject = workspaceInfo.Projects[1]; Assert.Equal("Lib.csproj", Path.GetFileName(secondProject.Path)); - Assert.Equal(".NETStandard,Version=v1.3", secondProject.TargetFramework); + Assert.Equal(".NETStandard,Version=v2.0", secondProject.TargetFramework); Assert.Equal("netstandard2.0", secondProject.TargetFrameworks[0].ShortName); } @@ -150,12 +150,12 @@ public async Task TwoProjectsWithSolutionAndCustomConfigurations() var firstProject = workspaceInfo.Projects[0]; Assert.Equal("App.csproj", Path.GetFileName(firstProject.Path)); - Assert.Equal(".NETCoreApp,Version=v3.1", firstProject.TargetFramework); + Assert.Equal(".NETCoreApp,Version=v6.0", firstProject.TargetFramework); Assert.Equal("net6.0", firstProject.TargetFrameworks[0].ShortName); var secondProject = workspaceInfo.Projects[1]; Assert.Equal("Lib.csproj", Path.GetFileName(secondProject.Path)); - Assert.Equal(".NETStandard,Version=v1.3", secondProject.TargetFramework); + Assert.Equal(".NETStandard,Version=v1.5", secondProject.TargetFramework); Assert.Equal("netstandard2.0", secondProject.TargetFrameworks[0].ShortName); } @@ -268,7 +268,7 @@ public async Task TestProjectWithMultiTFMReferencedProjectOutsideOfOmniSharp() var project2 = workspaceInfo.Projects[1]; Assert.Equal("Lib.csproj", Path.GetFileName(project2.Path)); - Assert.Equal(".NETStandard,Version=v1.3", project2.TargetFramework); + Assert.Equal(".NETStandard,Version=v1.5", project2.TargetFramework); Assert.Equal(2, project2.TargetFrameworks.Count); } From 86ced36885daa4162c34a3965b6b9ad88393cc8f Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Wed, 31 May 2023 17:12:13 -0700 Subject: [PATCH 3/8] Downgrade .NET 6 SDK to be compatible with Mono MSBuild --- .github/workflows/build.yml | 2 +- .github/workflows/tests-net6.yml | 2 +- .github/workflows/tests.yml | 2 +- .pipelines/init.yml | 2 +- build.json | 2 +- test-assets/test-projects/ExternAlias/global.json | 2 +- test-assets/test-projects/Net60Project/global.json | 2 +- test-assets/test-projects/global.json | 2 +- tests/OmniSharp.MSBuild.Tests/ProjectLoadListenerTests.cs | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c9cae05b16..5a70edcdba 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,7 +3,7 @@ name: 'Build' env: DotNetVersion: "8.0.100-preview.4.23260.5" DotNetVersion2: "7.0.302" - DotNetVersion3: "6.0.408" + DotNetVersion3: "6.0.203" NuGetVersion: "5.7.0" MonoVersion: "6.12.0" Artifacts: ${{ github.workspace }}/artifacts/ diff --git a/.github/workflows/tests-net6.yml b/.github/workflows/tests-net6.yml index 694d303209..45b78a2ff6 100644 --- a/.github/workflows/tests-net6.yml +++ b/.github/workflows/tests-net6.yml @@ -3,7 +3,7 @@ name: 'Tests net6.0' env: DotNetVersion: "8.0.100-preview.4.23260.5" DotNetVersion2: "7.0.302" - DotNetVersion3: "6.0.408" + DotNetVersion3: "6.0.203" NuGetVersion: "5.7.0" MonoVersion: "6.12.0" Artifacts: ${{ github.workspace }}/artifacts/ diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 596d768bcc..4d11f823af 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -3,7 +3,7 @@ name: 'Tests' env: DotNetVersion: "8.0.100-preview.4.23260.5" DotNetVersion2: "7.0.302" - DotNetVersion3: "6.0.408" + DotNetVersion3: "6.0.203" NuGetVersion: "5.7.0" MonoVersion: "6.12.0" Artifacts: ${{ github.workspace }}/artifacts/ diff --git a/.pipelines/init.yml b/.pipelines/init.yml index c44370684a..9364677b1e 100644 --- a/.pipelines/init.yml +++ b/.pipelines/init.yml @@ -3,7 +3,7 @@ parameters: Verbosity: Normal DotNetVersion: "8.0.100-preview.4.23260.5" DotNetVersion2: "7.0.302" - DotNetVersion3: "6.0.408" + DotNetVersion3: "6.0.203" CakeVersion: "1.1.0" NuGetVersion: "5.7.0" MonoVersion: '' diff --git a/build.json b/build.json index 1ac8d1d07a..f519809236 100644 --- a/build.json +++ b/build.json @@ -2,7 +2,7 @@ "DotNetInstallScriptURL": "https://dot.net/v1", "DotNetChannel": "Preview", "DotNetVersions": [ - "6.0.408", + "6.0.203", "7.0.302", "8.0.100-preview.4.23260.5" ], diff --git a/test-assets/test-projects/ExternAlias/global.json b/test-assets/test-projects/ExternAlias/global.json index 16a59b4002..4ea3df4aaf 100644 --- a/test-assets/test-projects/ExternAlias/global.json +++ b/test-assets/test-projects/ExternAlias/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "6.0.408" + "version": "6.0.203" } } \ No newline at end of file diff --git a/test-assets/test-projects/Net60Project/global.json b/test-assets/test-projects/Net60Project/global.json index 16a59b4002..4ea3df4aaf 100644 --- a/test-assets/test-projects/Net60Project/global.json +++ b/test-assets/test-projects/Net60Project/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "6.0.408" + "version": "6.0.203" } } \ No newline at end of file diff --git a/test-assets/test-projects/global.json b/test-assets/test-projects/global.json index 16a59b4002..4ea3df4aaf 100644 --- a/test-assets/test-projects/global.json +++ b/test-assets/test-projects/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "6.0.408" + "version": "6.0.203" } } \ No newline at end of file diff --git a/tests/OmniSharp.MSBuild.Tests/ProjectLoadListenerTests.cs b/tests/OmniSharp.MSBuild.Tests/ProjectLoadListenerTests.cs index dd91b4dd93..6a25304417 100644 --- a/tests/OmniSharp.MSBuild.Tests/ProjectLoadListenerTests.cs +++ b/tests/OmniSharp.MSBuild.Tests/ProjectLoadListenerTests.cs @@ -220,7 +220,7 @@ public async Task The_correct_sdk_version_is_emitted_NET6() using var testProject = await TestAssets.Instance.GetTestProjectAsync("Net60Project"); using var host = CreateMSBuildTestHost(testProject.Directory, emitter.AsExportDescriptionProvider(LoggerFactory)); Assert.Single(emitter.ReceivedMessages); - Assert.Equal(GetHashedFileExtension("6.0.408"), emitter.ReceivedMessages[0].SdkVersion); + Assert.Equal(GetHashedFileExtension("6.0.203"), emitter.ReceivedMessages[0].SdkVersion); } [ConditionalFact(typeof(NonMonoRuntimeOnly))] From b4629823ae4642be864a65797b635294388ef6e0 Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Wed, 31 May 2023 17:32:37 -0700 Subject: [PATCH 4/8] Skip NET8 test on Desktop runtimes. --- .../ProjectFileInfoTests.cs | 4 +++- .../ProjectLoadListenerTests.cs | 2 +- tests/TestUtility/ConditionalFactAttribute.cs | 15 +++++++++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/tests/OmniSharp.MSBuild.Tests/ProjectFileInfoTests.cs b/tests/OmniSharp.MSBuild.Tests/ProjectFileInfoTests.cs index d9f2fd67d9..b95a1cecaa 100644 --- a/tests/OmniSharp.MSBuild.Tests/ProjectFileInfoTests.cs +++ b/tests/OmniSharp.MSBuild.Tests/ProjectFileInfoTests.cs @@ -239,7 +239,9 @@ public async Task ProjectReferenceProducingAnalyzerItems() var projectFilePath = Path.Combine(testProject.Directory, "ConsumingProject", "ConsumingProject.csproj"); var projectFileInfo = CreateProjectFileInfo(_sharedOmniSharpHostFixture.OmniSharpTestHost, testProject, projectFilePath); Assert.Empty(projectFileInfo.ProjectReferences); - Assert.Single(projectFileInfo.Analyzers.Where(path => Path.GetFileName(path) == "Analyzer.dll")); + // Since the SDK adds Analyzers and Source Generators to our projects for us, we now look for the analyzer that we explicitly reference. + var analyzers = projectFileInfo.Analyzers.Where(path => Path.GetFileName(path) == "Analyzer.dll"); + Assert.Single(analyzers); } } } diff --git a/tests/OmniSharp.MSBuild.Tests/ProjectLoadListenerTests.cs b/tests/OmniSharp.MSBuild.Tests/ProjectLoadListenerTests.cs index 6a25304417..c0692865f2 100644 --- a/tests/OmniSharp.MSBuild.Tests/ProjectLoadListenerTests.cs +++ b/tests/OmniSharp.MSBuild.Tests/ProjectLoadListenerTests.cs @@ -235,7 +235,7 @@ public async Task The_correct_sdk_version_is_emitted_NET7() Assert.Equal(GetHashedFileExtension("7.0.302"), emitter.ReceivedMessages[0].SdkVersion); } - [ConditionalFact(typeof(NonMonoRuntimeOnly))] + [ConditionalFact(typeof(DotnetRuntimeOnly))] public async Task The_correct_sdk_version_is_emitted_NET8() { // Arrange diff --git a/tests/TestUtility/ConditionalFactAttribute.cs b/tests/TestUtility/ConditionalFactAttribute.cs index a1c1ad587b..71609f2378 100644 --- a/tests/TestUtility/ConditionalFactAttribute.cs +++ b/tests/TestUtility/ConditionalFactAttribute.cs @@ -84,4 +84,19 @@ public class NonMonoRuntimeOnly : SkipCondition #endif public override string SkipReason => "Can not be run on Mono runtime"; } + + public class DotnetRuntimeOnly : SkipCondition + { + public override bool ShouldSkip => +#if NET472 + true; +#elif NETCOREAPP + false; +#elif NETSTANDARD2_0 + throw new PlatformNotSupportedException(); +#else +#error Unsupported configuration +#endif + public override string SkipReason => "Can only be run on dotnet runtime"; + } } From 2cfc597274ee3df64e65bc02cec6aae9a264855f Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Wed, 31 May 2023 22:48:24 -0700 Subject: [PATCH 5/8] Remove unused feed from NuGet.Config --- NuGet.Config | 1 - 1 file changed, 1 deletion(-) diff --git a/NuGet.Config b/NuGet.Config index 4d92b5c122..91db90b2e5 100644 --- a/NuGet.Config +++ b/NuGet.Config @@ -3,7 +3,6 @@ - From 42e49b46ce6ece01837701f5645bf215de1b15d6 Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Wed, 31 May 2023 23:26:57 -0700 Subject: [PATCH 6/8] Update Roslyn version --- build/Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/Packages.props b/build/Packages.props index 235117349e..8b70b57556 100644 --- a/build/Packages.props +++ b/build/Packages.props @@ -6,7 +6,7 @@ 17.6.0 17.3.2 6.7.0-preview.1.20 - 4.7.0-2.23225.15 + 4.7.0-2.23274.2 2.4.1 From 8467f284ffb1db1d015553db0657d20ea961b1ca Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Thu, 1 Jun 2023 11:52:49 -0700 Subject: [PATCH 7/8] Use dotnet-cake for performing the build --- .config/dotnet-tools.json | 4 ++-- build.cake | 44 +++++++++++++++++++-------------------- build.ps1 | 5 ++++- global.json | 2 +- scripts/cake-bootstrap.sh | 8 +++++-- scripts/common.cake | 17 --------------- 6 files changed, 34 insertions(+), 46 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index eea98b1537..831d039b64 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,10 +3,10 @@ "isRoot": true, "tools": { "cake.tool": { - "version": "1.1.0", + "version": "3.0.0", "commands": [ "dotnet-cake" ] } } -} +} \ No newline at end of file diff --git a/build.cake b/build.cake index 6b08124a83..202db7b006 100644 --- a/build.cake +++ b/build.cake @@ -60,7 +60,7 @@ Task("GitVersion") /// Task("Setup") .IsDependentOn("ValidateMono") - .IsDependentOn("InstallDotNetCoreSdk"); + .IsDependentOn("InstallDotNetSdk"); void InstallDotNetSdk(BuildEnvironment env, BuildPlan plan, string version, string installFolder, bool sharedRuntime = false, bool noPath = false) { @@ -73,10 +73,7 @@ void InstallDotNetSdk(BuildEnvironment env, BuildPlan plan, string version, stri var scriptFilePath = CombinePaths(installFolder, scriptFileName); var url = $"{plan.DotNetInstallScriptURL}/{scriptFileName}"; - using (var client = new WebClient()) - { - client.DownloadFile(url, scriptFilePath); - } + DownloadFile(url, File(scriptFilePath)); if (!Platform.Current.IsWindows) { @@ -110,7 +107,7 @@ void InstallDotNetSdk(BuildEnvironment env, BuildPlan plan, string version, stri Run(env.ShellCommand, $"{env.ShellArgument} {scriptFilePath} {string.Join(" ", argList)}").ExceptionOnError($"Failed to Install .NET Core SDK {version}"); } -Task("InstallDotNetCoreSdk") +Task("InstallDotNetSdk") .Does(() => { if (!useGlobalDotNetSdk) @@ -157,21 +154,21 @@ Task("PrepareTestAssets:CommonTestAssets") var folder = CombinePaths(env.Folders.TestAssets, "test-projects", project); try { - DotNetCoreBuild(folder, new DotNetCoreBuildSettings() + DotNetBuild(folder, new DotNetBuildSettings() { ToolPath = env.DotNetCommand, WorkingDirectory = folder, - Verbosity = DotNetCoreVerbosity.Minimal + Verbosity = DotNetVerbosity.Minimal }); } catch { // ExternalAlias has issues once in a while, try building again to get it working. if (project == "ExternAlias") { - DotNetCoreBuild(folder, new DotNetCoreBuildSettings() + DotNetBuild(folder, new DotNetBuildSettings() { ToolPath = env.DotNetCommand, WorkingDirectory = folder, - Verbosity = DotNetCoreVerbosity.Minimal + Verbosity = DotNetVerbosity.Minimal }); } } @@ -185,11 +182,11 @@ Task("PrepareTestAssets:RestoreOnlyTestAssets") var folder = CombinePaths(env.Folders.TestAssets, "test-projects", project); - DotNetCoreRestore(new DotNetCoreRestoreSettings() + DotNetRestore(new DotNetRestoreSettings() { ToolPath = env.DotNetCommand, WorkingDirectory = folder, - Verbosity = DotNetCoreVerbosity.Minimal + Verbosity = DotNetVerbosity.Minimal }); }); @@ -202,11 +199,11 @@ Task("PrepareTestAssets:WindowsOnlyTestAssets") var folder = CombinePaths(env.Folders.TestAssets, "test-projects", project); - DotNetCoreBuild(folder, new DotNetCoreBuildSettings() + DotNetBuild(folder, new DotNetBuildSettings() { ToolPath = env.DotNetCommand, WorkingDirectory = folder, - Verbosity = DotNetCoreVerbosity.Minimal + Verbosity = DotNetVerbosity.Minimal }); }); @@ -238,7 +235,7 @@ void BuildWithDotNetCli(BuildEnvironment env, string configuration) ? MSBuildBinaryLogImports.Embed : MSBuildBinaryLogImports.None; - var settings = new DotNetCoreMSBuildSettings + var settings = new DotNetMSBuildSettings { WorkingDirectory = env.WorkingDirectory, @@ -246,6 +243,7 @@ void BuildWithDotNetCli(BuildEnvironment env, string configuration) args.Append("/restore") .Append($"/bl:{logFileNameBase}.binlog;ProjectImports={projectImports}") .Append($"/v:{Verbosity.Minimal.GetMSBuildVerbosityName()}") + .Append("/tl") }; settings.AddFileLogger( @@ -268,7 +266,7 @@ void BuildWithDotNetCli(BuildEnvironment env, string configuration) .WithProperty("RuntimeFrameworkVersion", "6.0.0-preview.7.21317.1") // Set the minimum runtime to a .NET 6 prerelease so that prerelease SDKs will be considered during rollForward. .WithProperty("RollForward", "LatestMajor"); - DotNetCoreMSBuild("OmniSharp.sln", settings); + DotNetMSBuild("OmniSharp.sln", settings); } Task("Build") @@ -570,7 +568,7 @@ string PublishBuild(string project, BuildEnvironment env, BuildPlan plan, string try { - var publishSettings = new DotNetCorePublishSettings() + var publishSettings = new DotNetPublishSettings() { Framework = framework, Runtime = rid, // TODO: With everything today do we need to publish this with a rid? This appears to be legacy bit when we used to push for all supported dotnet core rids. @@ -578,7 +576,7 @@ string PublishBuild(string project, BuildEnvironment env, BuildPlan plan, string SelfContained = false, // Since we are specifying a runtime identifier this defaults to true. We don't need to ship a runtime for net6 because we require the .NET SDK to be installed. Configuration = configuration, OutputDirectory = outputFolder, - MSBuildSettings = new DotNetCoreMSBuildSettings() + MSBuildSettings = new DotNetMSBuildSettings() .WithProperty("PackageVersion", env.VersionInfo.NuGetVersion) .WithProperty("AssemblyVersion", env.VersionInfo.AssemblySemVer) .WithProperty("FileVersion", env.VersionInfo.AssemblySemVer) @@ -587,9 +585,9 @@ string PublishBuild(string project, BuildEnvironment env, BuildPlan plan, string .WithProperty("RollForward", "LatestMajor"), ToolPath = env.DotNetCommand, WorkingDirectory = env.WorkingDirectory, - Verbosity = DotNetCoreVerbosity.Minimal, + Verbosity = DotNetVerbosity.Minimal, }; - DotNetCorePublish(projectFileName, publishSettings); + DotNetPublish(projectFileName, publishSettings); } catch { @@ -645,12 +643,12 @@ Task("PublishWindowsBuilds") }); Task("PublishNuGet") - .IsDependentOn("InstallDotNetCoreSdk") + .IsDependentOn("InstallDotNetSdk") .Does(() => { - DotNetCorePack(".", new DotNetCorePackSettings() { + DotNetPack(".", new DotNetPackSettings() { Configuration = "Release", OutputDirectory = "./artifacts/nuget/", - MSBuildSettings = new DotNetCoreMSBuildSettings() + MSBuildSettings = new DotNetMSBuildSettings() .SetConfiguration(configuration) .WithProperty("PackageVersion", env.VersionInfo.NuGetVersion) .WithProperty("AssemblyVersion", env.VersionInfo.AssemblySemVer) diff --git a/build.ps1 b/build.ps1 index 2ef7cd8585..f6dc870ccb 100644 --- a/build.ps1 +++ b/build.ps1 @@ -214,6 +214,8 @@ if (Test-Path $MODULES_PACKAGES_CONFIG) { Pop-Location } +Invoke-Expression "&dotnet tool restore" + # Make sure that Cake has been installed. if (!(Test-Path $CAKE_EXE)) { Throw "Could not find Cake.exe at $CAKE_EXE" @@ -235,5 +237,6 @@ $cakeArguments += $ScriptArgs # Start Cake Write-Host "Running build script..." -&$CAKE_EXE $cakeArguments +# &$CAKE_EXE $cakeArguments +dotnet cake $cakeArguments exit $LASTEXITCODE diff --git a/global.json b/global.json index 106562d795..5c2c3c3d84 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.100-preview.4.23260.5", + "version": "8.0.100-preview.3.23178.7", "rollForward": "patch" } } \ No newline at end of file diff --git a/scripts/cake-bootstrap.sh b/scripts/cake-bootstrap.sh index 51d0c4c1e6..e6df9fb29d 100644 --- a/scripts/cake-bootstrap.sh +++ b/scripts/cake-bootstrap.sh @@ -87,6 +87,8 @@ $MD5_EXE "$PACKAGES_CONFIG" | awk '{ print $1 }' >| "$PACKAGES_CONFIG_MD5" popd >/dev/null +dotnet tool restore + # Make sure that Cake has been installed. if [ ! -f "$CAKE_EXE" ]; then echo "Could not find Cake.exe at '$CAKE_EXE'." @@ -95,7 +97,9 @@ fi # Start Cake if $SHOW_VERSION; then - exec mono "$CAKE_EXE" --version + # exec mono "$CAKE_EXE" --version + dotnet cake --version else - exec mono "$CAKE_EXE" $SCRIPT --verbosity=$VERBOSITY --configuration=$CONFIGURATION --target=$TARGET $DRYRUN "${SCRIPT_ARGUMENTS[@]}" + # exec mono "$CAKE_EXE" $SCRIPT --verbosity=$VERBOSITY --configuration=$CONFIGURATION --target=$TARGET $DRYRUN "${SCRIPT_ARGUMENTS[@]}" + dotnet cake $SCRIPT --verbosity=$VERBOSITY --configuration=$CONFIGURATION --target=$TARGET $DRYRUN "${SCRIPT_ARGUMENTS[@]}" fi diff --git a/scripts/common.cake b/scripts/common.cake index f84d3990d0..b8053854a4 100644 --- a/scripts/common.cake +++ b/scripts/common.cake @@ -5,7 +5,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Linq; -using System.Net; public static class Log { @@ -121,22 +120,6 @@ string CombinePaths(params string[] paths) return PathHelper.Combine(paths); } -void DownloadFileAndUnzip(string url, string folder) -{ - DirectoryHelper.ForceCreate(folder); - var zipFileName = CombinePaths(folder, "temp.zip"); - - Information("Downloading {0}", url); - - using (var client = new WebClient()) - { - client.DownloadFile(url, zipFileName); - } - - Unzip(zipFileName, folder); - FileHelper.Delete(zipFileName); -} - public class Folders { public string DotNetSdk { get; } From 633dbec8f8192427d7ac39f6bef980e4c1031cc5 Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Thu, 1 Jun 2023 21:44:44 -0700 Subject: [PATCH 8/8] Update CI to invoke dotnet cake directly --- .github/workflows/build.yml | 19 ++----------------- .github/workflows/tests-net6.yml | 26 ++------------------------ .github/workflows/tests.yml | 27 ++++----------------------- .pipelines/init.yml | 2 +- azure-pipelines.yml | 6 +++--- build.ps1 | 11 +---------- scripts/cake-bootstrap.sh | 9 --------- tools/packages.config | 1 - 8 files changed, 13 insertions(+), 88 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5a70edcdba..01f5099edf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,7 +4,7 @@ env: DotNetVersion: "8.0.100-preview.4.23260.5" DotNetVersion2: "7.0.302" DotNetVersion3: "6.0.203" - NuGetVersion: "5.7.0" + NuGetVersion: "6.5.0" MonoVersion: "6.12.0" Artifacts: ${{ github.workspace }}/artifacts/ Coverage: ${{ github.workspace }}/coverage/ @@ -66,24 +66,9 @@ jobs: run: | nuget install tools/packages.config -ExcludeVersion -OutputDirectory tools - # - name: 🍰 Run Cake - # run: | - # dotnet cake --bootstrap - # dotnet cake --configuration=Release --verbosity=Verbose --target=CI --publish-all --archive - - - name: 🍰 Run Cake - if: ${{ runner.os == 'Linux' || runner.os == 'macOS' }} - shell: bash - run: | - echo $PATH - chmod 755 ./build.sh - ./build.sh --configuration Release --verbosity Verbose --target CI --publish-all --archive - - name: 🍰 Run Cake - if: ${{ runner.os == 'Windows' }} - shell: powershell run: | - .\build.ps1 -configuration Release -verbosity Verbose -target CI --publish-all --archive + dotnet cake --configuration=Release --verbosity=Verbose --target=CI --publish-all --archive - name: ⬆ Publish Logs uses: actions/upload-artifact@v2 diff --git a/.github/workflows/tests-net6.yml b/.github/workflows/tests-net6.yml index 45b78a2ff6..57d2109e6b 100644 --- a/.github/workflows/tests-net6.yml +++ b/.github/workflows/tests-net6.yml @@ -4,7 +4,7 @@ env: DotNetVersion: "8.0.100-preview.4.23260.5" DotNetVersion2: "7.0.302" DotNetVersion3: "6.0.203" - NuGetVersion: "5.7.0" + NuGetVersion: "6.5.0" MonoVersion: "6.12.0" Artifacts: ${{ github.workspace }}/artifacts/ Coverage: ${{ github.workspace }}/coverage/ @@ -18,7 +18,6 @@ on: - 'CHANGELOG.md' branches: - master - - demo/* - feature/* tags: - '*' @@ -70,13 +69,7 @@ jobs: run: | nuget install tools/packages.config -ExcludeVersion -OutputDirectory tools - # - name: 🍰 Run Cake - # run: | - # dotnet cake --bootstrap - # dotnet cake --configuration=Debug --verbosity=Diagnostic --target=Test --test-project="${{ matrix.testProjects }}" - - name: 🍰 Run Cake - if: ${{ runner.os == 'Linux' || runner.os == 'macOS' }} uses: nick-invision/retry@v2 with: shell: bash @@ -84,22 +77,7 @@ jobs: max_attempts: 3 retry_on: error command: | - echo $PATH - chmod 755 ./build.sh - ./build.sh --configuration Release --verbosity Verbose --target Test --test-project="$TEST_PROJECT" --use-dotnet-test - env: - TEST_PROJECT: ${{ matrix.testProjects }} - - - name: 🍰 Run Cake - if: ${{ runner.os == 'Windows' }} - uses: nick-invision/retry@v2 - with: - shell: powershell - timeout_minutes: 40 - max_attempts: 3 - retry_on: error - command: | - .\build.ps1 -configuration Release -verbosity Verbose -target Test --test-project="$ENV:TEST_PROJECT" --use-dotnet-test + dotnet cake --configuration=Release --verbosity=Verbose --target=Test --test-project="$TEST_PROJECT" --use-dotnet-test env: TEST_PROJECT: ${{ matrix.testProjects }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4d11f823af..cb77008bc2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -4,7 +4,7 @@ env: DotNetVersion: "8.0.100-preview.4.23260.5" DotNetVersion2: "7.0.302" DotNetVersion3: "6.0.203" - NuGetVersion: "5.7.0" + NuGetVersion: "6.5.0" MonoVersion: "6.12.0" Artifacts: ${{ github.workspace }}/artifacts/ Coverage: ${{ github.workspace }}/coverage/ @@ -14,6 +14,8 @@ defaults: shell: pwsh on: pull_request: + paths-ignore: + - 'CHANGELOG.md' branches: - master - feature/* @@ -67,13 +69,7 @@ jobs: run: | nuget install tools/packages.config -ExcludeVersion -OutputDirectory tools - # - name: 🍰 Run Cake - # run: | - # dotnet cake --bootstrap - # dotnet cake --configuration=Debug --verbosity=Diagnostic --target=Test --test-project="${{ matrix.testProjects }}" - - name: 🍰 Run Cake - if: ${{ runner.os == 'Linux' || runner.os == 'macOS' }} uses: nick-invision/retry@v2 with: shell: bash @@ -81,22 +77,7 @@ jobs: max_attempts: 3 retry_on: error command: | - echo $PATH - chmod 755 ./build.sh - ./build.sh --configuration Release --verbosity Verbose --target Test --test-project="$TEST_PROJECT" - env: - TEST_PROJECT: ${{ matrix.testProjects }} - - - name: 🍰 Run Cake - if: ${{ runner.os == 'Windows' }} - uses: nick-invision/retry@v2 - with: - shell: powershell - timeout_minutes: 40 - max_attempts: 3 - retry_on: error - command: | - .\build.ps1 -configuration Release -verbosity Verbose -target Test --test-project="$ENV:TEST_PROJECT" + dotnet cake --configuration=Release --verbosity=Verbose --target=Test --test-project="$TEST_PROJECT" env: TEST_PROJECT: ${{ matrix.testProjects }} diff --git a/.pipelines/init.yml b/.pipelines/init.yml index 9364677b1e..579685656c 100644 --- a/.pipelines/init.yml +++ b/.pipelines/init.yml @@ -56,7 +56,7 @@ steps: arguments: install tools/packages.config -ExcludeVersion -OutputDirectory tools - ${{ if ne(parameters.MonoVersion, '') }}: - script: | - curl -o mono.pkg https://download.mono-project.com/archive/$MONO_VERSION/macos-10-universal/MonoFramework-MDK-$MONO_VERSION.90.macos10.xamarin.universal.pkg + curl -o mono.pkg https://download.mono-project.com/archive/$MONO_VERSION/macos-10-universal/MonoFramework-MDK-$MONO_VERSION.182.macos10.xamarin.universal.pkg sudo installer -pkg mono.pkg -target / sudo cp -rf /Library/Frameworks/Mono.framework/Versions/$MONO_VERSION/ /Library/Frameworks/Mono.framework/Versions/Current/ MONOPREFIX=/Library/Frameworks/Mono.framework/Versions/$MONO_VERSION diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 3ffbc0e27d..6b3c49bedd 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -32,9 +32,9 @@ resources: variables: Verbosity: Diagnostic - DotNetVersion: "6.0.400" - CakeVersion: "1.1.0" - NuGetVersion: "5.7.0" + DotNetVersion: "8.0.100-preview.4.23260.5" + CakeVersion: "3.0.0" + NuGetVersion: "6.5.0" GitVersionVersion: "5.0.1" MonoVersion: "6.12.0" Coverage: "$(Agent.BuildDirectory)/c" diff --git a/build.ps1 b/build.ps1 index f6dc870ccb..d91db09819 100644 --- a/build.ps1 +++ b/build.ps1 @@ -104,7 +104,6 @@ $TOOLS_DIR = Join-Path $PSScriptRoot "tools" $ADDINS_DIR = Join-Path $TOOLS_DIR "Addins" $MODULES_DIR = Join-Path $TOOLS_DIR "Modules" $NUGET_EXE = Join-Path $TOOLS_DIR "nuget.exe" -$CAKE_EXE = Join-Path $TOOLS_DIR "Cake/Cake.exe" $NUGET_URL = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe" $PACKAGES_CONFIG = Join-Path $TOOLS_DIR "packages.config" $PACKAGES_CONFIG_MD5 = Join-Path $TOOLS_DIR "packages.config.md5sum" @@ -214,14 +213,7 @@ if (Test-Path $MODULES_PACKAGES_CONFIG) { Pop-Location } -Invoke-Expression "&dotnet tool restore" - -# Make sure that Cake has been installed. -if (!(Test-Path $CAKE_EXE)) { - Throw "Could not find Cake.exe at $CAKE_EXE" -} - - +dotnet tool restore # Build Cake arguments $cakeArguments = @("$Script"); @@ -237,6 +229,5 @@ $cakeArguments += $ScriptArgs # Start Cake Write-Host "Running build script..." -# &$CAKE_EXE $cakeArguments dotnet cake $cakeArguments exit $LASTEXITCODE diff --git a/scripts/cake-bootstrap.sh b/scripts/cake-bootstrap.sh index e6df9fb29d..952cb18407 100644 --- a/scripts/cake-bootstrap.sh +++ b/scripts/cake-bootstrap.sh @@ -10,7 +10,6 @@ SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) TOOLS_DIR=$SCRIPT_DIR/../tools NUGET_EXE=$TOOLS_DIR/nuget.exe -CAKE_EXE=$TOOLS_DIR/Cake/Cake.exe PACKAGES_CONFIG=$TOOLS_DIR/packages.config PACKAGES_CONFIG_MD5=$TOOLS_DIR/packages.config.md5sum @@ -89,17 +88,9 @@ popd >/dev/null dotnet tool restore -# Make sure that Cake has been installed. -if [ ! -f "$CAKE_EXE" ]; then - echo "Could not find Cake.exe at '$CAKE_EXE'." - exit 1 -fi - # Start Cake if $SHOW_VERSION; then - # exec mono "$CAKE_EXE" --version dotnet cake --version else - # exec mono "$CAKE_EXE" $SCRIPT --verbosity=$VERBOSITY --configuration=$CONFIGURATION --target=$TARGET $DRYRUN "${SCRIPT_ARGUMENTS[@]}" dotnet cake $SCRIPT --verbosity=$VERBOSITY --configuration=$CONFIGURATION --target=$TARGET $DRYRUN "${SCRIPT_ARGUMENTS[@]}" fi diff --git a/tools/packages.config b/tools/packages.config index 07ba295eab..1da49565b7 100644 --- a/tools/packages.config +++ b/tools/packages.config @@ -1,7 +1,6 @@ -