Skip to content

Commit

Permalink
Merge pull request #2219 from JoeRobich/remove-netcore2.1
Browse files Browse the repository at this point in the history
Remove .NET Core 2.1
  • Loading branch information
JoeRobich authored Aug 30, 2021
2 parents 0892538 + 0b5bf49 commit 69990fd
Show file tree
Hide file tree
Showing 16 changed files with 20 additions and 77 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@ jobs:
with:
nuget-version: ${{ env.NuGetVersion }}

- name: 🔨 Use .NET Core 2.1 SDK
uses: actions/[email protected]
with:
dotnet-version: '2.1.x'

- name: 🔨 Use .NET Core ${{ env.DotNetVersion2 }} SDK
uses: actions/[email protected]
with:
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,6 @@ jobs:
with:
nuget-version: ${{ env.NuGetVersion }}

- name: 🔨 Use .NET Core 2.1 SDK
uses: actions/[email protected]
with:
dotnet-version: '2.1.x'

- name: 🔨 Use .NET Core ${{ env.DotNetVersion2 }} SDK
uses: actions/[email protected]
with:
Expand Down
2 changes: 0 additions & 2 deletions build.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"DotNetInstallScriptURL": "https://dot.net/v1",
"DotNetChannel": "Preview",
"DotNetVersions": [
"2.1.816",
"3.1.411",
"5.0.302",
"6.0.100-preview.6.21355.2"
Expand Down Expand Up @@ -45,7 +44,6 @@
"ProjectWithDisabledAnalyzers",
"ProjectWithDisabledAnalyzers2",
"ProjectWithAnalyzers",
"NetCore21Project",
"NetCore31Project",
"Net50Project",
"ProjectWithAnalyzersAndEditorConfig",
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;netcoreapp2.1;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net472;netcoreapp3.1;netstandard2.0</TargetFrameworks>
<PlatformTarget>AnyCPU</PlatformTarget>
<RootNamespace>OmniSharp</RootNamespace>
<IsPackable>true</IsPackable>
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;netcoreapp2.1</TargetFrameworks>
<TargetFrameworks>net472;netcoreapp3.1</TargetFrameworks>
<PlatformTarget>AnyCPU</PlatformTarget>
<IsPackable>true</IsPackable>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
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;netcoreapp2.1;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net472;netcoreapp3.1;netstandard2.0</TargetFrameworks>
<PlatformTarget>AnyCPU</PlatformTarget>
<IsPackable>true</IsPackable>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,12 @@ protected async Task<ImmutableArray<DocumentDiagnostics>> GetDiagnosticsAsync(Fi
private static string GetNewFilePath(string newFileName, string currentFilePath)
{
var directory = Path.GetDirectoryName(currentFilePath);
if (directory is null)
{
// if the current file path is not nested within a directory, then return the new filename.
return newFileName;
}

return Path.Combine(directory, newFileName);
}
}
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;netcoreapp2.1;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net472;netcoreapp3.1;netstandard2.0</TargetFrameworks>
<PlatformTarget>AnyCPU</PlatformTarget>
<IsPackable>true</IsPackable>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
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;netcoreapp2.1;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net472;netcoreapp3.1;netstandard2.0</TargetFrameworks>
<PlatformTarget>AnyCPU</PlatformTarget>
<RootNamespace>OmniSharp</RootNamespace>
<IsPackable>true</IsPackable>
Expand Down

This file was deleted.

12 changes: 0 additions & 12 deletions test-assets/test-projects/NetCore21Project/Program.cs

This file was deleted.

5 changes: 0 additions & 5 deletions test-assets/test-projects/NetCore21Project/global.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>

</Project>
18 changes: 3 additions & 15 deletions tests/OmniSharp.MSBuild.Tests/ProjectLoadListenerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public async Task The_output_kind_is_emitted()
// Arrange
var emitter = new ProjectLoadTestEventEmitter();

using var testProject = await TestAssets.Instance.GetTestProjectAsync("NetCore21Project");
using var testProject = await TestAssets.Instance.GetTestProjectAsync("NetCore31Project");
using var host = CreateMSBuildTestHost(testProject.Directory, emitter.AsExportDescriptionProvider(LoggerFactory));
Assert.Single(emitter.ReceivedMessages);
Assert.Equal((int)OutputKind.ConsoleApplication, emitter.ReceivedMessages[0].OutputKind);
Expand All @@ -182,22 +182,10 @@ public async Task The_correct_project_capablities_is_emitted()
// 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("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 testProject = await TestAssets.Instance.GetTestProjectAsync("NetCore31Project");
using var host = CreateMSBuildTestHost(testProject.Directory, emitter.AsExportDescriptionProvider(LoggerFactory));
Assert.Single(emitter.ReceivedMessages);
Assert.Equal(GetHashedFileExtension("2.1.816"), emitter.ReceivedMessages[0].SdkVersion);
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]
Expand Down
22 changes: 4 additions & 18 deletions tests/OmniSharp.MSBuild.Tests/WorkspaceInformationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,18 @@ public async Task TestProjectAndSolutionFilter()
var project = Assert.Single(workspaceInfo.Projects);

Assert.Equal("ProjectAndSolutionFilter", project.AssemblyName);
Assert.Equal("bin/Debug/netcoreapp2.1/", project.OutputPath.EnsureForwardSlashes());
Assert.Equal("obj/Debug/netcoreapp2.1/", project.IntermediateOutputPath.EnsureForwardSlashes());
Assert.Equal("bin/Debug/netcoreapp3.1/", project.OutputPath.EnsureForwardSlashes());
Assert.Equal("obj/Debug/netcoreapp3.1/", project.IntermediateOutputPath.EnsureForwardSlashes());
var expectedTargetPath = $"{testProject.Directory}/Project/{project.OutputPath}ProjectAndSolutionFilter.dll".EnsureForwardSlashes();
Assert.Equal(expectedTargetPath, project.TargetPath.EnsureForwardSlashes());
Assert.Equal("Debug", project.Configuration);
Assert.Equal("AnyCPU", project.Platform);
Assert.True(project.IsExe);
Assert.False(project.IsUnityProject);

Assert.Equal(".NETCoreApp,Version=v2.1", project.TargetFramework);
Assert.Equal(".NETCoreApp,Version=v3.1", project.TargetFramework);
var targetFramework = Assert.Single(project.TargetFrameworks);
Assert.Equal("netcoreapp2.1", targetFramework.ShortName);
Assert.Equal("netcoreapp3.1", targetFramework.ShortName);
}
}

Expand All @@ -87,20 +87,6 @@ public async Task ProjectAndSolutionWithProjectSection()
Assert.Equal("netcoreapp3.1", project.TargetFrameworks[0].ShortName);
}

[Fact]
public async Task NetCore21Project()
{
using var testProject = await TestAssets.Instance.GetTestProjectAsync("NetCore21Project");
using var host = CreateMSBuildTestHost(testProject.Directory);
var workspaceInfo = await host.RequestMSBuildWorkspaceInfoAsync();

Assert.NotNull(workspaceInfo.Projects);
var project = Assert.Single(workspaceInfo.Projects);
Assert.Equal("NetCore21Project", project.AssemblyName);
Assert.Equal(".NETCoreApp,Version=v2.1", project.TargetFramework);
Assert.Equal("netcoreapp2.1", project.TargetFrameworks[0].ShortName);
}

[Fact]
public async Task Net50Solution()
{
Expand Down

0 comments on commit 69990fd

Please sign in to comment.