Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move OmniSharp vNext to run on .NET 6 #2279

Merged
merged 3 commits into from
Nov 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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/
Expand Down Expand Up @@ -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:
Expand Down
26 changes: 13 additions & 13 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -877,44 +877,44 @@ Task("PublishMonoBuilds")
}
});

Task("PublishNet5Builds")
Task("PublishNet6Builds")
.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");
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");
}
}

Expand Down Expand Up @@ -1022,7 +1022,7 @@ Task("PublishNuGet")
Task("Publish")
.IsDependentOn("Build")
.IsDependentOn("PublishMonoBuilds")
.IsDependentOn("PublishNet5Builds")
.IsDependentOn("PublishNet6Builds")
.IsDependentOn("PublishWindowsBuilds")
.IsDependentOn("PublishNuGet");

Expand Down
10 changes: 5 additions & 5 deletions build/Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

<PropertyGroup>
<AspNetCorePackageVersion>2.2.0</AspNetCorePackageVersion>
<MicrosoftExtensionPackageVersion>5.0.0</MicrosoftExtensionPackageVersion>
<MicrosoftTestPackageVersion>16.9.4</MicrosoftTestPackageVersion>
<MSBuildPackageVersion>16.10.0</MSBuildPackageVersion>
<NuGetPackageVersion>5.11.0</NuGetPackageVersion>
<MicrosoftExtensionPackageVersion>6.0.0</MicrosoftExtensionPackageVersion>
<MicrosoftTestPackageVersion>17.0.0</MicrosoftTestPackageVersion>
<MSBuildPackageVersion>17.0.0</MSBuildPackageVersion>
<NuGetPackageVersion>6.0.0</NuGetPackageVersion>
<RoslynPackageVersion>4.0.0-6.21526.21</RoslynPackageVersion>
<XunitPackageVersion>2.4.1</XunitPackageVersion>
</PropertyGroup>
Expand Down Expand Up @@ -65,7 +65,7 @@
<PackageReference Update="Microsoft.VisualStudio.Setup.Configuration.Interop" Version="1.14.114" />
<PackageReference Update="Microsoft.VisualStudio.SDK.EmbedInteropTypes" Version="15.0.12" />

<PackageReference Update="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Update="Newtonsoft.Json" Version="13.0.1" />

