Skip to content

Commit aac9b59

Browse files
Fix type forwarding for init/record workaround (#895)
* Update `nuke.globaltool` to fix macOS CI * Revert "disable macos builds for now" This reverts commit 82934b6 and commit 9b583ba. * Fix type forwarding for `init` and `record` workaround * Only target `net6.0` for tests So they don't need `IsExternalInit` defined too.
1 parent 7fd2219 commit aac9b59

File tree

16 files changed

+23
-124
lines changed

16 files changed

+23
-124
lines changed

.azure-pipelines.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ jobs:
6363
Linux:
6464
BuildName: 'Linux'
6565
ImageName: 'ubuntu-latest'
66-
# macOS:
67-
# BuildName: 'macOS'
68-
# ImageName: 'macOS-latest'
66+
macOS:
67+
BuildName: 'macOS'
68+
ImageName: 'macOS-latest'
6969
pool:
7070
vmImage: $(ImageName)
7171
steps:

.config/dotnet-tools.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
]
2222
},
2323
"nuke.globaltool": {
24-
"version": "6.0.3",
24+
"version": "6.2.1",
2525
"commands": [
2626
"nuke"
2727
]

.github/workflows/ci.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,7 @@ jobs:
7575
strategy:
7676
fail-fast: false
7777
matrix:
78-
os:
79-
# - macOS-latest
80-
- windows-latest
81-
- ubuntu-latest
78+
os: [macOS-latest, windows-latest, ubuntu-latest]
8279
runs-on: ${{ matrix.os }}
8380
steps:
8481
- name: Checkout

sample/SampleServer/SampleServer.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
55
<IsPackable>false</IsPackable>
6-
<TargetFramework>netcoreapp3.1</TargetFramework>
6+
<TargetFramework>net6.0</TargetFramework>
77
<RuntimeIdentifier>win7-x64</RuntimeIdentifier>
88
<LangVersion>latest</LangVersion>
99
</PropertyGroup>

src/JsonRpc.Generators/Records.cs

+5-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#pragma warning disable MA0048 // File name must match type name
2-
#define INTERNAL_RECORD_ATTRIBUTES
3-
#if NETSTANDARD2_0 || NETSTANDARD2_1 || NETCOREAPP2_0 || NETCOREAPP2_1 || NETCOREAPP2_2 || NET45 || NET451 || NET452 || NET6 || NET461 || NET462 || NET47 || NET471 || NET472 || NET48
2+
#if NET5_0_OR_GREATER
3+
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.CompilerServices.IsExternalInit))]
4+
#else
5+
46
using System.ComponentModel;
57

68
// ReSharper disable once CheckNamespace
@@ -11,12 +13,7 @@ namespace System.Runtime.CompilerServices
1113
/// This class should not be used by developers in source code.
1214
/// </summary>
1315
[EditorBrowsable(EditorBrowsableState.Never)]
14-
#if INTERNAL_RECORD_ATTRIBUTES
15-
internal
16-
#else
17-
public
18-
#endif
19-
static class IsExternalInit
16+
internal static class IsExternalInit
2017
{
2118
}
2219
}

src/JsonRpc/Nullable/Records.cs

+5-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#pragma warning disable MA0048 // File name must match type name
2-
#define INTERNAL_RECORD_ATTRIBUTES
3-
#if NETSTANDARD || NETCOREAPP
2+
#if NET5_0_OR_GREATER
3+
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.CompilerServices.IsExternalInit))]
4+
#else
5+
46
using System.ComponentModel;
57

68
// ReSharper disable once CheckNamespace
@@ -11,12 +13,7 @@ namespace System.Runtime.CompilerServices
1113
/// This class should not be used by developers in source code.
1214
/// </summary>
1315
[EditorBrowsable(EditorBrowsableState.Never)]
14-
#if INTERNAL_RECORD_ATTRIBUTES
15-
internal
16-
#else
17-
public
18-
#endif
19-
static class IsExternalInit
16+
internal static class IsExternalInit
2017
{
2118
}
2219
}

test/Client.Tests/Client.Tests.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netcoreapp3.1;net6.0</TargetFrameworks>
4+
<TargetFrameworks>net6.0</TargetFrameworks>
55
<AssemblyName>OmniSharp.Extensions.LanguageClient.Tests</AssemblyName>
66
<RootNamespace>OmniSharp.Extensions.LanguageServer.Client.Tests</RootNamespace>
77
</PropertyGroup>

test/Dap.Tests/Dap.Tests.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>netcoreapp3.1;net6.0</TargetFrameworks>
3+
<TargetFrameworks>net6.0</TargetFrameworks>
44
<WarningsAsErrors>true</WarningsAsErrors>
55
<PlatformTarget>AnyCPU</PlatformTarget>
66
</PropertyGroup>
@@ -16,6 +16,6 @@
1616
<ProjectReference Include="..\..\src\JsonRpc.Generators\JsonRpc.Generators.csproj" IncludeAssets="analyzers" ExcludeAssets="compile;runtime;native" PrivateAssets="contentfiles;build;buildMultitargeting;buildTransitive" OutputItemType="Analyzer" />
1717
</ItemGroup>
1818
<ItemGroup>
19-
<Folder Include="obj\Release\netcoreapp3.1\" />
19+
<Folder Include="obj\Release\net6.0\" />
2020
</ItemGroup>
2121
</Project>

test/Dap.Tests/Records.cs

-23
This file was deleted.

test/Generation.Tests/Generation.Tests.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>netcoreapp3.1;net6.0</TargetFrameworks>
3+
<TargetFrameworks>net6.0</TargetFrameworks>
44
<WarningsAsErrors>true</WarningsAsErrors>
55
<PlatformTarget>AnyCPU</PlatformTarget>
66
</PropertyGroup>

test/Generation.Tests/Records.cs

-23
This file was deleted.

test/JsonRpc.Tests/JsonRpc.Tests.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>netcoreapp3.1;net6.0</TargetFrameworks>
3+
<TargetFrameworks>net6.0</TargetFrameworks>
44
<WarningsAsErrors>true</WarningsAsErrors>
55
<PlatformTarget>AnyCPU</PlatformTarget>
66
</PropertyGroup>

test/Lsp.Integration.Tests/Lsp.Integration.Tests.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>net6.0;netcoreapp3.1;net6.0</TargetFrameworks>
3+
<TargetFrameworks>net6.0</TargetFrameworks>
44
<WarningsAsErrors>true</WarningsAsErrors>
55
<PlatformTarget>AnyCPU</PlatformTarget>
66
</PropertyGroup>

test/Lsp.Integration.Tests/Records.cs

-23
This file was deleted.

test/Lsp.Tests/Lsp.Tests.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>net6.0;netcoreapp3.1;net6.0</TargetFrameworks>
3+
<TargetFrameworks>net6.0</TargetFrameworks>
44
<WarningsAsErrors>true</WarningsAsErrors>
55
<PlatformTarget>AnyCPU</PlatformTarget>
66
</PropertyGroup>

test/Lsp.Tests/Records.cs

-23
This file was deleted.

0 commit comments

Comments
 (0)