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

Update to latest .NET SDKs #2378

Merged
merged 1 commit into from
Apr 4, 2022
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
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

name: 'Build'
env:
DotNetVersion: "6.0.100"
DotNetVersion2: "3.1.415"
DotNetVersion: "6.0.201"
DotNetVersion2: "3.1.417"
NuGetVersion: "5.7.0"
MonoVersion: "6.12.0"
Artifacts: ${{ github.workspace }}/artifacts/
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests-net6.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

name: 'Tests net6.0'
env:
DotNetVersion: "6.0.100"
DotNetVersion2: "3.1.415"
DotNetVersion: "6.0.201"
DotNetVersion2: "3.1.417"
NuGetVersion: "5.7.0"
MonoVersion: "6.12.0"
Artifacts: ${{ github.workspace }}/artifacts/
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

name: 'Tests'
env:
DotNetVersion: "6.0.100"
DotNetVersion2: "3.1.415"
DotNetVersion: "6.0.201"
DotNetVersion2: "3.1.417"
NuGetVersion: "5.7.0"
MonoVersion: "6.12.0"
Artifacts: ${{ github.workspace }}/artifacts/
Expand Down
4 changes: 2 additions & 2 deletions .pipelines/init.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
parameters:
# Configuration: Release
Verbosity: Normal
DotNetVersion: "6.0.100"
DotNetVersion2: "3.1.415"
DotNetVersion: "6.0.201"
DotNetVersion2: "3.1.417"
CakeVersion: "1.1.0"
NuGetVersion: "5.7.0"
MonoVersion: ''
Expand Down
4 changes: 2 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ resources:

variables:
Verbosity: Diagnostic
DotNetVersion: "6.0.100"
DotNetVersion2: "3.1.415"
DotNetVersion: "6.0.201"
DotNetVersion2: "3.1.417"
CakeVersion: "1.1.0"
NuGetVersion: "5.7.0"
GitVersionVersion: "5.0.1"
Expand Down
6 changes: 3 additions & 3 deletions build.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"DotNetInstallScriptURL": "https://dot.net/v1",
"DotNetChannel": "Preview",
"DotNetVersions": [
"3.1.415",
"5.0.403",
"6.0.100"
"3.1.417",
"5.0.406",
"6.0.201"
],
"RequiredMonoVersion": "6.6.0",
"DownloadURL": "https://roslynomnisharp.blob.core.windows.net/ext",
Expand Down
2 changes: 1 addition & 1 deletion build/Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<MicrosoftExtensionPackageVersion>6.0.0</MicrosoftExtensionPackageVersion>
<MicrosoftTestPackageVersion>17.0.0</MicrosoftTestPackageVersion>
<MSBuildPackageVersion>17.0.0</MSBuildPackageVersion>
<NuGetPackageVersion>6.0.0</NuGetPackageVersion>
<NuGetPackageVersion>6.1.0</NuGetPackageVersion>
<RoslynPackageVersion>4.2.0-3.22169.1</RoslynPackageVersion>
<XunitPackageVersion>2.4.1</XunitPackageVersion>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"sdk": {
"version": "6.0.100"
"version": "6.0.201"
}
}
2 changes: 1 addition & 1 deletion src/OmniSharp.MSBuild/ProjectLoadListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ private static HashedString GetProjectId(ProjectLoadedEventArgs args)

private static HashedString GetSdkVersion(ProjectLoadedEventArgs args)
{
return _tfmAndFileHashingAlgorithm.HashInput(args.SdkVersion.ToString());
return _tfmAndFileHashingAlgorithm.HashInput(args.SdkVersion?.ToString());
}

private static HashedString GetSessionId(ProjectLoadedEventArgs args)
Expand Down
5 changes: 5 additions & 0 deletions src/OmniSharp.MSBuild/VsTfmAndFileExtHashingAlgorithm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ public class VsTfmAndFileExtHashingAlgorithm : IHasher

public HashedString HashInput(string cleartext)
{
if (cleartext is null)
{
return new HashedString(string.Empty);
}

long lHash = 0;

for (int i = 0; i < cleartext.Length; i++)
Expand Down
4 changes: 2 additions & 2 deletions test-assets/test-projects/ExternAlias/global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"sdk": {
"version": "3.1.415"
"version": "3.1.417"
}
}
}
2 changes: 1 addition & 1 deletion test-assets/test-projects/Net50Project/global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"sdk": {
"version": "5.0.403"
"version": "5.0.406"
}
}
2 changes: 1 addition & 1 deletion test-assets/test-projects/Net60Project/global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"sdk": {
"version": "6.0.100"
"version": "6.0.201"
}
}
2 changes: 1 addition & 1 deletion test-assets/test-projects/NetCore31Project/global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"sdk": {
"version": "3.1.415"
"version": "3.1.417"
}
}
2 changes: 1 addition & 1 deletion test-assets/test-projects/global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"sdk": {
"version": "3.1.415"
"version": "3.1.417"
}
}
6 changes: 3 additions & 3 deletions tests/OmniSharp.MSBuild.Tests/ProjectLoadListenerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ public async Task The_correct_sdk_version_is_emitted_NETCore3_1()
using var testProject = await TestAssets.Instance.GetTestProjectAsync("NetCore31Project");
using var host = CreateMSBuildTestHost(testProject.Directory, emitter.AsExportDescriptionProvider(LoggerFactory));
Assert.Single(emitter.ReceivedMessages);
Assert.Equal(GetHashedFileExtension("3.1.415"), emitter.ReceivedMessages[0].SdkVersion);
Assert.Equal(GetHashedFileExtension("3.1.417"), emitter.ReceivedMessages[0].SdkVersion);
}

