Skip to content

Commit 3c4aec2

Browse files
committed
Retarget to roslyn for VS 2022 Update 14
This drop support for VS 2019.
1 parent c676a8c commit 3c4aec2

13 files changed

+32
-22
lines changed

Directory.Packages.Analyzers.props

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
<Project>
22
<PropertyGroup>
3-
<CodeAnalysisVersionForAnalyzers>3.11.0</CodeAnalysisVersionForAnalyzers>
3+
<CodeAnalysisVersionForAnalyzers>4.14.0</CodeAnalysisVersionForAnalyzers>
44
</PropertyGroup>
55
<ItemGroup>
6-
<!-- These versions carefully chosen to support VS 2019 Update 11. -->
6+
<!-- These versions carefully chosen to support VS 2022 Update 14. -->
77
<PackageVersion Update="Microsoft.CodeAnalysis.Common" Version="$(CodeAnalysisVersionForAnalyzers)" />
88
<PackageVersion Update="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="$(CodeAnalysisVersionForAnalyzers)" />
99
<PackageVersion Update="Microsoft.CodeAnalysis.CSharp" Version="$(CodeAnalysisVersionForAnalyzers)" />
10-
<PackageVersion Update="System.Collections.Immutable" Version="5.0.0" />
11-
<PackageVersion Update="System.Memory" Version="4.5.4" />
12-
<PackageVersion Update="System.Reflection.Metadata" Version="5.0.0" />
13-
<PackageVersion Update="System.Runtime.CompilerServices.Unsafe" Version="5.0.0" />
14-
<PackageVersion Include="System.Text.Encodings.Web" Version="4.7.1" />
15-
<PackageVersion Update="System.Text.Json" Version="4.7.2" />
10+
<PackageVersion Update="System.Collections.Immutable" Version="9.0.0" />
11+
<PackageVersion Update="System.Memory" Version="4.5.5" />
12+
<PackageVersion Update="System.Reflection.Metadata" Version="9.0.0" />
13+
<PackageVersion Include="System.Text.Encodings.Web" Version="9.0.0" />
14+
<PackageVersion Update="System.Text.Json" Version="9.0.0" />
1615
</ItemGroup>
1716
</Project>

Directory.Packages.props

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@
1010
<WDKMetadataVersion>0.12.8-experimental</WDKMetadataVersion>
1111
<!-- <DiaMetadataVersion>0.2.185-preview-g7e1e6a442c</DiaMetadataVersion> -->
1212
<ApiDocsVersion>0.1.42-alpha</ApiDocsVersion>
13-
<CodeAnalysisVersion>4.13.0</CodeAnalysisVersion>
13+
<CodeAnalysisVersion>4.14.0</CodeAnalysisVersion>
1414
</PropertyGroup>
1515
<ItemGroup>
1616
<!-- We have to use the MessagePack version used by win32metadata (https://github.com/microsoft/CsWin32/issues/371) -->
1717
<PackageVersion Include="MessagePack" Version="2.2.85" />
1818
<PackageVersion Include="MessagePackAnalyzer" Version="2.5.192" />
19+
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="9.0.0" />
1920
<PackageVersion Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="3.3.4" />
2021
<PackageVersion Include="Microsoft.CodeAnalysis.Common" Version="$(CodeAnalysisVersion)" />
2122
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.SourceGenerators.Testing.XUnit" Version="1.1.3-beta1.24352.1" />

Microsoft.Windows.CsWin32.sln

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio Version 17
4-
VisualStudioVersion = 17.5.33110.383
3+
# Visual Studio Version 18
4+
VisualStudioVersion = 18.0.11018.11 main
55
MinimumVisualStudioVersion = 15.0.26124.0
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{1CE9670B-D5FF-46A7-9D00-24E70E6ED48B}"
77
ProjectSection(SolutionItems) = preProject
88
.editorconfig = .editorconfig
99
Directory.Build.props = Directory.Build.props
1010
Directory.Build.targets = Directory.Build.targets
11+
Directory.Packages.Analyzers.props = Directory.Packages.Analyzers.props
1112
Directory.Packages.props = Directory.Packages.props
1213
global.json = global.json
1314
nuget.config = nuget.config

azure-pipelines/integration-test.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
jobs:
2-
# Matrix over VS 2019 and VS 2022
2+
# Matrix over VS 2022 (and eventually VS 2026)
33

44
- job: integrationtest
55
displayName: 🧪 Integration tests
66
strategy:
77
matrix:
8-
vs2019:
9-
vmImage: windows-2019
10-
currentSdk: false
118
vs2022:
129
vmImage: windows-2022
1310
currentSdk: true

src/Microsoft.Windows.CsWin32/AnalyzerReleases.Unshipped.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@ PInvoke004 | Functionality | Warning | SourceGenerator
1212
PInvoke005 | Functionality | Warning | SourceGenerator
1313
PInvoke006 | Configuration | Warning | SourceGenerator
1414
PInvoke007 | Functionality | Error | SourceGenerator
15-
PInvoke008 | Configuration | Error | SourceGenerator
15+
PInvoke008 | Configuration | Error | SourceGenerator
16+
PInvoke009 | Configuration | Warning | SourceGenerator
17+
PInvoke010 | Configuration | Error | SourceGenerator

src/Microsoft.Windows.CsWin32/BindingRedirects.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ internal static class BindingRedirects
1010

1111
static BindingRedirects()
1212
{
13+
#pragma warning disable RS1035 // Do not use APIs banned for analyzers
1314
LocalAssemblies = new Lazy<Dictionary<string, string>>(
1415
() => Directory.GetFiles(SourceGeneratorAssemblyDirectory, "*.dll").ToDictionary(Path.GetFileNameWithoutExtension, StringComparer.OrdinalIgnoreCase));
16+
#pragma warning restore RS1035 // Do not use APIs banned for analyzers
1517
}
1618

1719
private static bool IsNetFramework => RuntimeInformation.FrameworkDescription.StartsWith(".NET Framework", StringComparison.OrdinalIgnoreCase);

src/Microsoft.Windows.CsWin32/Docs.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ public static Docs Get(string docsPath)
4040
}
4141
}
4242

