From 2ad551f705d8db004d23c4122e7b7ef9dc6411fd Mon Sep 17 00:00:00 2001 From: Fredric Silberberg Date: Tue, 24 Nov 2020 15:34:27 -0800 Subject: [PATCH 01/35] Prototype of omnisharp running as a .NET 5.0 process. Several hacks and lots of work to be done, but it runs on windows! --- build.cake | 53 +++++++++++++------ build.json | 3 +- build/Packages.props | 36 +++++++------ .../OmniSharp.Abstractions.csproj | 2 +- .../OmniSharp.DotNetTest.csproj | 34 ++++++------ .../MSBuild/Discovery/MSBuildLocator.cs | 2 +- .../Providers/StandAloneInstanceProvider.cs | 4 +- src/OmniSharp.Host/OmniSharp.Host.csproj | 2 +- .../OmniSharpDocumentFormatRangeHandler.cs | 1 + ...mniSharpDocumentOnTypeFormattingHandler.cs | 1 + .../Helpers.cs | 3 +- .../OmniSharp.LanguageServerProtocol.csproj | 2 +- .../OmniSharp.MSBuild.csproj | 21 ++++++-- .../OmniSharp.Roslyn.CSharp.csproj | 2 +- .../Refactoring/V2/BaseCodeActionService.cs | 4 +- src/OmniSharp.Roslyn/OmniSharp.Roslyn.csproj | 2 +- src/OmniSharp.Script/OmniSharp.Script.csproj | 2 +- src/OmniSharp.Shared/OmniSharp.Shared.csproj | 2 +- .../OmniSharp.Stdio.Driver.csproj | 2 +- src/OmniSharp.Stdio/OmniSharp.Stdio.csproj | 4 +- tools/packages.config | 9 ++-- 21 files changed, 117 insertions(+), 74 deletions(-) diff --git a/build.cake b/build.cake index aa3923b437..308e93939d 100644 --- a/build.cake +++ b/build.cake @@ -313,11 +313,23 @@ Task("CreateMSBuildFolder") foreach (var library in msbuildLibraries) { var libraryFileName = library + ".dll"; - var librarySourcePath = CombinePaths(env.Folders.Tools, library, "lib", "net472", libraryFileName); - var libraryTargetPath = CombinePaths(msbuildCurrentBinTargetFolder, libraryFileName); - if (FileHelper.Exists(librarySourcePath)) + + if (!TryCopyFromFramework("netcoreapp2.1")) { - FileHelper.Copy(librarySourcePath, libraryTargetPath); + _ = TryCopyFromFramework("netstandard2.0"); + } + + bool TryCopyFromFramework(string frameworkVersion) + { + var librarySourcePath = CombinePaths(env.Folders.Tools, library, "lib", frameworkVersion, libraryFileName); + var libraryTargetPath = CombinePaths(msbuildCurrentBinTargetFolder, libraryFileName); + if (FileHelper.Exists(librarySourcePath)) + { + FileHelper.Copy(librarySourcePath, libraryTargetPath); + return true; + } + + return false; } } @@ -336,7 +348,7 @@ Task("CreateMSBuildFolder") // Copy MSBuild SDK Resolver and DotNetHostResolver Information("Copying MSBuild SDK resolver..."); - var msbuildSdkResolverSourceFolder = CombinePaths(env.Folders.Tools, "Microsoft.DotNet.MSBuildSdkResolver", "lib", "net472"); + var msbuildSdkResolverSourceFolder = CombinePaths(env.Folders.Tools, "Microsoft.DotNet.MSBuildSdkResolver", "lib", "net5.0"); var msbuildSdkResolverTargetFolder = CombinePaths(msbuildCurrentBinTargetFolder, "SdkResolvers", "Microsoft.DotNet.MSBuildSdkResolver"); DirectoryHelper.ForceCreate(msbuildSdkResolverTargetFolder); FileHelper.Copy( @@ -359,7 +371,7 @@ Task("CreateMSBuildFolder") } Information("Copying NuGet SDK resolver..."); - var nugetSdkResolverSourceFolder = CombinePaths(env.Folders.Tools, "Microsoft.Build.NuGetSdkResolver", "lib", "net472"); + var nugetSdkResolverSourceFolder = CombinePaths(env.Folders.Tools, "Microsoft.Build.NuGetSdkResolver", "lib", "netstandard2.0"); var nugetSdkResolverTargetFolder = CombinePaths(msbuildCurrentBinTargetFolder, "SdkResolvers", "Microsoft.Build.NuGetSdkResolver"); DirectoryHelper.ForceCreate(nugetSdkResolverTargetFolder); FileHelper.Copy( @@ -376,7 +388,7 @@ Task("CreateMSBuildFolder") // Copy content of NuGet.Build.Tasks var nugetBuildTasksFolder = CombinePaths(env.Folders.Tools, "NuGet.Build.Tasks"); - var nugetBuildTasksBinariesFolder = CombinePaths(nugetBuildTasksFolder, "lib", "net472"); + var nugetBuildTasksBinariesFolder = CombinePaths(nugetBuildTasksFolder, "lib", "netstandard2.0"); var nugetBuildTasksTargetsFolder = CombinePaths(nugetBuildTasksFolder, "runtimes", "any", "native"); FileHelper.Copy( @@ -408,18 +420,18 @@ Task("CreateMSBuildFolder") var binaryName = nugetPackage + ".dll"; FileHelper.Copy( - source: CombinePaths(env.Folders.Tools, nugetPackage, "lib", "net472", binaryName), + source: CombinePaths(env.Folders.Tools, nugetPackage, "lib", "netstandard2.0", binaryName), destination: CombinePaths(msbuildCurrentBinTargetFolder, binaryName)); } // Copy additional dependency of Microsoft.Build.NuGetSdkResolver FileHelper.Copy( - source: CombinePaths(env.Folders.Tools, "Newtonsoft.Json", "lib", "net45", "Newtonsoft.Json.dll"), + source: CombinePaths(env.Folders.Tools, "Newtonsoft.Json", "lib", "netstandard2.0", "Newtonsoft.Json.dll"), destination: CombinePaths(msbuildCurrentBinTargetFolder, "Newtonsoft.Json.dll")); // Copy content of Microsoft.Net.Compilers.Toolset Information("Copying Microsoft.Net.Compilers.Toolset..."); - var compilersSourceFolder = CombinePaths(env.Folders.Tools, "Microsoft.Net.Compilers.Toolset", "tasks", "net472"); + var compilersSourceFolder = CombinePaths(env.Folders.Tools, "Microsoft.Net.Compilers.Toolset", "tasks", "netcoreapp3.1"); var compilersTargetFolder = CombinePaths(msbuildCurrentBinTargetFolder, "Roslyn"); DirectoryHelper.Copy(compilersSourceFolder, compilersTargetFolder); @@ -433,23 +445,33 @@ Task("CreateMSBuildFolder") FileHelper.Delete(CombinePaths(compilersTargetFolder, "vbc.exe.config")); FileHelper.Delete(CombinePaths(compilersTargetFolder, "vbc.rsp")); + FileHelper.Copy( + source: CombinePaths(env.Folders.Tools, "System.CodeDom", "lib", "netstandard2.0", "System.CodeDom.dll"), + destination: CombinePaths(msbuildCurrentBinTargetFolder, "System.CodeDom.dll"), + overwrite: true); + FileHelper.Copy( - source: CombinePaths(env.Folders.Tools, "SQLitePCLRaw.core", "lib", "net45", "SQLitePCLRaw.core.dll"), + source: CombinePaths(env.Folders.Tools, "Microsoft.Net.HostModel", "lib", "netstandard2.0", "Microsoft.Net.HostModel.dll"), + destination: CombinePaths(msbuildCurrentBinTargetFolder, "Microsoft.Net.HostModel.dll"), + overwrite: true); + + FileHelper.Copy( + source: CombinePaths(env.Folders.Tools, "SQLitePCLRaw.core", "lib", "netstandard2.0", "SQLitePCLRaw.core.dll"), destination: CombinePaths(msbuildCurrentBinTargetFolder, "SQLitePCLRaw.core.dll"), overwrite: true); FileHelper.Copy( - source: CombinePaths(env.Folders.Tools, "SQLitePCLRaw.provider.e_sqlite3.net45", "lib", "net45", "SQLitePCLRaw.provider.e_sqlite3.dll"), + source: CombinePaths(env.Folders.Tools, "SQLitePCLRaw.provider.e_sqlite3.netstandard11", "lib", "netstandard1.1", "SQLitePCLRaw.provider.e_sqlite3.dll"), destination: CombinePaths(msbuildCurrentBinTargetFolder, "SQLitePCLRaw.provider.e_sqlite3.dll"), overwrite: true); FileHelper.Copy( - source: CombinePaths(env.Folders.Tools, "SQLitePCLRaw.bundle_green", "lib", "net45", "SQLitePCLRaw.batteries_v2.dll"), + source: CombinePaths(env.Folders.Tools, "SQLitePCLRaw.bundle_green", "lib", "netcoreapp3.1", "SQLitePCLRaw.batteries_v2.dll"), destination: CombinePaths(msbuildCurrentBinTargetFolder, "SQLitePCLRaw.batteries_v2.dll"), overwrite: true); FileHelper.Copy( - source: CombinePaths(env.Folders.Tools, "SQLitePCLRaw.bundle_green", "lib", "net45", "SQLitePCLRaw.batteries_green.dll"), + source: CombinePaths(env.Folders.Tools, "SQLitePCLRaw.bundle_green", "lib", "netcoreapp3.1", "SQLitePCLRaw.nativelibrary.dll"), destination: CombinePaths(msbuildCurrentBinTargetFolder, "SQLitePCLRaw.batteries_green.dll"), overwrite: true); @@ -765,7 +787,8 @@ string PublishWindowsBuild(string project, BuildEnvironment env, BuildPlan plan, { DotNetCorePublish(projectFileName, new DotNetCorePublishSettings() { - // 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. + Framework = "net5.0", + 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. Configuration = configuration, OutputDirectory = outputFolder, MSBuildSettings = new DotNetCoreMSBuildSettings() diff --git a/build.json b/build.json index 0917a2b505..7d2a207e58 100644 --- a/build.json +++ b/build.json @@ -12,8 +12,7 @@ "MonoRuntimeLinux32": "mono.linux-x86-6.12.0.90.zip", "MonoRuntimeLinux64": "mono.linux-x86_64-6.12.0.90.zip", "HostProjects": [ - "OmniSharp.Stdio.Driver", - "OmniSharp.Http.Driver" + "OmniSharp.Stdio.Driver" ], "TestProjects": [ "OmniSharp.MSBuild.Tests", diff --git a/build/Packages.props b/build/Packages.props index da54845ed3..15646f0241 100644 --- a/build/Packages.props +++ b/build/Packages.props @@ -4,7 +4,7 @@ 16.8.0 - 5.2.0 + 5.8.0 3.9.0-2.20570.24 2.4.1 @@ -34,24 +34,25 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + + @@ -65,12 +66,13 @@ - + - + + diff --git a/src/OmniSharp.Abstractions/OmniSharp.Abstractions.csproj b/src/OmniSharp.Abstractions/OmniSharp.Abstractions.csproj index 7797079b5e..b0952b8d5d 100644 --- a/src/OmniSharp.Abstractions/OmniSharp.Abstractions.csproj +++ b/src/OmniSharp.Abstractions/OmniSharp.Abstractions.csproj @@ -1,7 +1,7 @@  - net472;netcoreapp2.1;netstandard2.0 + net472;net5.0;netstandard2.0 AnyCPU OmniSharp true diff --git a/src/OmniSharp.DotNetTest/OmniSharp.DotNetTest.csproj b/src/OmniSharp.DotNetTest/OmniSharp.DotNetTest.csproj index a1cfe0d5ef..9131be748e 100644 --- a/src/OmniSharp.DotNetTest/OmniSharp.DotNetTest.csproj +++ b/src/OmniSharp.DotNetTest/OmniSharp.DotNetTest.csproj @@ -1,23 +1,25 @@  - - net472 - AnyCPU - + + net472;net5.0 + AnyCPU + - - - - + + + + - - - - + + + + - - - - + + + + + + diff --git a/src/OmniSharp.Host/MSBuild/Discovery/MSBuildLocator.cs b/src/OmniSharp.Host/MSBuild/Discovery/MSBuildLocator.cs index 226a5ce871..b8702a2be2 100644 --- a/src/OmniSharp.Host/MSBuild/Discovery/MSBuildLocator.cs +++ b/src/OmniSharp.Host/MSBuild/Discovery/MSBuildLocator.cs @@ -58,7 +58,7 @@ public static MSBuildLocator CreateDefault(ILoggerFactory loggerFactory, IAssemb return new MSBuildLocator(loggerFactory, assemblyLoader, ImmutableArray.Create( new DevConsoleInstanceProvider(loggerFactory), - new VisualStudioInstanceProvider(loggerFactory), + //new VisualStudioInstanceProvider(loggerFactory), new MonoInstanceProvider(loggerFactory), new StandAloneInstanceProvider(loggerFactory), new UserOverrideInstanceProvider(loggerFactory, msbuildConfiguration))); diff --git a/src/OmniSharp.Host/MSBuild/Discovery/Providers/StandAloneInstanceProvider.cs b/src/OmniSharp.Host/MSBuild/Discovery/Providers/StandAloneInstanceProvider.cs index 30276dcb44..69e9ffb4c0 100644 --- a/src/OmniSharp.Host/MSBuild/Discovery/Providers/StandAloneInstanceProvider.cs +++ b/src/OmniSharp.Host/MSBuild/Discovery/Providers/StandAloneInstanceProvider.cs @@ -25,7 +25,7 @@ public override ImmutableArray GetInstances() var extensionsPath = path; var toolsPath = Path.Combine(extensionsPath, "Current", "Bin"); - var roslynPath = Path.Combine(toolsPath, "Roslyn"); + var roslynPath = Path.Combine(toolsPath, "Roslyn", "bincore"); var version = GetMSBuildVersion(Path.Combine(toolsPath, "Microsoft.Build.dll")); @@ -44,7 +44,7 @@ public override ImmutableArray GetInstances() propertyOverrides.Add("MSBuildToolsPath", toolsPath); propertyOverrides.Add("MSBuildExtensionsPath", extensionsPath); propertyOverrides.Add("CscToolPath", roslynPath); - propertyOverrides.Add("CscToolExe", "csc.exe"); + //propertyOverrides.Add("CscToolExe", "csc.exe"); return ImmutableArray.Create( new MSBuildInstance( diff --git a/src/OmniSharp.Host/OmniSharp.Host.csproj b/src/OmniSharp.Host/OmniSharp.Host.csproj index a70eb95eac..8d3cbd1739 100644 --- a/src/OmniSharp.Host/OmniSharp.Host.csproj +++ b/src/OmniSharp.Host/OmniSharp.Host.csproj @@ -1,7 +1,7 @@  - net472;netcoreapp2.1;netstandard2.0 + net472;net5.0;netstandard2.0 AnyCPU OmniSharp true diff --git a/src/OmniSharp.LanguageServerProtocol/Handlers/OmniSharpDocumentFormatRangeHandler.cs b/src/OmniSharp.LanguageServerProtocol/Handlers/OmniSharpDocumentFormatRangeHandler.cs index f1db672458..67122492a0 100644 --- a/src/OmniSharp.LanguageServerProtocol/Handlers/OmniSharpDocumentFormatRangeHandler.cs +++ b/src/OmniSharp.LanguageServerProtocol/Handlers/OmniSharpDocumentFormatRangeHandler.cs @@ -8,6 +8,7 @@ using OmniSharp.Extensions.LanguageServer.Protocol.Models; using OmniSharp.Extensions.LanguageServer.Protocol.Server; using OmniSharp.Models.Format; +using Range = OmniSharp.Extensions.LanguageServer.Protocol.Models.Range; namespace OmniSharp.LanguageServerProtocol.Handlers { diff --git a/src/OmniSharp.LanguageServerProtocol/Handlers/OmniSharpDocumentOnTypeFormattingHandler.cs b/src/OmniSharp.LanguageServerProtocol/Handlers/OmniSharpDocumentOnTypeFormattingHandler.cs index 8f6b51e336..73a530454d 100644 --- a/src/OmniSharp.LanguageServerProtocol/Handlers/OmniSharpDocumentOnTypeFormattingHandler.cs +++ b/src/OmniSharp.LanguageServerProtocol/Handlers/OmniSharpDocumentOnTypeFormattingHandler.cs @@ -8,6 +8,7 @@ using OmniSharp.Extensions.LanguageServer.Protocol.Models; using OmniSharp.Extensions.LanguageServer.Protocol.Server; using OmniSharp.Models.Format; +using Range = OmniSharp.Extensions.LanguageServer.Protocol.Models.Range; namespace OmniSharp.LanguageServerProtocol.Handlers { diff --git a/src/OmniSharp.LanguageServerProtocol/Helpers.cs b/src/OmniSharp.LanguageServerProtocol/Helpers.cs index 326e2aff60..ed4ea1f354 100644 --- a/src/OmniSharp.LanguageServerProtocol/Helpers.cs +++ b/src/OmniSharp.LanguageServerProtocol/Helpers.cs @@ -2,14 +2,13 @@ using System.Collections.Generic; using System.IO; using System.Linq; -using System.Text.RegularExpressions; -using Microsoft.VisualStudio.TestPlatform.CoreUtilities.Extensions; using OmniSharp.Extensions.LanguageServer.Protocol; using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; using OmniSharp.Extensions.LanguageServer.Protocol.Models; using OmniSharp.LanguageServerProtocol.Handlers; using OmniSharp.Models; using OmniSharp.Models.Diagnostics; +using Range = OmniSharp.Extensions.LanguageServer.Protocol.Models.Range; namespace OmniSharp.LanguageServerProtocol { diff --git a/src/OmniSharp.LanguageServerProtocol/OmniSharp.LanguageServerProtocol.csproj b/src/OmniSharp.LanguageServerProtocol/OmniSharp.LanguageServerProtocol.csproj index db500319f9..f70410af03 100644 --- a/src/OmniSharp.LanguageServerProtocol/OmniSharp.LanguageServerProtocol.csproj +++ b/src/OmniSharp.LanguageServerProtocol/OmniSharp.LanguageServerProtocol.csproj @@ -1,7 +1,7 @@  - net472 + net472;net5.0 AnyCPU OmniSharp.LanguageServerProtocol true diff --git a/src/OmniSharp.MSBuild/OmniSharp.MSBuild.csproj b/src/OmniSharp.MSBuild/OmniSharp.MSBuild.csproj index 5fc93944f6..1a2ad558bd 100644 --- a/src/OmniSharp.MSBuild/OmniSharp.MSBuild.csproj +++ b/src/OmniSharp.MSBuild/OmniSharp.MSBuild.csproj @@ -1,7 +1,7 @@  - net472;netcoreapp2.1 + net472;net5.0 AnyCPU true true @@ -20,10 +20,23 @@ - - - + + + + + + + + + + + + + + + + diff --git a/src/OmniSharp.Roslyn.CSharp/OmniSharp.Roslyn.CSharp.csproj b/src/OmniSharp.Roslyn.CSharp/OmniSharp.Roslyn.CSharp.csproj index e7787704e8..935ba2d695 100644 --- a/src/OmniSharp.Roslyn.CSharp/OmniSharp.Roslyn.CSharp.csproj +++ b/src/OmniSharp.Roslyn.CSharp/OmniSharp.Roslyn.CSharp.csproj @@ -1,7 +1,7 @@  - net472;netcoreapp2.1;netstandard2.0 + net472;net5.0;netstandard2.0 AnyCPU true true diff --git a/src/OmniSharp.Roslyn.CSharp/Services/Refactoring/V2/BaseCodeActionService.cs b/src/OmniSharp.Roslyn.CSharp/Services/Refactoring/V2/BaseCodeActionService.cs index 0097058eb4..add154fc35 100644 --- a/src/OmniSharp.Roslyn.CSharp/Services/Refactoring/V2/BaseCodeActionService.cs +++ b/src/OmniSharp.Roslyn.CSharp/Services/Refactoring/V2/BaseCodeActionService.cs @@ -36,7 +36,7 @@ public abstract class BaseCodeActionService : IRequestHandl protected readonly ILogger Logger; private readonly ICsDiagnosticWorker _diagnostics; private readonly CachingCodeFixProviderForProjects _codeFixesForProject; - private readonly MethodInfo _getNestedCodeActions; + private readonly MethodInfo? _getNestedCodeActions; protected Lazy> OrderedCodeRefactoringProviders; @@ -376,7 +376,7 @@ protected async Task> GetDiagnosticsAsync(Fi private static string GetNewFilePath(string newFileName, string currentFilePath) { var directory = Path.GetDirectoryName(currentFilePath); - return Path.Combine(directory, newFileName); + return Path.Combine(directory ?? string.Empty, newFileName); } } } diff --git a/src/OmniSharp.Roslyn/OmniSharp.Roslyn.csproj b/src/OmniSharp.Roslyn/OmniSharp.Roslyn.csproj index daa26b3a9b..b8d82ea910 100644 --- a/src/OmniSharp.Roslyn/OmniSharp.Roslyn.csproj +++ b/src/OmniSharp.Roslyn/OmniSharp.Roslyn.csproj @@ -1,7 +1,7 @@  - net472;netcoreapp2.1;netstandard2.0 + net472;net5.0;netstandard2.0 AnyCPU true true diff --git a/src/OmniSharp.Script/OmniSharp.Script.csproj b/src/OmniSharp.Script/OmniSharp.Script.csproj index ef7e81958a..0086e24879 100644 --- a/src/OmniSharp.Script/OmniSharp.Script.csproj +++ b/src/OmniSharp.Script/OmniSharp.Script.csproj @@ -1,7 +1,7 @@  - net472 + net472;net5.0 AnyCPU diff --git a/src/OmniSharp.Shared/OmniSharp.Shared.csproj b/src/OmniSharp.Shared/OmniSharp.Shared.csproj index e24cfa6582..71e20432aa 100644 --- a/src/OmniSharp.Shared/OmniSharp.Shared.csproj +++ b/src/OmniSharp.Shared/OmniSharp.Shared.csproj @@ -1,7 +1,7 @@  - net472;netcoreapp2.1;netstandard2.0 + net472;net5.0;netstandard2.0 AnyCPU OmniSharp true diff --git a/src/OmniSharp.Stdio.Driver/OmniSharp.Stdio.Driver.csproj b/src/OmniSharp.Stdio.Driver/OmniSharp.Stdio.Driver.csproj index f3ede584f8..e5dbb6fdfc 100644 --- a/src/OmniSharp.Stdio.Driver/OmniSharp.Stdio.Driver.csproj +++ b/src/OmniSharp.Stdio.Driver/OmniSharp.Stdio.Driver.csproj @@ -1,7 +1,7 @@  - net472 + net472;net5.0 AnyCPU OmniSharp Exe diff --git a/src/OmniSharp.Stdio/OmniSharp.Stdio.csproj b/src/OmniSharp.Stdio/OmniSharp.Stdio.csproj index ae3f0d04df..4363e80e6e 100644 --- a/src/OmniSharp.Stdio/OmniSharp.Stdio.csproj +++ b/src/OmniSharp.Stdio/OmniSharp.Stdio.csproj @@ -1,7 +1,7 @@  - net472 + net472;net5.0 AnyCPU @@ -12,7 +12,7 @@ - + diff --git a/tools/packages.config b/tools/packages.config index 644396143f..62437e7778 100644 --- a/tools/packages.config +++ b/tools/packages.config @@ -8,6 +8,7 @@ + @@ -28,10 +29,12 @@ - - - + + + + + From 719d7c70c17f1f50d384d302983bb64f572523db Mon Sep 17 00:00:00 2001 From: filipw Date: Fri, 25 Dec 2020 01:18:48 +0100 Subject: [PATCH 02/35] small build script tweaks --- build.cake | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/build.cake b/build.cake index 308e93939d..16aa4416c7 100644 --- a/build.cake +++ b/build.cake @@ -136,6 +136,11 @@ Task("InstallMonoAssets") .WithCriteria(() => !Platform.Current.IsWindows) .Does(() => { + if (DirectoryHelper.Exists(env.Folders.Mono)) + { + Information($"'{env.Folders.Mono}' folder exists... Skipping acquiring of Mono assets."); + return; + } Information("Acquiring Mono runtimes and framework..."); DownloadFileAndUnzip($"{buildPlan.DownloadURL}/{buildPlan.MonoRuntimeMacOS}", env.Folders.MonoRuntimeMacOS); @@ -670,7 +675,7 @@ void CopyMonoBuild(BuildEnvironment env, string sourceFolder, string outputFolde // Copy dependencies of Mono build FileHelper.Copy( - source: CombinePaths(env.Folders.Tools, "SQLitePCLRaw.core", "lib", "net45", "SQLitePCLRaw.core.dll"), + source: CombinePaths(env.Folders.Tools, "SQLitePCLRaw.core", "lib", "netstandard2.0", "SQLitePCLRaw.core.dll"), destination: CombinePaths(msbuildBinFolder, "SQLitePCLRaw.core.dll"), overwrite: true); @@ -680,12 +685,12 @@ void CopyMonoBuild(BuildEnvironment env, string sourceFolder, string outputFolde overwrite: true); FileHelper.Copy( - source: CombinePaths(env.Folders.Tools, "SQLitePCLRaw.bundle_green", "lib", "net45", "SQLitePCLRaw.batteries_v2.dll"), + source: CombinePaths(env.Folders.Tools, "SQLitePCLRaw.bundle_green", "lib", "net461", "SQLitePCLRaw.batteries_v2.dll"), destination: CombinePaths(msbuildBinFolder, "SQLitePCLRaw.batteries_v2.dll"), overwrite: true); FileHelper.Copy( - source: CombinePaths(env.Folders.Tools, "SQLitePCLRaw.bundle_green", "lib", "net45", "SQLitePCLRaw.batteries_green.dll"), + source: CombinePaths(env.Folders.Tools, "SQLitePCLRaw.bundle_green", "lib", "net461", "SQLitePCLRaw.nativelibrary.dll"), destination: CombinePaths(msbuildBinFolder, "SQLitePCLRaw.batteries_green.dll"), overwrite: true); } @@ -710,7 +715,7 @@ string PublishMonoBuild(string project, BuildEnvironment env, BuildPlan plan, st // Copy dependencies of Mono build FileHelper.Copy( - source: CombinePaths(env.Folders.Tools, "SQLitePCLRaw.core", "lib", "net45", "SQLitePCLRaw.core.dll"), + source: CombinePaths(env.Folders.Tools, "SQLitePCLRaw.core", "lib", "netstandard2.0", "SQLitePCLRaw.core.dll"), destination: CombinePaths(outputFolder, "SQLitePCLRaw.core.dll"), overwrite: true); FileHelper.Copy( @@ -718,13 +723,13 @@ string PublishMonoBuild(string project, BuildEnvironment env, BuildPlan plan, st destination: CombinePaths(outputFolder, "SQLitePCLRaw.provider.e_sqlite3.dll"), overwrite: true); FileHelper.Copy( - source: CombinePaths(env.Folders.Tools, "SQLitePCLRaw.bundle_green", "lib", "net45", "SQLitePCLRaw.batteries_v2.dll"), + source: CombinePaths(env.Folders.Tools, "SQLitePCLRaw.bundle_green", "lib", "net461", "SQLitePCLRaw.batteries_v2.dll"), destination: CombinePaths(outputFolder, "SQLitePCLRaw.batteries_v2.dll"), overwrite: true); - FileHelper.Copy( - source: CombinePaths(env.Folders.Tools, "SQLitePCLRaw.bundle_green", "lib", "net45", "SQLitePCLRaw.batteries_green.dll"), - destination: CombinePaths(outputFolder, "SQLitePCLRaw.batteries_green.dll"), - overwrite: true); + FileHelper.Copy( + source: CombinePaths(env.Folders.Tools, "SQLitePCLRaw.bundle_green", "lib", "net461", "SQLitePCLRaw.nativelibrary.dll"), + destination: CombinePaths(outputFolder, "SQLitePCLRaw.batteries_green.dll"), + overwrite: true); Package(project, "mono", outputFolder, env.Folders.ArtifactsPackage, env.Folders.DeploymentPackage); From 992394cddcb22ec1b5e83f69a9ff9a4d6aa77bc3 Mon Sep 17 00:00:00 2001 From: filipw Date: Fri, 25 Dec 2020 08:20:56 +0100 Subject: [PATCH 03/35] updated testplatform --- build/Packages.props | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/build/Packages.props b/build/Packages.props index 15646f0241..a3bf3203f6 100644 --- a/build/Packages.props +++ b/build/Packages.props @@ -50,11 +50,11 @@ - - - + + + - + @@ -70,16 +70,13 @@ + - + - - - - From e30fac40ff5609767164ad105d721936f8e29819 Mon Sep 17 00:00:00 2001 From: filipw Date: Fri, 25 Dec 2020 23:20:13 +0100 Subject: [PATCH 04/35] updated build script to publish 5.0 builds --- build.cake | 71 +++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 59 insertions(+), 12 deletions(-) diff --git a/build.cake b/build.cake index 16aa4416c7..215f33feb2 100644 --- a/build.cake +++ b/build.cake @@ -780,19 +780,63 @@ Task("PublishMonoBuilds") } }); -string PublishWindowsBuild(string project, BuildEnvironment env, BuildPlan plan, string configuration, string rid) +Task("PublishNet5Builds") + .IsDependentOn("Setup") + .Does(() => +{ + foreach (var project in buildPlan.HostProjects) + { + if (publishAll) + { + PublishBuild(project, env, buildPlan, configuration, "linux-x64", "net5.0"); + PublishBuild(project, env, buildPlan, configuration, "osx-x64", "net5.0"); + PublishBuild(project, env, buildPlan, configuration, "win7-x86", "net5.0"); + PublishBuild(project, env, buildPlan, configuration, "win7-x64", "net5.0"); + PublishBuild(project, env, buildPlan, configuration, "win10-arm64", "net5.0"); + } + else if (Platform.Current.IsWindows) + { + if (Platform.Current.IsX86) + { + PublishBuild(project, env, buildPlan, configuration, "win7-x86", "net5.0"); + } + else if (Platform.Current.IsX64) + { + PublishBuild(project, env, buildPlan, configuration, "win7-x64", "net5.0"); + } + else + { + PublishBuild(project, env, buildPlan, configuration, "win10-arm64", "net5.0"); + } + } + else + { + if (Platform.Current.IsMacOS) + { + PublishBuild(project, env, buildPlan, configuration, "osx-x64", "net5.0"); + } + else + { + PublishBuild(project, env, buildPlan, configuration, "linux-x64", "net5.0"); + } + } + + } +}); + +string PublishBuild(string project, BuildEnvironment env, BuildPlan plan, string configuration, string rid, string framework) { var projectName = project + ".csproj"; var projectFileName = CombinePaths(env.Folders.Source, project, projectName); - var outputFolder = CombinePaths(env.Folders.ArtifactsPublish, project, rid); + var outputFolder = CombinePaths(env.Folders.ArtifactsPublish, project, rid, framework); Information("Publishing {0} for {1}...", projectName, rid); try { - DotNetCorePublish(projectFileName, new DotNetCorePublishSettings() + var publishSettings = new DotNetCorePublishSettings() { - Framework = "net5.0", + 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. Configuration = configuration, OutputDirectory = outputFolder, @@ -804,7 +848,8 @@ string PublishWindowsBuild(string project, BuildEnvironment env, BuildPlan plan, ToolPath = env.DotNetCommand, WorkingDirectory = env.WorkingDirectory, Verbosity = DotNetCoreVerbosity.Minimal, - }); + }; + DotNetCorePublish(projectFileName, publishSettings); } catch { @@ -817,7 +862,8 @@ string PublishWindowsBuild(string project, BuildEnvironment env, BuildPlan plan, CopyExtraDependencies(env, outputFolder); - Package(project, rid, outputFolder, env.Folders.ArtifactsPackage, env.Folders.DeploymentPackage); + var platformFolder = framework != "net472" ? $"{rid}-{framework}" : rid; + Package(project, platformFolder, outputFolder, env.Folders.ArtifactsPackage, env.Folders.DeploymentPackage); return outputFolder; } @@ -833,9 +879,9 @@ Task("PublishWindowsBuilds") if (publishAll) { - var outputFolderX86 = PublishWindowsBuild(project, env, buildPlan, configuration, "win7-x86"); - var outputFolderX64 = PublishWindowsBuild(project, env, buildPlan, configuration, "win7-x64"); - var outputFolderArm64 = PublishWindowsBuild(project, env, buildPlan, configuration, "win10-arm64"); + var outputFolderX86 = PublishBuild(project, env, buildPlan, configuration, "win7-x86", "net472"); + var outputFolderX64 = PublishBuild(project, env, buildPlan, configuration, "win7-x64", "net472"); + var outputFolderArm64 = PublishBuild(project, env, buildPlan, configuration, "win10-arm64", "net472"); outputFolder = Platform.Current.IsX86 ? outputFolderX86 @@ -845,15 +891,15 @@ Task("PublishWindowsBuilds") } else if (Platform.Current.IsX86) { - outputFolder = PublishWindowsBuild(project, env, buildPlan, configuration, "win7-x86"); + outputFolder = PublishBuild(project, env, buildPlan, configuration, "win7-x86", "net472"); } else if (Platform.Current.IsX64) { - outputFolder = PublishWindowsBuild(project, env, buildPlan, configuration, "win7-x64"); + outputFolder = PublishBuild(project, env, buildPlan, configuration, "win7-x64", "net472"); } else { - outputFolder = PublishWindowsBuild(project, env, buildPlan, configuration, "win10-arm64"); + outputFolder = PublishBuild(project, env, buildPlan, configuration, "win10-arm64", "net472"); } CreateRunScript(project, outputFolder, env.Folders.ArtifactsScripts); @@ -878,6 +924,7 @@ Task("PublishNuGet") Task("Publish") .IsDependentOn("Build") .IsDependentOn("PublishMonoBuilds") + .IsDependentOn("PublishNet5Builds") .IsDependentOn("PublishWindowsBuilds") .IsDependentOn("PublishNuGet"); From c570d7bf67d04afb977f5e5f68024dc05019fa85 Mon Sep 17 00:00:00 2001 From: filipw Date: Fri, 26 Feb 2021 20:38:49 +0100 Subject: [PATCH 05/35] some passing tests on .net 5.0 --- tests/OmniSharp.MSBuild.Tests/OmniSharp.MSBuild.Tests.csproj | 2 +- .../OmniSharp.Roslyn.CSharp.Tests.csproj | 2 +- tests/OmniSharp.Roslyn.CSharp.Tests/SemanticHighlightFacts.cs | 1 + tests/TestUtility/AbstractCodeActionsTestFixture.cs | 1 + tests/TestUtility/OmniSharpTestHost.cs | 4 ++-- tests/TestUtility/TestUtility.csproj | 4 ++-- tests/TestUtility/TextRange.cs | 1 + 7 files changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/OmniSharp.MSBuild.Tests/OmniSharp.MSBuild.Tests.csproj b/tests/OmniSharp.MSBuild.Tests/OmniSharp.MSBuild.Tests.csproj index 7b3bf2de24..4a67f5defb 100644 --- a/tests/OmniSharp.MSBuild.Tests/OmniSharp.MSBuild.Tests.csproj +++ b/tests/OmniSharp.MSBuild.Tests/OmniSharp.MSBuild.Tests.csproj @@ -1,7 +1,7 @@  - net472 + net472;net5.0 AnyCPU true diff --git a/tests/OmniSharp.Roslyn.CSharp.Tests/OmniSharp.Roslyn.CSharp.Tests.csproj b/tests/OmniSharp.Roslyn.CSharp.Tests/OmniSharp.Roslyn.CSharp.Tests.csproj index fbddead4eb..afe4e140ff 100644 --- a/tests/OmniSharp.Roslyn.CSharp.Tests/OmniSharp.Roslyn.CSharp.Tests.csproj +++ b/tests/OmniSharp.Roslyn.CSharp.Tests/OmniSharp.Roslyn.CSharp.Tests.csproj @@ -1,7 +1,7 @@  - net472 + net472;net5.0 AnyCPU true CS0618 diff --git a/tests/OmniSharp.Roslyn.CSharp.Tests/SemanticHighlightFacts.cs b/tests/OmniSharp.Roslyn.CSharp.Tests/SemanticHighlightFacts.cs index 71a17e9e5a..f06837944b 100644 --- a/tests/OmniSharp.Roslyn.CSharp.Tests/SemanticHighlightFacts.cs +++ b/tests/OmniSharp.Roslyn.CSharp.Tests/SemanticHighlightFacts.cs @@ -7,6 +7,7 @@ using TestUtility; using Xunit; using Xunit.Abstractions; +using Range = OmniSharp.Models.V2.Range; namespace OmniSharp.Roslyn.CSharp.Tests { diff --git a/tests/TestUtility/AbstractCodeActionsTestFixture.cs b/tests/TestUtility/AbstractCodeActionsTestFixture.cs index 6237e0b20b..b731208856 100644 --- a/tests/TestUtility/AbstractCodeActionsTestFixture.cs +++ b/tests/TestUtility/AbstractCodeActionsTestFixture.cs @@ -14,6 +14,7 @@ using TestUtility.Logging; using Xunit; using Xunit.Abstractions; +using Range = OmniSharp.Models.V2.Range; namespace TestUtility { diff --git a/tests/TestUtility/OmniSharpTestHost.cs b/tests/TestUtility/OmniSharpTestHost.cs index 2a739749e6..0b10ac679a 100644 --- a/tests/TestUtility/OmniSharpTestHost.cs +++ b/tests/TestUtility/OmniSharpTestHost.cs @@ -12,7 +12,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using OmniSharp; -using OmniSharp.Cake; +// using OmniSharp.Cake; using OmniSharp.DotNetTest.Models; using OmniSharp.Eventing; using OmniSharp.LanguageServerProtocol; @@ -38,7 +38,7 @@ public class OmniSharpTestHost : DisposableObject typeof(ScriptProjectSystem).GetTypeInfo().Assembly, // OmniSharp.Script typeof(OmniSharpWorkspace).GetTypeInfo().Assembly, // OmniSharp.Roslyn typeof(RoslynFeaturesHostServicesProvider).GetTypeInfo().Assembly, // OmniSharp.Roslyn.CSharp - typeof(CakeProjectSystem).GetTypeInfo().Assembly, // OmniSharp.Cake + // typeof(CakeProjectSystem).GetTypeInfo().Assembly, // OmniSharp.Cake typeof(LanguageServerHost).Assembly, // OmniSharp.LanguageServerProtocol }); diff --git a/tests/TestUtility/TestUtility.csproj b/tests/TestUtility/TestUtility.csproj index 28fed0452a..9f5a30286a 100644 --- a/tests/TestUtility/TestUtility.csproj +++ b/tests/TestUtility/TestUtility.csproj @@ -1,7 +1,7 @@  - net472 + net472;net5.0 AnyCPU @@ -12,7 +12,7 @@ - + diff --git a/tests/TestUtility/TextRange.cs b/tests/TestUtility/TextRange.cs index 6b473770cc..eebb50d1f3 100644 --- a/tests/TestUtility/TextRange.cs +++ b/tests/TestUtility/TextRange.cs @@ -1,5 +1,6 @@ using OmniSharp.Models.V2; using System; +using Range = OmniSharp.Models.V2.Range; namespace TestUtility { From c184a87dd5dda8c9eeb5d58ffc3daa2c47c6f0fb Mon Sep 17 00:00:00 2001 From: filipw Date: Thu, 4 Mar 2021 16:52:27 +0100 Subject: [PATCH 06/35] some further fixes --- .../Handlers/OmniSharpCompletionHandler.cs | 2 +- src/OmniSharp.MSBuild/OmniSharp.MSBuild.csproj | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/OmniSharp.LanguageServerProtocol/Handlers/OmniSharpCompletionHandler.cs b/src/OmniSharp.LanguageServerProtocol/Handlers/OmniSharpCompletionHandler.cs index ed312dec51..f2ecaf6e0e 100644 --- a/src/OmniSharp.LanguageServerProtocol/Handlers/OmniSharpCompletionHandler.cs +++ b/src/OmniSharp.LanguageServerProtocol/Handlers/OmniSharpCompletionHandler.cs @@ -112,7 +112,7 @@ private static void VerifyEnumsInSync(Type enum1, Type enum2) Debug.Assert(lspValues.Length == modelValues.Length); for (int i = 0; i < lspValues.Length; i++) { - Debug.Assert((int)lspValues.GetValue(i) == (int)modelValues.GetValue(i)); + Debug.Assert((int?)lspValues.GetValue(i) == (int?)modelValues.GetValue(i)); } } diff --git a/src/OmniSharp.MSBuild/OmniSharp.MSBuild.csproj b/src/OmniSharp.MSBuild/OmniSharp.MSBuild.csproj index 1a2ad558bd..fc2af2a3a0 100644 --- a/src/OmniSharp.MSBuild/OmniSharp.MSBuild.csproj +++ b/src/OmniSharp.MSBuild/OmniSharp.MSBuild.csproj @@ -30,10 +30,10 @@ - - - - + + + + From 078840239f3eaf5b20360b86b7738eae22dcb2e9 Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Thu, 13 May 2021 18:02:31 -0700 Subject: [PATCH 07/35] Run CI on demo branches --- .github/workflows/build.yml | 1 + .github/workflows/tests.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 737901f7c5..f37d36a835 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,6 +15,7 @@ on: pull_request: branches: - master + - demo/* tags: - '*' workflow_dispatch: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f4fa1b2083..51cd6d38a1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,6 +15,7 @@ on: pull_request: branches: - master + - demo/* tags: - '*' workflow_dispatch: From 61298fff59a1f5cfc27656adee96aaafa7b6a46b Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Thu, 13 May 2021 18:16:49 -0700 Subject: [PATCH 08/35] Fix filename capitalization --- build.cake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.cake b/build.cake index de794af9ae..4e0892f7cd 100644 --- a/build.cake +++ b/build.cake @@ -484,8 +484,8 @@ Task("CreateMSBuildFolder") overwrite: true); FileHelper.Copy( - source: CombinePaths(env.Folders.Tools, "Microsoft.Net.HostModel", "lib", "netstandard2.0", "Microsoft.Net.HostModel.dll"), - destination: CombinePaths(msbuildCurrentBinTargetFolder, "Microsoft.Net.HostModel.dll"), + source: CombinePaths(env.Folders.Tools, "Microsoft.NET.HostModel", "lib", "netstandard2.0", "Microsoft.NET.HostModel.dll"), + destination: CombinePaths(msbuildCurrentBinTargetFolder, "Microsoft.NET.HostModel.dll"), overwrite: true); FileHelper.Copy( From f2f4725ed0aab78039797bda47016dafa811879b Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Thu, 13 May 2021 18:20:59 -0700 Subject: [PATCH 09/35] Fix NuGet package downgrade --- build/Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/Packages.props b/build/Packages.props index f1fec77ae4..1b7afbe317 100644 --- a/build/Packages.props +++ b/build/Packages.props @@ -6,7 +6,7 @@ 5.0.0 16.9.4 16.9.0 - 5.9.1 + 5.9.0 3.10.0-3.final 2.4.1 From d9c41152265e2ea788577e3581718eae074151b1 Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Thu, 13 May 2021 18:37:47 -0700 Subject: [PATCH 10/35] Remove test for .NET Core 2.1 SDK compatibility --- build.json | 3 +-- .../test-projects/NetCore21Project/global.json | 5 ----- .../ProjectLoadListenerTests.cs | 12 ------------ 3 files changed, 1 insertion(+), 19 deletions(-) delete mode 100644 test-assets/test-projects/NetCore21Project/global.json diff --git a/build.json b/build.json index 155ae5ac7b..1577908f8f 100644 --- a/build.json +++ b/build.json @@ -2,7 +2,6 @@ "DotNetInstallScriptURL": "https://dot.net/v1", "DotNetChannel": "Preview", "DotNetVersions": [ - "2.1.814", "3.1.407", "5.0.104", "6.0.100-preview.2.21155.3" @@ -59,4 +58,4 @@ "RestoreOnlyTestAssets": [ "ProjectWithMissingType" ] -} \ No newline at end of file +} diff --git a/test-assets/test-projects/NetCore21Project/global.json b/test-assets/test-projects/NetCore21Project/global.json deleted file mode 100644 index 26a92ecffd..0000000000 --- a/test-assets/test-projects/NetCore21Project/global.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "sdk": { - "version": "2.1.814" - } -} diff --git a/tests/OmniSharp.MSBuild.Tests/ProjectLoadListenerTests.cs b/tests/OmniSharp.MSBuild.Tests/ProjectLoadListenerTests.cs index 12aa711505..2b7f37d18a 100644 --- a/tests/OmniSharp.MSBuild.Tests/ProjectLoadListenerTests.cs +++ b/tests/OmniSharp.MSBuild.Tests/ProjectLoadListenerTests.cs @@ -188,18 +188,6 @@ public async Task The_correct_project_capablities_is_emitted() Assert.Equal("GenerateDocumentationFile CSharp Managed ReferencesFolder LanguageService RelativePathDerivedDefaultNamespace AssemblyReferences COMReferences ProjectReferences SharedProjectReferences OutputGroups AllTargetOutputGroups VisualStudioWellKnownOutputGroups SingleFileGenerators DeclaredSourceItems UserSourceItems BuildWindowsDesktopTarget CrossPlatformExecutable FolderPublish Pack", string.Join(" ", emitter.ReceivedMessages[0].ProjectCapabilities)); } - [Fact] - public async Task The_correct_sdk_version_is_emitted_NETCore2_1() - { - // Arrange - var emitter = new ProjectLoadTestEventEmitter(); - - using var testProject = await TestAssets.Instance.GetTestProjectAsync("NetCore21Project"); - using var host = CreateMSBuildTestHost(testProject.Directory, emitter.AsExportDescriptionProvider(LoggerFactory)); - Assert.Single(emitter.ReceivedMessages); - Assert.Equal(GetHashedFileExtension("2.1.814"), emitter.ReceivedMessages[0].SdkVersion); - } - [Fact] public async Task The_correct_sdk_version_is_emitted_NETCore3_1() { From 4c9693ea2b5912b965623c2b66b8cafd74ad7797 Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Thu, 13 May 2021 18:49:14 -0700 Subject: [PATCH 11/35] Fix project capabilities test --- tests/OmniSharp.MSBuild.Tests/ProjectLoadListenerTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/OmniSharp.MSBuild.Tests/ProjectLoadListenerTests.cs b/tests/OmniSharp.MSBuild.Tests/ProjectLoadListenerTests.cs index 2b7f37d18a..ed125aff6d 100644 --- a/tests/OmniSharp.MSBuild.Tests/ProjectLoadListenerTests.cs +++ b/tests/OmniSharp.MSBuild.Tests/ProjectLoadListenerTests.cs @@ -185,7 +185,7 @@ public async Task The_correct_project_capablities_is_emitted() using var testProject = await TestAssets.Instance.GetTestProjectAsync("NetCore21Project"); using var host = CreateMSBuildTestHost(testProject.Directory, emitter.AsExportDescriptionProvider(LoggerFactory)); Assert.Single(emitter.ReceivedMessages); - Assert.Equal("GenerateDocumentationFile CSharp Managed ReferencesFolder LanguageService RelativePathDerivedDefaultNamespace AssemblyReferences COMReferences ProjectReferences SharedProjectReferences OutputGroups AllTargetOutputGroups VisualStudioWellKnownOutputGroups SingleFileGenerators DeclaredSourceItems UserSourceItems BuildWindowsDesktopTarget CrossPlatformExecutable FolderPublish Pack", string.Join(" ", emitter.ReceivedMessages[0].ProjectCapabilities)); + Assert.Equal("GenerateDocumentationFile CSharp Managed ReferencesFolder LanguageService RelativePathDerivedDefaultNamespace AssemblyReferences COMReferences ProjectReferences SharedProjectReferences OutputGroups AllTargetOutputGroups VisualStudioWellKnownOutputGroups SingleFileGenerators DeclaredSourceItems UserSourceItems BuildWindowsDesktopTarget CrossPlatformExecutable Pack", string.Join(" ", emitter.ReceivedMessages[0].ProjectCapabilities)); } [Fact] From 6dad0147ddaabdb6f2f53477d1812670815e179e Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Thu, 13 May 2021 19:09:14 -0700 Subject: [PATCH 12/35] Downgrade some packages --- tools/packages.config | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tools/packages.config b/tools/packages.config index 856dbb299f..8a4e88cff4 100644 --- a/tools/packages.config +++ b/tools/packages.config @@ -6,6 +6,10 @@ + + + + - - - - - - + diff --git a/tests/app.config b/tests/app.config index 358145d354..300c70615a 100644 --- a/tests/app.config +++ b/tests/app.config @@ -59,10 +59,6 @@ - - - - diff --git a/tools/packages.config b/tools/packages.config index 8a4e88cff4..15e404f8df 100644 --- a/tools/packages.config +++ b/tools/packages.config @@ -6,10 +6,6 @@ - - - - - - - - - + + + + + From cd99d8ea65d15c6219cc6f11378477a01ed0dbe9 Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Wed, 24 Nov 2021 10:11:33 -0800 Subject: [PATCH 27/35] Update tests-net5.yml --- .github/workflows/tests-net5.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests-net5.yml b/.github/workflows/tests-net5.yml index 19aa573ae1..14ce14badd 100644 --- a/.github/workflows/tests-net5.yml +++ b/.github/workflows/tests-net5.yml @@ -1,8 +1,8 @@ name: 'Tests net5.0' env: - DotNetVersion: "5.0.302" - DotNetVersion2: "3.1.411" + DotNetVersion: "6.0.100" + DotNetVersion2: "3.1.415" NuGetVersion: "5.7.0" MonoVersion: "6.12.0" Artifacts: ${{ github.workspace }}/artifacts/ From df72e65e9ef2d93cf281bd110ebdd27452592e87 Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Wed, 24 Nov 2021 13:26:25 -0800 Subject: [PATCH 28/35] Update tests-net5.yml --- .github/workflows/tests-net5.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/tests-net5.yml b/.github/workflows/tests-net5.yml index 14ce14badd..c5d2d00560 100644 --- a/.github/workflows/tests-net5.yml +++ b/.github/workflows/tests-net5.yml @@ -3,6 +3,7 @@ name: 'Tests net5.0' env: DotNetVersion: "6.0.100" DotNetVersion2: "3.1.415" + DotNetVersion3: "5.0.403" NuGetVersion: "5.7.0" MonoVersion: "6.12.0" Artifacts: ${{ github.workspace }}/artifacts/ @@ -51,6 +52,11 @@ jobs: with: nuget-version: ${{ env.NuGetVersion }} + - name: 🔨 Use .NET Core ${{ env.DotNetVersion3 }} SDK + uses: actions/setup-dotnet@v1.7.2 + with: + dotnet-version: ${{ env.DotNetVersion3 }} + - name: 🔨 Use .NET Core ${{ env.DotNetVersion2 }} SDK uses: actions/setup-dotnet@v1.7.2 with: From 9aa94084a3b4d4cb47767b54afcd192f62e33c9b Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Wed, 24 Nov 2021 16:20:00 -0800 Subject: [PATCH 29/35] Move OmniSharp to run on .NET 6 --- .editorconfig | 2 ++ .../{tests-net5.yml => tests-net6.yml} | 10 ++----- build.cake | 26 +++++++++---------- build/Packages.props | 10 +++---- .../OmniSharp.Abstractions.csproj | 2 +- src/OmniSharp.Cake/OmniSharp.Cake.csproj | 2 +- .../Navigation/GotoDefinitionV2Handler.cs | 3 ++- .../OmniSharp.DotNetTest.csproj | 6 ++--- .../MicrosoftBuildLocatorInstanceProvider.cs | 8 +++--- src/OmniSharp.Host/OmniSharp.Host.csproj | 2 +- .../OmniSharp.Http.Driver.csproj | 2 +- src/OmniSharp.Http/OmniSharp.Http.csproj | 2 +- .../OmniSharp.LanguageServerProtocol.csproj | 2 +- .../OmniSharp.MSBuild.csproj | 2 +- .../OmniSharp.Roslyn.CSharp.csproj | 2 +- src/OmniSharp.Roslyn/OmniSharp.Roslyn.csproj | 2 +- src/OmniSharp.Script/OmniSharp.Script.csproj | 2 +- src/OmniSharp.Shared/OmniSharp.Shared.csproj | 2 +- .../OmniSharp.Stdio.Driver.csproj | 2 +- src/OmniSharp.Stdio/OmniSharp.Stdio.csproj | 2 +- .../OmniSharp.Cake.Tests.csproj | 2 +- .../OmniSharp.DotNetTest.Tests.csproj | 2 +- .../OmniSharp.Http.Tests.csproj | 2 +- .../OmniSharp.Lsp.Tests.csproj | 2 +- .../OmniSharp.MSBuild.Tests.csproj | 2 +- .../OmniSharp.Roslyn.CSharp.Tests.csproj | 2 +- .../OmniSharp.Script.Tests.csproj | 2 +- .../OmniSharp.Stdio.Tests.csproj | 2 +- tests/OmniSharp.Tests/OmniSharp.Tests.csproj | 2 +- tests/TestUtility/OmniSharpTestHost.cs | 5 ++-- tests/TestUtility/TestUtility.csproj | 4 +-- 31 files changed, 58 insertions(+), 60 deletions(-) rename .github/workflows/{tests-net5.yml => tests-net6.yml} (91%) diff --git a/.editorconfig b/.editorconfig index 0aff6e75ca..e6600b7003 100644 --- a/.editorconfig +++ b/.editorconfig @@ -8,6 +8,8 @@ insert_final_newline = true indent_style = space indent_size = 4 +# CA2254: The logging message template should not vary between calls to 'LoggerExtensions.LogDebug(ILogger, string?, params object?[])' +dotnet_diagnostic.CA2254.severity = none dotnet_diagnostic.VSTHRD002.severity = none dotnet_diagnostic.VSTHRD003.severity = none dotnet_diagnostic.VSTHRD105.severity = none diff --git a/.github/workflows/tests-net5.yml b/.github/workflows/tests-net6.yml similarity index 91% rename from .github/workflows/tests-net5.yml rename to .github/workflows/tests-net6.yml index c5d2d00560..c9d66b10ad 100644 --- a/.github/workflows/tests-net5.yml +++ b/.github/workflows/tests-net6.yml @@ -1,9 +1,8 @@ -name: 'Tests net5.0' +name: 'Tests net6.0' env: DotNetVersion: "6.0.100" DotNetVersion2: "3.1.415" - DotNetVersion3: "5.0.403" NuGetVersion: "5.7.0" MonoVersion: "6.12.0" Artifacts: ${{ github.workspace }}/artifacts/ @@ -29,7 +28,7 @@ jobs: matrix: os: [ubuntu-18.04, windows-2019, macos-10.15] testProjects: - - OmniSharp.MSBuild.Tests,OmniSharp.Roslyn.CSharp.Tests,OmniSharp.Script.Tests,OmniSharp.Stdio.Tests,OmniSharp.Http.Tests,OmniSharp.Tests,OmniSharp.Lsp.Tests + - OmniSharp.MSBuild.Tests,OmniSharp.Roslyn.CSharp.Tests,OmniSharp.Cake.Tests,OmniSharp.Script.Tests,OmniSharp.Stdio.Tests,OmniSharp.Http.Tests,OmniSharp.Tests,OmniSharp.Lsp.Tests - OmniSharp.DotNetTest.Tests name: 'Test' steps: @@ -52,11 +51,6 @@ jobs: with: nuget-version: ${{ env.NuGetVersion }} - - name: 🔨 Use .NET Core ${{ env.DotNetVersion3 }} SDK - uses: actions/setup-dotnet@v1.7.2 - with: - dotnet-version: ${{ env.DotNetVersion3 }} - - name: 🔨 Use .NET Core ${{ env.DotNetVersion2 }} SDK uses: actions/setup-dotnet@v1.7.2 with: diff --git a/build.cake b/build.cake index eeb9b5b4c6..801960ec6d 100644 --- a/build.cake +++ b/build.cake @@ -635,7 +635,7 @@ Task("Test") .IsDependentOn("PrepareTestAssets") .Does(() => { - var testTargetFramework = useDotNetTest ? "net5.0" : "net472"; + var testTargetFramework = useDotNetTest ? "net6.0" : "net472"; var testProjects = string.IsNullOrEmpty(testProjectArgument) ? buildPlan.TestProjects : testProjectArgument.Split(','); foreach (var testProject in testProjects) { @@ -877,7 +877,7 @@ Task("PublishMonoBuilds") } }); -Task("PublishNet5Builds") +Task("PublishNet6Builds") .IsDependentOn("Setup") .Does(() => { @@ -885,36 +885,36 @@ Task("PublishNet5Builds") { if (publishAll) { - PublishBuild(project, env, buildPlan, configuration, "linux-x64", "net5.0"); - PublishBuild(project, env, buildPlan, configuration, "osx-x64", "net5.0"); - PublishBuild(project, env, buildPlan, configuration, "win7-x86", "net5.0"); - PublishBuild(project, env, buildPlan, configuration, "win7-x64", "net5.0"); - PublishBuild(project, env, buildPlan, configuration, "win10-arm64", "net5.0"); + PublishBuild(project, env, buildPlan, configuration, "linux-x64", "net6.0"); + PublishBuild(project, env, buildPlan, configuration, "osx-x64", "net6.0"); + PublishBuild(project, env, buildPlan, configuration, "win7-x86", "net6.0"); + PublishBuild(project, env, buildPlan, configuration, "win7-x64", "net6.0"); + PublishBuild(project, env, buildPlan, configuration, "win10-arm64", "net6.0"); } else if (Platform.Current.IsWindows) { if (Platform.Current.IsX86) { - PublishBuild(project, env, buildPlan, configuration, "win7-x86", "net5.0"); + PublishBuild(project, env, buildPlan, configuration, "win7-x86", "net6.0"); } else if (Platform.Current.IsX64) { - PublishBuild(project, env, buildPlan, configuration, "win7-x64", "net5.0"); + PublishBuild(project, env, buildPlan, configuration, "win7-x64", "net6.0"); } else { - PublishBuild(project, env, buildPlan, configuration, "win10-arm64", "net5.0"); + PublishBuild(project, env, buildPlan, configuration, "win10-arm64", "net6.0"); } } else { if (Platform.Current.IsMacOS) { - PublishBuild(project, env, buildPlan, configuration, "osx-x64", "net5.0"); + PublishBuild(project, env, buildPlan, configuration, "osx-x64", "net6.0"); } else { - PublishBuild(project, env, buildPlan, configuration, "linux-x64", "net5.0"); + PublishBuild(project, env, buildPlan, configuration, "linux-x64", "net6.0"); } } @@ -1022,7 +1022,7 @@ Task("PublishNuGet") Task("Publish") .IsDependentOn("Build") .IsDependentOn("PublishMonoBuilds") - .IsDependentOn("PublishNet5Builds") + .IsDependentOn("PublishNet6Builds") .IsDependentOn("PublishWindowsBuilds") .IsDependentOn("PublishNuGet"); diff --git a/build/Packages.props b/build/Packages.props index 195d2340ab..ca248db7e6 100644 --- a/build/Packages.props +++ b/build/Packages.props @@ -3,10 +3,10 @@ 2.2.0 - 5.0.0 - 16.9.4 - 16.10.0 - 5.11.0 + 6.0.0 + 17.0.0 + 17.0.0 + 6.0.0 4.0.0-6.21526.21 2.4.1 @@ -65,7 +65,7 @@ - + diff --git a/src/OmniSharp.Abstractions/OmniSharp.Abstractions.csproj b/src/OmniSharp.Abstractions/OmniSharp.Abstractions.csproj index b0952b8d5d..18d23d76f4 100644 --- a/src/OmniSharp.Abstractions/OmniSharp.Abstractions.csproj +++ b/src/OmniSharp.Abstractions/OmniSharp.Abstractions.csproj @@ -1,7 +1,7 @@  - net472;net5.0;netstandard2.0 + net6.0;net472;netstandard2.0 AnyCPU OmniSharp true diff --git a/src/OmniSharp.Cake/OmniSharp.Cake.csproj b/src/OmniSharp.Cake/OmniSharp.Cake.csproj index 7eda92d68e..15a6211691 100644 --- a/src/OmniSharp.Cake/OmniSharp.Cake.csproj +++ b/src/OmniSharp.Cake/OmniSharp.Cake.csproj @@ -1,7 +1,7 @@  - net472 + net6.0;net472 AnyCPU diff --git a/src/OmniSharp.Cake/Services/RequestHandlers/Navigation/GotoDefinitionV2Handler.cs b/src/OmniSharp.Cake/Services/RequestHandlers/Navigation/GotoDefinitionV2Handler.cs index 5a8e70aff3..1cbc6d7e92 100644 --- a/src/OmniSharp.Cake/Services/RequestHandlers/Navigation/GotoDefinitionV2Handler.cs +++ b/src/OmniSharp.Cake/Services/RequestHandlers/Navigation/GotoDefinitionV2Handler.cs @@ -12,6 +12,7 @@ using OmniSharp.Roslyn; using OmniSharp.Utilities; using Location = OmniSharp.Models.V2.Location; +using Range = OmniSharp.Models.V2.Range; namespace OmniSharp.Cake.Services.RequestHandlers.Navigation { @@ -59,7 +60,7 @@ protected override async Task TranslateResponse(GotoDefi if (!request.WantMetadata) { - continue; + continue; } var aliasLocations = await GotoDefinitionHandlerHelper.GetAliasFromMetadataAsync( diff --git a/src/OmniSharp.DotNetTest/OmniSharp.DotNetTest.csproj b/src/OmniSharp.DotNetTest/OmniSharp.DotNetTest.csproj index 9131be748e..769b89ca75 100644 --- a/src/OmniSharp.DotNetTest/OmniSharp.DotNetTest.csproj +++ b/src/OmniSharp.DotNetTest/OmniSharp.DotNetTest.csproj @@ -1,7 +1,7 @@  - net472;net5.0 + net6.0;net472 AnyCPU @@ -18,8 +18,8 @@ - - + + diff --git a/src/OmniSharp.Host/MSBuild/Discovery/Providers/MicrosoftBuildLocatorInstanceProvider.cs b/src/OmniSharp.Host/MSBuild/Discovery/Providers/MicrosoftBuildLocatorInstanceProvider.cs index e964e591c7..364d751dbd 100644 --- a/src/OmniSharp.Host/MSBuild/Discovery/Providers/MicrosoftBuildLocatorInstanceProvider.cs +++ b/src/OmniSharp.Host/MSBuild/Discovery/Providers/MicrosoftBuildLocatorInstanceProvider.cs @@ -3,9 +3,11 @@ using System.IO; using System.Linq; using Microsoft.Extensions.Logging; -using OmniSharp.Utilities; using MicrosoftBuildLocator = Microsoft.Build.Locator.MSBuildLocator; using MicrosoftDiscoveryType = Microsoft.Build.Locator.DiscoveryType; +#if !NETCOREAPP +using OmniSharp.Utilities; +#endif namespace OmniSharp.MSBuild.Discovery.Providers { @@ -20,9 +22,9 @@ public override ImmutableArray GetInstances() { #if NETCOREAPP - // Restrict instances to NET 5 SDK + // Restrict instances to NET 6 SDK var instances = MicrosoftBuildLocator.QueryVisualStudioInstances() - .Where(instance => instance.Version.Major == 5); + .Where(instance => instance.Version.Major == 6); #else if (!PlatformHelper.IsWindows) { diff --git a/src/OmniSharp.Host/OmniSharp.Host.csproj b/src/OmniSharp.Host/OmniSharp.Host.csproj index 09763968dd..b0864b6c27 100644 --- a/src/OmniSharp.Host/OmniSharp.Host.csproj +++ b/src/OmniSharp.Host/OmniSharp.Host.csproj @@ -1,7 +1,7 @@  - net472;net5.0 + net6.0;net472 AnyCPU OmniSharp true diff --git a/src/OmniSharp.Http.Driver/OmniSharp.Http.Driver.csproj b/src/OmniSharp.Http.Driver/OmniSharp.Http.Driver.csproj index 1bdbc0eb02..60650470cf 100644 --- a/src/OmniSharp.Http.Driver/OmniSharp.Http.Driver.csproj +++ b/src/OmniSharp.Http.Driver/OmniSharp.Http.Driver.csproj @@ -1,7 +1,7 @@  - net472;net5.0 + net6.0;net472 AnyCPU OmniSharp Exe diff --git a/src/OmniSharp.Http/OmniSharp.Http.csproj b/src/OmniSharp.Http/OmniSharp.Http.csproj index e6dfde9d0a..0817374654 100644 --- a/src/OmniSharp.Http/OmniSharp.Http.csproj +++ b/src/OmniSharp.Http/OmniSharp.Http.csproj @@ -1,7 +1,7 @@  - net472;net5.0 + net6.0;net472 AnyCPU diff --git a/src/OmniSharp.LanguageServerProtocol/OmniSharp.LanguageServerProtocol.csproj b/src/OmniSharp.LanguageServerProtocol/OmniSharp.LanguageServerProtocol.csproj index f70410af03..0021cb9793 100644 --- a/src/OmniSharp.LanguageServerProtocol/OmniSharp.LanguageServerProtocol.csproj +++ b/src/OmniSharp.LanguageServerProtocol/OmniSharp.LanguageServerProtocol.csproj @@ -1,7 +1,7 @@  - net472;net5.0 + net6.0;net472 AnyCPU OmniSharp.LanguageServerProtocol true diff --git a/src/OmniSharp.MSBuild/OmniSharp.MSBuild.csproj b/src/OmniSharp.MSBuild/OmniSharp.MSBuild.csproj index 6cf084296b..5aade02943 100644 --- a/src/OmniSharp.MSBuild/OmniSharp.MSBuild.csproj +++ b/src/OmniSharp.MSBuild/OmniSharp.MSBuild.csproj @@ -1,7 +1,7 @@  - net472;net5.0 + net6.0;net472 AnyCPU true true diff --git a/src/OmniSharp.Roslyn.CSharp/OmniSharp.Roslyn.CSharp.csproj b/src/OmniSharp.Roslyn.CSharp/OmniSharp.Roslyn.CSharp.csproj index b5717093fc..fa71cc8143 100644 --- a/src/OmniSharp.Roslyn.CSharp/OmniSharp.Roslyn.CSharp.csproj +++ b/src/OmniSharp.Roslyn.CSharp/OmniSharp.Roslyn.CSharp.csproj @@ -1,7 +1,7 @@  - net472;net5.0;netstandard2.0 + net6.0;net472;netstandard2.0 AnyCPU true true diff --git a/src/OmniSharp.Roslyn/OmniSharp.Roslyn.csproj b/src/OmniSharp.Roslyn/OmniSharp.Roslyn.csproj index 08abd3b329..016c007994 100644 --- a/src/OmniSharp.Roslyn/OmniSharp.Roslyn.csproj +++ b/src/OmniSharp.Roslyn/OmniSharp.Roslyn.csproj @@ -1,7 +1,7 @@  - net472;net5.0;netstandard2.0 + net6.0;net472;netstandard2.0 AnyCPU true true diff --git a/src/OmniSharp.Script/OmniSharp.Script.csproj b/src/OmniSharp.Script/OmniSharp.Script.csproj index 0086e24879..8744f6f8a3 100644 --- a/src/OmniSharp.Script/OmniSharp.Script.csproj +++ b/src/OmniSharp.Script/OmniSharp.Script.csproj @@ -1,7 +1,7 @@  - net472;net5.0 + net6.0;net472 AnyCPU diff --git a/src/OmniSharp.Shared/OmniSharp.Shared.csproj b/src/OmniSharp.Shared/OmniSharp.Shared.csproj index 71e20432aa..4081f08ca2 100644 --- a/src/OmniSharp.Shared/OmniSharp.Shared.csproj +++ b/src/OmniSharp.Shared/OmniSharp.Shared.csproj @@ -1,7 +1,7 @@  - net472;net5.0;netstandard2.0 + net6.0;net472;netstandard2.0 AnyCPU OmniSharp true diff --git a/src/OmniSharp.Stdio.Driver/OmniSharp.Stdio.Driver.csproj b/src/OmniSharp.Stdio.Driver/OmniSharp.Stdio.Driver.csproj index e5dbb6fdfc..610f2929cb 100644 --- a/src/OmniSharp.Stdio.Driver/OmniSharp.Stdio.Driver.csproj +++ b/src/OmniSharp.Stdio.Driver/OmniSharp.Stdio.Driver.csproj @@ -1,7 +1,7 @@  - net472;net5.0 + net6.0;net472 AnyCPU OmniSharp Exe diff --git a/src/OmniSharp.Stdio/OmniSharp.Stdio.csproj b/src/OmniSharp.Stdio/OmniSharp.Stdio.csproj index 4363e80e6e..4c72c6b211 100644 --- a/src/OmniSharp.Stdio/OmniSharp.Stdio.csproj +++ b/src/OmniSharp.Stdio/OmniSharp.Stdio.csproj @@ -1,7 +1,7 @@  - net472;net5.0 + net6.0;net472 AnyCPU diff --git a/tests/OmniSharp.Cake.Tests/OmniSharp.Cake.Tests.csproj b/tests/OmniSharp.Cake.Tests/OmniSharp.Cake.Tests.csproj index fce126d025..189e9dd947 100644 --- a/tests/OmniSharp.Cake.Tests/OmniSharp.Cake.Tests.csproj +++ b/tests/OmniSharp.Cake.Tests/OmniSharp.Cake.Tests.csproj @@ -1,7 +1,7 @@ - net472 + net6.0;net472 AnyCPU true diff --git a/tests/OmniSharp.DotNetTest.Tests/OmniSharp.DotNetTest.Tests.csproj b/tests/OmniSharp.DotNetTest.Tests/OmniSharp.DotNetTest.Tests.csproj index f3d33d1746..b8faeb721c 100644 --- a/tests/OmniSharp.DotNetTest.Tests/OmniSharp.DotNetTest.Tests.csproj +++ b/tests/OmniSharp.DotNetTest.Tests/OmniSharp.DotNetTest.Tests.csproj @@ -1,7 +1,7 @@  - net472;net5.0 + net6.0;net472 AnyCPU true diff --git a/tests/OmniSharp.Http.Tests/OmniSharp.Http.Tests.csproj b/tests/OmniSharp.Http.Tests/OmniSharp.Http.Tests.csproj index 4a143e2c39..c735523e68 100644 --- a/tests/OmniSharp.Http.Tests/OmniSharp.Http.Tests.csproj +++ b/tests/OmniSharp.Http.Tests/OmniSharp.Http.Tests.csproj @@ -1,7 +1,7 @@  - net472;net5.0 + net6.0;net472 AnyCPU true diff --git a/tests/OmniSharp.Lsp.Tests/OmniSharp.Lsp.Tests.csproj b/tests/OmniSharp.Lsp.Tests/OmniSharp.Lsp.Tests.csproj index bc3f3f0136..311a5f99d3 100644 --- a/tests/OmniSharp.Lsp.Tests/OmniSharp.Lsp.Tests.csproj +++ b/tests/OmniSharp.Lsp.Tests/OmniSharp.Lsp.Tests.csproj @@ -1,7 +1,7 @@  - net472;net5.0 + net6.0;net472 AnyCPU true diff --git a/tests/OmniSharp.MSBuild.Tests/OmniSharp.MSBuild.Tests.csproj b/tests/OmniSharp.MSBuild.Tests/OmniSharp.MSBuild.Tests.csproj index d710dbbf9b..9200ec8d1d 100644 --- a/tests/OmniSharp.MSBuild.Tests/OmniSharp.MSBuild.Tests.csproj +++ b/tests/OmniSharp.MSBuild.Tests/OmniSharp.MSBuild.Tests.csproj @@ -1,7 +1,7 @@  - net472;net5.0 + net6.0;net472 AnyCPU true diff --git a/tests/OmniSharp.Roslyn.CSharp.Tests/OmniSharp.Roslyn.CSharp.Tests.csproj b/tests/OmniSharp.Roslyn.CSharp.Tests/OmniSharp.Roslyn.CSharp.Tests.csproj index afe4e140ff..a134f22a5a 100644 --- a/tests/OmniSharp.Roslyn.CSharp.Tests/OmniSharp.Roslyn.CSharp.Tests.csproj +++ b/tests/OmniSharp.Roslyn.CSharp.Tests/OmniSharp.Roslyn.CSharp.Tests.csproj @@ -1,7 +1,7 @@  - net472;net5.0 + net6.0;net472 AnyCPU true CS0618 diff --git a/tests/OmniSharp.Script.Tests/OmniSharp.Script.Tests.csproj b/tests/OmniSharp.Script.Tests/OmniSharp.Script.Tests.csproj index c259d1bbfd..e3b2a0740f 100644 --- a/tests/OmniSharp.Script.Tests/OmniSharp.Script.Tests.csproj +++ b/tests/OmniSharp.Script.Tests/OmniSharp.Script.Tests.csproj @@ -1,7 +1,7 @@ - net472;net5.0 + net6.0;net472 AnyCPU true diff --git a/tests/OmniSharp.Stdio.Tests/OmniSharp.Stdio.Tests.csproj b/tests/OmniSharp.Stdio.Tests/OmniSharp.Stdio.Tests.csproj index 5c62ae59ef..df100568dc 100644 --- a/tests/OmniSharp.Stdio.Tests/OmniSharp.Stdio.Tests.csproj +++ b/tests/OmniSharp.Stdio.Tests/OmniSharp.Stdio.Tests.csproj @@ -1,7 +1,7 @@  - net472;net5.0 + net6.0;net472 AnyCPU true diff --git a/tests/OmniSharp.Tests/OmniSharp.Tests.csproj b/tests/OmniSharp.Tests/OmniSharp.Tests.csproj index f8319a75d3..d30a32ff30 100644 --- a/tests/OmniSharp.Tests/OmniSharp.Tests.csproj +++ b/tests/OmniSharp.Tests/OmniSharp.Tests.csproj @@ -1,7 +1,7 @@  - net472;net5.0 + net6.0;net472 AnyCPU true diff --git a/tests/TestUtility/OmniSharpTestHost.cs b/tests/TestUtility/OmniSharpTestHost.cs index 2cf493d889..391c044a86 100644 --- a/tests/TestUtility/OmniSharpTestHost.cs +++ b/tests/TestUtility/OmniSharpTestHost.cs @@ -12,6 +12,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using OmniSharp; +using OmniSharp.Cake; using OmniSharp.DotNetTest.Models; using OmniSharp.Eventing; using OmniSharp.LanguageServerProtocol; @@ -37,9 +38,7 @@ public class OmniSharpTestHost : DisposableObject typeof(ScriptProjectSystem).GetTypeInfo().Assembly, // OmniSharp.Script typeof(OmniSharpWorkspace).GetTypeInfo().Assembly, // OmniSharp.Roslyn typeof(RoslynFeaturesHostServicesProvider).GetTypeInfo().Assembly, // OmniSharp.Roslyn.CSharp -#if !NETCOREAPP - typeof(OmniSharp.Cake.CakeProjectSystem).GetTypeInfo().Assembly, // OmniSharp.Cake -#endif + typeof(CakeProjectSystem).GetTypeInfo().Assembly, // OmniSharp.Cake typeof(LanguageServerHost).Assembly, // OmniSharp.LanguageServerProtocol }); diff --git a/tests/TestUtility/TestUtility.csproj b/tests/TestUtility/TestUtility.csproj index 5500a9370e..17e999a496 100644 --- a/tests/TestUtility/TestUtility.csproj +++ b/tests/TestUtility/TestUtility.csproj @@ -1,7 +1,7 @@  - net472;net5.0 + net6.0;net472 AnyCPU @@ -12,7 +12,7 @@ - + From 845529c7cd96c2e332d468bc325cddaebcff9b8e Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Wed, 24 Nov 2021 17:20:29 -0800 Subject: [PATCH 30/35] Avoid the NET6 breaking change in HostWriter --- src/OmniSharp.MSBuild/ProjectFile/PropertyNames.cs | 1 + src/OmniSharp.MSBuild/ProjectLoader.cs | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/OmniSharp.MSBuild/ProjectFile/PropertyNames.cs b/src/OmniSharp.MSBuild/ProjectFile/PropertyNames.cs index a61cee025e..654b1f99e8 100644 --- a/src/OmniSharp.MSBuild/ProjectFile/PropertyNames.cs +++ b/src/OmniSharp.MSBuild/ProjectFile/PropertyNames.cs @@ -44,6 +44,7 @@ internal static class PropertyNames public const string TargetFrameworks = nameof(TargetFrameworks); public const string TargetPath = nameof(TargetPath); public const string TreatWarningsAsErrors = nameof(TreatWarningsAsErrors); + public const string UseAppHost = nameof(UseAppHost); public const string VisualStudioVersion = nameof(VisualStudioVersion); public const string VsInstallRoot = nameof(VsInstallRoot); public const string WarningsAsErrors = nameof(WarningsAsErrors); diff --git a/src/OmniSharp.MSBuild/ProjectLoader.cs b/src/OmniSharp.MSBuild/ProjectLoader.cs index 92cc4af90a..74302fb04d 100644 --- a/src/OmniSharp.MSBuild/ProjectLoader.cs +++ b/src/OmniSharp.MSBuild/ProjectLoader.cs @@ -47,7 +47,10 @@ private static Dictionary CreateGlobalProperties( // This properties allow the design-time build to handle the Compile target without actually invoking the compiler. // See https://github.com/dotnet/roslyn/pull/4604 for details. { PropertyNames.ProvideCommandLineArgs, "true" }, - { PropertyNames.SkipCompilerExecution, "true" } + { PropertyNames.SkipCompilerExecution, "true" }, + + // Ensures the SDK doesn't try to generate app hosts for the loading projects + { PropertyNames.UseAppHost, "false" }, }; globalProperties.AddPropertyOverride(PropertyNames.MSBuildExtensionsPath, options.MSBuildExtensionsPath, propertyOverrides, logger); From 9a999d2ac30160c240eacf0bcd2fec64a539b4c4 Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Wed, 24 Nov 2021 17:23:27 -0800 Subject: [PATCH 31/35] Disable Cake tests in net6 --- .github/workflows/tests-net6.yml | 2 +- tests/TestUtility/OmniSharpTestHost.cs | 5 +++-- tests/TestUtility/TestUtility.csproj | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests-net6.yml b/.github/workflows/tests-net6.yml index c9d66b10ad..2ebf534aa4 100644 --- a/.github/workflows/tests-net6.yml +++ b/.github/workflows/tests-net6.yml @@ -28,7 +28,7 @@ jobs: matrix: os: [ubuntu-18.04, windows-2019, macos-10.15] testProjects: - - OmniSharp.MSBuild.Tests,OmniSharp.Roslyn.CSharp.Tests,OmniSharp.Cake.Tests,OmniSharp.Script.Tests,OmniSharp.Stdio.Tests,OmniSharp.Http.Tests,OmniSharp.Tests,OmniSharp.Lsp.Tests + - OmniSharp.MSBuild.Tests,OmniSharp.Roslyn.CSharp.Tests,OmniSharp.Script.Tests,OmniSharp.Stdio.Tests,OmniSharp.Http.Tests,OmniSharp.Tests,OmniSharp.Lsp.Tests - OmniSharp.DotNetTest.Tests name: 'Test' steps: diff --git a/tests/TestUtility/OmniSharpTestHost.cs b/tests/TestUtility/OmniSharpTestHost.cs index 391c044a86..2cf493d889 100644 --- a/tests/TestUtility/OmniSharpTestHost.cs +++ b/tests/TestUtility/OmniSharpTestHost.cs @@ -12,7 +12,6 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using OmniSharp; -using OmniSharp.Cake; using OmniSharp.DotNetTest.Models; using OmniSharp.Eventing; using OmniSharp.LanguageServerProtocol; @@ -38,7 +37,9 @@ public class OmniSharpTestHost : DisposableObject typeof(ScriptProjectSystem).GetTypeInfo().Assembly, // OmniSharp.Script typeof(OmniSharpWorkspace).GetTypeInfo().Assembly, // OmniSharp.Roslyn typeof(RoslynFeaturesHostServicesProvider).GetTypeInfo().Assembly, // OmniSharp.Roslyn.CSharp - typeof(CakeProjectSystem).GetTypeInfo().Assembly, // OmniSharp.Cake +#if !NETCOREAPP + typeof(OmniSharp.Cake.CakeProjectSystem).GetTypeInfo().Assembly, // OmniSharp.Cake +#endif typeof(LanguageServerHost).Assembly, // OmniSharp.LanguageServerProtocol }); diff --git a/tests/TestUtility/TestUtility.csproj b/tests/TestUtility/TestUtility.csproj index 17e999a496..ba86af2f51 100644 --- a/tests/TestUtility/TestUtility.csproj +++ b/tests/TestUtility/TestUtility.csproj @@ -12,7 +12,7 @@ - + From a636a913a72dad1e35994c27c1033732fec27c90 Mon Sep 17 00:00:00 2001 From: filipw Date: Mon, 29 Nov 2021 10:51:52 +0100 Subject: [PATCH 32/35] added build targets for ARM 64 macOS --- build.cake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.cake b/build.cake index 801960ec6d..c2cc4674d5 100644 --- a/build.cake +++ b/build.cake @@ -887,6 +887,7 @@ Task("PublishNet6Builds") { PublishBuild(project, env, buildPlan, configuration, "linux-x64", "net6.0"); PublishBuild(project, env, buildPlan, configuration, "osx-x64", "net6.0"); + PublishBuild(project, env, buildPlan, configuration, "osx-arm64", "net6.0"); PublishBuild(project, env, buildPlan, configuration, "win7-x86", "net6.0"); PublishBuild(project, env, buildPlan, configuration, "win7-x64", "net6.0"); PublishBuild(project, env, buildPlan, configuration, "win10-arm64", "net6.0"); @@ -911,6 +912,7 @@ Task("PublishNet6Builds") if (Platform.Current.IsMacOS) { PublishBuild(project, env, buildPlan, configuration, "osx-x64", "net6.0"); + PublishBuild(project, env, buildPlan, configuration, "osx-arm64", "net6.0"); } else { From d848a6a3e4e903417e4dccd2ebc5dae74b9f7aef Mon Sep 17 00:00:00 2001 From: filipw Date: Tue, 30 Nov 2021 21:08:49 +0100 Subject: [PATCH 33/35] do not hard crash at startup when no MSBuild found --- src/OmniSharp.MSBuild/ProjectSystem.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OmniSharp.MSBuild/ProjectSystem.cs b/src/OmniSharp.MSBuild/ProjectSystem.cs index 78c61e8772..10c547b637 100644 --- a/src/OmniSharp.MSBuild/ProjectSystem.cs +++ b/src/OmniSharp.MSBuild/ProjectSystem.cs @@ -72,7 +72,7 @@ public ProjectSystem( { _environment = environment; _workspace = workspace; - _propertyOverrides = msbuildLocator.RegisteredInstance.PropertyOverrides; + _propertyOverrides = msbuildLocator.RegisteredInstance?.PropertyOverrides ?? ImmutableDictionary.Create(); _dotNetCli = dotNetCliService; _sdksPathResolver = sdksPathResolver; _metadataFileReferenceCache = metadataFileReferenceCache; From 1282489061863221b039fbacfd5b0d621de4cc30 Mon Sep 17 00:00:00 2001 From: Fredric Silberberg Date: Thu, 2 Dec 2021 21:29:30 -0800 Subject: [PATCH 34/35] Restore the http driver publish --- build.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.json b/build.json index e5ab67bb58..984e7a98cc 100644 --- a/build.json +++ b/build.json @@ -13,7 +13,8 @@ "MonoRuntimeLinuxX64": "mono.linux-x86_64-6.12.0.122.zip", "MonoRuntimeLinuxArm64": "mono.linux-arm64-6.12.0.122.zip", "HostProjects": [ - "OmniSharp.Stdio.Driver" + "OmniSharp.Stdio.Driver", + "OmniSharp.Http.Driver" ], "TestProjects": [ "OmniSharp.MSBuild.Tests", From 9a9e186862bd59505ebc98f76314d3007ce27583 Mon Sep 17 00:00:00 2001 From: filipw Date: Fri, 3 Dec 2021 15:43:12 +0100 Subject: [PATCH 35/35] restored missing tasks --- build.cake | 48 +++++++++++++++++++++++++++++++++++++++++------- build.json | 3 ++- 2 files changed, 43 insertions(+), 8 deletions(-) diff --git a/build.cake b/build.cake index c2cc4674d5..ce66e98f19 100644 --- a/build.cake +++ b/build.cake @@ -46,6 +46,15 @@ Task("Cleanup") DirectoryHelper.Create(env.Folders.ArtifactsScripts); }); +Task("GitVersion") + .WithCriteria(!BuildSystem.IsLocalBuild) + .WithCriteria(!AzurePipelines.IsRunningOnAzurePipelines) + .Does(() => { + GitVersion(new GitVersionSettings{ + OutputType = GitVersionOutput.BuildServer + }); + }); + /// /// Pre-build setup tasks. /// @@ -135,13 +144,23 @@ Task("ValidateMono") ValidateMonoVersion(buildPlan); }); +Task("CleanUpMonoAssets") + .WithCriteria(() => !Platform.Current.IsWindows) + .Does(() => +{ + if (DirectoryHelper.Exists(env.Folders.Mono)) + { + DirectoryHelper.Delete(env.Folders.Mono, recursive: true); + } +}); + Task("InstallMonoAssets") .WithCriteria(() => !Platform.Current.IsWindows) .Does(() => { if (DirectoryHelper.Exists(env.Folders.Mono) && !publishAll) { - Information($"'{env.Folders.Mono}' folder exists... Skipping acquiring of Mono assets."); + Information("Skipping Mono assets installation, because they already exist."); return; } Information("Acquiring Mono runtimes and framework..."); @@ -511,12 +530,25 @@ Task("PrepareTestAssets:CommonTestAssets") var folder = CombinePaths(env.Folders.TestAssets, "test-projects", project); - DotNetCoreBuild(folder, new DotNetCoreBuildSettings() - { - ToolPath = env.DotNetCommand, - WorkingDirectory = folder, - Verbosity = DotNetCoreVerbosity.Minimal - }); + try { + DotNetCoreBuild(folder, new DotNetCoreBuildSettings() + { + ToolPath = env.DotNetCommand, + WorkingDirectory = folder, + Verbosity = DotNetCoreVerbosity.Minimal + }); + } catch { + // ExternalAlias has issues once in a while, try building again to get it working. + if (project == "ExternAlias") { + + DotNetCoreBuild(folder, new DotNetCoreBuildSettings() + { + ToolPath = env.DotNetCommand, + WorkingDirectory = folder, + Verbosity = DotNetCoreVerbosity.Minimal + }); + } + } }); Task("PrepareTestAssets:RestoreOnlyTestAssets") @@ -1109,6 +1141,7 @@ Task("Install") /// Task("All") .IsDependentOn("Cleanup") + .IsDependentOn("CleanUpMonoAssets") .IsDependentOn("Build") .IsDependentOn("Test") .IsDependentOn("Publish") @@ -1125,6 +1158,7 @@ Task("Default") /// Task("CI") .IsDependentOn("Cleanup") + .IsDependentOn("CleanUpMonoAssets") .IsDependentOn("Build") .IsDependentOn("Publish") .IsDependentOn("ExecuteRunScript"); diff --git a/build.json b/build.json index e5ab67bb58..984e7a98cc 100644 --- a/build.json +++ b/build.json @@ -13,7 +13,8 @@ "MonoRuntimeLinuxX64": "mono.linux-x86_64-6.12.0.122.zip", "MonoRuntimeLinuxArm64": "mono.linux-arm64-6.12.0.122.zip", "HostProjects": [ - "OmniSharp.Stdio.Driver" + "OmniSharp.Stdio.Driver", + "OmniSharp.Http.Driver" ], "TestProjects": [ "OmniSharp.MSBuild.Tests",