[ConditionalFact(typeof(NonMonoRuntimeOnly))]
Expand All @@ -230,7 +230,7 @@ public async Task The_correct_sdk_version_is_emitted_NET5()
using var testProject = await TestAssets.Instance.GetTestProjectAsync("Net50Project");
using var host = CreateMSBuildTestHost(testProject.Directory, emitter.AsExportDescriptionProvider(LoggerFactory));
Assert.Equal(2, emitter.ReceivedMessages.Length);
Assert.Equal(GetHashedFileExtension("5.0.403"), emitter.ReceivedMessages[0].SdkVersion);
Assert.Equal(GetHashedFileExtension("5.0.406"), emitter.ReceivedMessages[0].SdkVersion);
}

[ConditionalFact(typeof(NonMonoRuntimeOnly))]
Expand All @@ -242,7 +242,7 @@ public async Task The_correct_sdk_version_is_emitted_NET6()
using var testProject = await TestAssets.Instance.GetTestProjectAsync("Net60Project");
using var host = CreateMSBuildTestHost(testProject.Directory, emitter.AsExportDescriptionProvider(LoggerFactory));
Assert.Single(emitter.ReceivedMessages);
Assert.Equal(GetHashedFileExtension("6.0.100"), emitter.ReceivedMessages[0].SdkVersion);
Assert.Equal(GetHashedFileExtension("6.0.201"), emitter.ReceivedMessages[0].SdkVersion);
}

private string GetHashedFileExtension(string fileExtension)
Expand Down
6 changes: 3 additions & 3 deletions tests/OmniSharp.MSBuild.Tests/ProjectWithAnalyzersTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public async Task WhenProjectEditorConfigIsChangedThenAnalyzerConfigurationUpdat
TestHelpers.GetConfigurationDataWithAnalyzerConfig(roslynAnalyzersEnabled: true, editorConfigEnabled: true)))
{
var initialProject = host.Workspace.CurrentSolution.Projects.Single();
var analyzerConfigDocument = initialProject.AnalyzerConfigDocuments.Single();
var analyzerConfigDocument = initialProject.AnalyzerConfigDocuments.Where(document => document.Name.Equals(".editorconfig")).Single();

File.WriteAllText(analyzerConfigDocument.FilePath, @"
root = true
Expand Down Expand Up @@ -159,7 +159,7 @@ public async Task WhenProjectIsLoadedThenItContainsAnalyzerConfigurationFromPare
var projectFolderPath = Path.GetDirectoryName(project.FilePath);
var projectParentFolderPath = Path.GetDirectoryName(projectFolderPath);

var analyzerConfigDocument = project.AnalyzerConfigDocuments.Single();
var analyzerConfigDocument = project.AnalyzerConfigDocuments.Where(document => document.Name.Equals(".editorconfig")).Single();
var editorConfigFolderPath = Path.GetDirectoryName(analyzerConfigDocument.FilePath);

Assert.Equal(projectParentFolderPath, editorConfigFolderPath);
Expand Down Expand Up @@ -196,7 +196,7 @@ public async Task WhenProjectParentEditorConfigIsChangedThenAnalyzerConfiguratio
TestHelpers.GetConfigurationDataWithAnalyzerConfig(roslynAnalyzersEnabled: true, editorConfigEnabled: true)))
{
var initialProject = host.Workspace.CurrentSolution.Projects.Single();
var analyzerConfigDocument = initialProject.AnalyzerConfigDocuments.Single();
var analyzerConfigDocument = initialProject.AnalyzerConfigDocuments.Where(document => document.Name.Equals(".editorconfig")).Single();

File.WriteAllText(analyzerConfigDocument.FilePath, @"
root = true
Expand Down
2 changes: 1 addition & 1 deletion tests/OmniSharp.Tests/DotNetCliServiceFacts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace OmniSharp.Tests
{
public class DotNetCliServiceFacts : AbstractTestFixture
{
private const string DotNetVersion = "6.0.100";
private const string DotNetVersion = "6.0.201";
private int Major { get; }
private int Minor { get; }
private int Patch { get; }
Expand Down