Skip to content

Commit 2f5eb43

Browse files
committed
Update to target .NET 10
1 parent e1132cf commit 2f5eb43

File tree

15 files changed

+28
-23
lines changed

15 files changed

+28
-23
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ dotnet_style_qualification_for_method = false:error
244244
dotnet_style_qualification_for_property = false:error
245245

246246
dotnet_style_readonly_field = true:error
247-
dotnet_style_require_accessibility_modifiers = always:error
247+
dotnet_style_require_accessibility_modifiers = for_non_interface_members:error
248248

249249
###############################################################################
250250
# Set dotnet style options to:

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "8.0.100",
3+
"version": "10.0.100-preview",
44
"allowPrerelease": true,
55
"rollForward": "latestFeature"
66
}

scripts/build.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ try {
172172
$DotNetInstallDirectory = Join-Path -Path $ArtifactsDir -ChildPath "dotnet"
173173
Create-Directory -Path $DotNetInstallDirectory
174174

175-
& $DotNetInstallScript -Channel 8.0 -Version latest -InstallDir $DotNetInstallDirectory -Architecture $architecture
175+
& $DotNetInstallScript -Channel 10.0 -Version latest -InstallDir $DotNetInstallDirectory -Architecture $architecture
176176

177177
$env:PATH="$DotNetInstallDirectory;$env:PATH"
178178
}

scripts/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ if [[ ! -z "$architecture" ]]; then
204204
DotNetInstallDirectory="$ArtifactsDir/dotnet"
205205
CreateDirectory "$DotNetInstallDirectory"
206206

207-
. "$DotNetInstallScript" --channel 8.0 --version latest --install-dir "$DotNetInstallDirectory" --architecture "$architecture"
207+
. "$DotNetInstallScript" --channel 10.0 --version latest --install-dir "$DotNetInstallDirectory" --architecture "$architecture"
208208

209209
PATH="$DotNetInstallDirectory:$PATH:"
210210
fi

sources/ClangSharp.Interop/ClangSharp.Interop.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Project Sdk="Microsoft.NET.Sdk">
33

44
<PropertyGroup>
5-
<TargetFrameworks>net8.0</TargetFrameworks>
5+
<TargetFrameworks>net10.0</TargetFrameworks>
66
</PropertyGroup>
77

88
<PropertyGroup>

sources/ClangSharp.PInvokeGenerator/ClangSharp.PInvokeGenerator.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<PropertyGroup>
55
<RootNamespace>ClangSharp</RootNamespace>
6-
<TargetFrameworks>net8.0</TargetFrameworks>
6+
<TargetFrameworks>net10.0</TargetFrameworks>
77
</PropertyGroup>
88

99
<PropertyGroup>

sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.VisitDecl.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ private void VisitFunctionDecl(FunctionDecl functionDecl)
627627
}
628628
},
629629
CustomAttrGeneratorData = (functionDecl, _outputBuilder, this),
630-
ParameterTypes = overloadCount > 1 ? functionDecl.Parameters.Select(param => GetTargetTypeName(param, out var _)).ToArray() : null,
630+
ParameterTypes = overloadCount > 1 ? [.. functionDecl.Parameters.Select(param => GetTargetTypeName(param, out var _))] : null,
631631
};
632632
Debug.Assert(_outputBuilder is not null);
633633

sources/ClangSharp/ClangSharp.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22
<Project Sdk="Microsoft.NET.Sdk">
33

44
<PropertyGroup>
5-
<TargetFrameworks>net8.0</TargetFrameworks>
5+
<TargetFrameworks>net10.0</TargetFrameworks>
66
</PropertyGroup>
77

88
<PropertyGroup>
99
<!-- CA1034: Nested types should not be visible -->
1010
<!-- CA1040: Avoid empty interfaces -->
1111
<!-- CA1720: Identifiers should not contain type names -->
12-
<NoWarn>$(NoWarn);CA1034;CA1040;CA1720</NoWarn>
12+
<!-- IDE0130: Namespace does not match folder structure -->
13+
<NoWarn>$(NoWarn);CA1034;CA1040;CA1720;IDE0130</NoWarn>
1314
</PropertyGroup>
1415

1516
<ItemGroup>

sources/ClangSharp/Cursors/Refs/OverloadedDeclRef.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@ internal OverloadedDeclRef(CXCursor handle) : base(handle, CXCursor_OverloadedDe
1616
{
1717
_overloadedDecls = new ValueLazy<IEnumerable<Decl>>(() => {
1818
var num = Handle.NumOverloadedDecls;
19-
return Enumerable.Range(0, (int)num)
19+
return [.. Enumerable.Range(0, (int)num)
2020
.Select(i => Handle.GetOverloadedDecl((uint)i))
21-
.Select(c => TranslationUnit.GetOrCreate<Decl>(c))
22-
.ToArray();
21+
.Select(c => TranslationUnit.GetOrCreate<Decl>(c))];
2322
});
2423
}
2524

sources/ClangSharp/TranslationUnit.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,18 @@
44
using System.Collections.Concurrent;
55
using System.Collections.Generic;
66
using System.Diagnostics;
7+
using System.Threading;
78
using ClangSharp.Interop;
8-
using static ClangSharp.Interop.CXTypeKind;
9-
using static ClangSharp.Interop.CXTemplateArgumentKind;
109
using static ClangSharp.Interop.CX_TemplateNameKind;
10+
using static ClangSharp.Interop.CXTemplateArgumentKind;
11+
using static ClangSharp.Interop.CXTypeKind;
1112

1213
namespace ClangSharp;
1314

1415
public sealed unsafe class TranslationUnit : IDisposable, IEquatable<TranslationUnit>
1516
{
1617
private static readonly ConcurrentDictionary<CXTranslationUnit, WeakReference<TranslationUnit>> s_createdTranslationUnits = new ConcurrentDictionary<CXTranslationUnit, WeakReference<TranslationUnit>>();
17-
private static readonly object s_createTranslationUnitLock = new object();
18+
private static readonly Lock s_createTranslationUnitLock = new Lock();
1819

1920
private readonly Dictionary<CXCursor, WeakReference<Cursor>> _createdCursors;
2021
private readonly Dictionary<CX_TemplateArgument, WeakReference<TemplateArgument>> _createdTemplateArguments;

0 commit comments

Comments
 (0)