Upgrade to .NET 10, update packages, enable AOT and cleanup code

This commit is contained in:
Stone_Red
2026-03-05 18:00:34 +01:00
parent 1080873deb
commit 8ef621e61b
17 changed files with 146 additions and 71 deletions
@@ -8,19 +8,20 @@ using System.Text;
namespace YesNt.Interpreter.Generator;
[Generator]
public sealed class StatementRegistryGenerator : ISourceGenerator
public sealed class StatementRegistryGenerator : IIncrementalGenerator
{
private const string StatementAttributeName = "YesNt.Interpreter.Attributes.StatementAttribute";
private const string StaticStatementAttributeName = "YesNt.Interpreter.Attributes.StaticStatementAttribute";
public void Initialize(GeneratorInitializationContext context)
public void Initialize(IncrementalGeneratorInitializationContext context)
{
context.RegisterSourceOutput(
context.CompilationProvider,
Execute);
}
public void Execute(GeneratorExecutionContext context)
private static void Execute(SourceProductionContext context, Compilation compilation)
{
Compilation compilation = context.Compilation;
List<MethodRegistration> statementMethods = [];
List<MethodRegistration> staticStatementMethods = [];
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>netstandard2.1</TargetFramework>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<IsRoslynComponent>true</IsRoslynComponent>
@@ -8,6 +8,6 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.11.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="5.0.0" PrivateAssets="all" />
</ItemGroup>
</Project>