43+
#pragma warning disable RS1035 // Do not use APIs banned for analyzers
4344
using FileStream docsStream = File.OpenRead(docsPath);
45+
#pragma warning restore RS1035 // Do not use APIs banned for analyzers
4446
Dictionary<string, ApiDetails>? data = MessagePackSerializer.Deserialize<Dictionary<string, ApiDetails>>(docsStream, MsgPackOptions);
4547
var docs = new Docs(data);
4648

src/Microsoft.Windows.CsWin32/MetadataCache.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ internal MetadataFile GetMetadataFile(string path)
1919
lock (this.metadataFiles)
2020
{
2121
MetadataFile? metadataFile;
22+
#pragma warning disable RS1035 // Do not use APIs banned for analyzers
2223
DateTime lastWriteTimeUtc = File.GetLastWriteTimeUtc(path);
24+
#pragma warning restore RS1035 // Do not use APIs banned for analyzers
2325
if (this.metadataFiles.TryGetValue(path, out metadataFile))
2426
{
2527
if (metadataFile.LastWriteTimeUtc == lastWriteTimeUtc)

src/Microsoft.Windows.CsWin32/MetadataFile.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ internal class MetadataFile : IDisposable
1919
internal MetadataFile(string path)
2020
{
2121
this.Path = path;
22+
#pragma warning disable RS1035 // Do not use APIs banned for analyzers
2223
this.LastWriteTimeUtc = File.GetLastWriteTimeUtc(path);
24+
#pragma warning restore RS1035 // Do not use APIs banned for analyzers
2325

2426
// When using FileShare.Delete, the OS will allow the file to be deleted, but it does not disrupt
2527
// our ability to read the file while our handle is open.

src/Microsoft.Windows.CsWin32/MetadataIndex.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ namespace Microsoft.Windows.CsWin32;
2121
[DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")]
2222
internal class MetadataIndex
2323
{
24+
#pragma warning disable RS1035 // Do not use APIs banned for analyzers
2425
private static readonly int MaxPooledObjectCount = Math.Max(Environment.ProcessorCount, 4);
26+
#pragma warning restore RS1035 // Do not use APIs banned for analyzers
2527

2628
private readonly MetadataFile metadataFile;
2729

0 commit comments

Comments
 (0)