<PackageReference Update="NuGet.Packaging" Version="$(NuGetPackageVersion)" />
<PackageReference Update="NuGet.Packaging.Core" Version="$(NuGetPackageVersion)" />
Expand Down
2 changes: 1 addition & 1 deletion src/OmniSharp.Abstractions/OmniSharp.Abstractions.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net5.0;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net6.0;net472;netstandard2.0</TargetFrameworks>
<PlatformTarget>AnyCPU</PlatformTarget>
<RootNamespace>OmniSharp</RootNamespace>
<IsPackable>true</IsPackable>
Expand Down
2 changes: 1 addition & 1 deletion src/OmniSharp.Cake/OmniSharp.Cake.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<TargetFrameworks>net6.0;net472</TargetFrameworks>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -59,7 +60,7 @@ protected override async Task<GotoDefinitionResponse> TranslateResponse(GotoDefi

if (!request.WantMetadata)
{
continue;
continue;
}

var aliasLocations = await GotoDefinitionHandlerHelper.GetAliasFromMetadataAsync(
Expand Down
6 changes: 3 additions & 3 deletions src/OmniSharp.DotNetTest/OmniSharp.DotNetTest.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net5.0</TargetFrameworks>
<TargetFrameworks>net6.0;net472</TargetFrameworks>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>

Expand All @@ -18,8 +18,8 @@
<!-- New VSTest 'dotnet test' support -->
<ItemGroup>
<PackageReference Include="Microsoft.TestPlatform.TranslationLayer" />
<PackageReference Condition="'$(TargetFramework)' == 'net5.0'" Include="Microsoft.TestPlatform.ObjectModel" />
<PackageReference Condition="'$(TargetFramework)' == 'net5.0'" Include="System.Runtime.InteropServices.RuntimeInformation" />
<PackageReference Condition="'$(TargetFramework)' == 'net6.0'" Include="Microsoft.TestPlatform.ObjectModel" />
<PackageReference Condition="'$(TargetFramework)' == 'net6.0'" Include="System.Runtime.InteropServices.RuntimeInformation" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -20,9 +22,9 @@ public override ImmutableArray<MSBuildInstance> 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)
{
Expand Down
2 changes: 1 addition & 1 deletion src/OmniSharp.Host/OmniSharp.Host.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net5.0</TargetFrameworks>
<TargetFrameworks>net6.0;net472</TargetFrameworks>
<PlatformTarget>AnyCPU</PlatformTarget>
<RootNamespace>OmniSharp</RootNamespace>
<IsPackable>true</IsPackable>
Expand Down
2 changes: 1 addition & 1 deletion src/OmniSharp.Http.Driver/OmniSharp.Http.Driver.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net5.0</TargetFrameworks>
<TargetFrameworks>net6.0;net472</TargetFrameworks>
<PlatformTarget>AnyCPU</PlatformTarget>
<AssemblyName>OmniSharp</AssemblyName>
<OutputType>Exe</OutputType>
Expand Down
2 changes: 1 addition & 1 deletion src/OmniSharp.Http/OmniSharp.Http.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net5.0</TargetFrameworks>
<TargetFrameworks>net6.0;net472</TargetFrameworks>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net5.0</TargetFrameworks>
<TargetFrameworks>net6.0;net472</TargetFrameworks>
<PlatformTarget>AnyCPU</PlatformTarget>
<AssemblyName>OmniSharp.LanguageServerProtocol</AssemblyName>
<PreserveCompilationContext>true</PreserveCompilationContext>
Expand Down
2 changes: 1 addition & 1 deletion src/OmniSharp.MSBuild/OmniSharp.MSBuild.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net5.0</TargetFrameworks>
<TargetFrameworks>net6.0;net472</TargetFrameworks>
<PlatformTarget>AnyCPU</PlatformTarget>
<IsPackable>true</IsPackable>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
Expand Down
1 change: 1 addition & 0 deletions src/OmniSharp.MSBuild/ProjectFile/PropertyNames.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 4 additions & 1 deletion src/OmniSharp.MSBuild/ProjectLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ private static Dictionary<string, string> 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);
Expand Down
2 changes: 1 addition & 1 deletion src/OmniSharp.Roslyn.CSharp/OmniSharp.Roslyn.CSharp.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net5.0;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net6.0;net472;netstandard2.0</TargetFrameworks>
<PlatformTarget>AnyCPU</PlatformTarget>
<IsPackable>true</IsPackable>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
Expand Down
2 changes: 1 addition & 1 deletion src/OmniSharp.Roslyn/OmniSharp.Roslyn.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net5.0;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net6.0;net472;netstandard2.0</TargetFrameworks>
<PlatformTarget>AnyCPU</PlatformTarget>
<IsPackable>true</IsPackable>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
Expand Down
2 changes: 1 addition & 1 deletion src/OmniSharp.Script/OmniSharp.Script.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net5.0</TargetFrameworks>
<TargetFrameworks>net6.0;net472</TargetFrameworks>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/OmniSharp.Shared/OmniSharp.Shared.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net5.0;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net6.0;net472;netstandard2.0</TargetFrameworks>
<PlatformTarget>AnyCPU</PlatformTarget>
<RootNamespace>OmniSharp</RootNamespace>
<IsPackable>true</IsPackable>
Expand Down
2 changes: 1 addition & 1 deletion src/OmniSharp.Stdio.Driver/OmniSharp.Stdio.Driver.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net5.0</TargetFrameworks>
<TargetFrameworks>net6.0;net472</TargetFrameworks>
<PlatformTarget>AnyCPU</PlatformTarget>
<AssemblyName>OmniSharp</AssemblyName>
<OutputType>Exe</OutputType>
Expand Down
2 changes: 1 addition & 1 deletion src/OmniSharp.Stdio/OmniSharp.Stdio.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net5.0</TargetFrameworks>
<TargetFrameworks>net6.0;net472</TargetFrameworks>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion tests/OmniSharp.Cake.Tests/OmniSharp.Cake.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<TargetFrameworks>net6.0;net472</TargetFrameworks>
<PlatformTarget>AnyCPU</PlatformTarget>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net5.0</TargetFrameworks>
<TargetFrameworks>net6.0;net472</TargetFrameworks>
<PlatformTarget>AnyCPU</PlatformTarget>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion tests/OmniSharp.Http.Tests/OmniSharp.Http.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net5.0</TargetFrameworks>
<TargetFrameworks>net6.0;net472</TargetFrameworks>
<PlatformTarget>AnyCPU</PlatformTarget>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion tests/OmniSharp.Lsp.Tests/OmniSharp.Lsp.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net5.0</TargetFrameworks>
<TargetFrameworks>net6.0;net472</TargetFrameworks>
<PlatformTarget>AnyCPU</PlatformTarget>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net5.0</TargetFrameworks>
<TargetFrameworks>net6.0;net472</TargetFrameworks>
<PlatformTarget>AnyCPU</PlatformTarget>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net5.0</TargetFrameworks>
<TargetFrameworks>net6.0;net472</TargetFrameworks>
<PlatformTarget>AnyCPU</PlatformTarget>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<WarningsNotAsErrors>CS0618</WarningsNotAsErrors>
Expand Down
2 changes: 1 addition & 1 deletion tests/OmniSharp.Script.Tests/OmniSharp.Script.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net5.0</TargetFrameworks>
<TargetFrameworks>net6.0;net472</TargetFrameworks>
<PlatformTarget>AnyCPU</PlatformTarget>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
</PropertyGroup>
Expand Down
Loading