From 2f3bc2d526bd1ee32871b1796e060241ee20a8cd Mon Sep 17 00:00:00 2001 From: GwWuYou <95328647+GeWuYou@users.noreply.github.com> Date: Thu, 25 Dec 2025 21:22:20 +0800 Subject: [PATCH] =?UTF-8?q?feat(godot-source-generators):=20=E9=87=8D?= =?UTF-8?q?=E6=9E=84Godot=E6=BA=90=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90?= =?UTF-8?q?=E5=99=A8=E9=A1=B9=E7=9B=AE=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将TargetFramework从net10.0更改为netstandard2.0以提高兼容性 - 添加必要的using语句(System和System.Linq)到GodotLoggerGenerator - 配置项目属性以支持Roslyn分析器功能,包括GeneratePackageOnBuild、 IsRoslynAnalyzer等设置 - 添加EnforceExtendedAnalyzerRules以启用扩展规则验证 - 配置项目引用GFramework.Godot.SourceGenerators.Attributes并设置 PrivateAssets="all"避免运行时依赖 - 设置打包配置将生成器DLL打包为analyzers/dotnet/cs路径 - 修正GodotLogAttribute命名空间为GFramework.Godot.SourceGenerators.Attributes.logging - 更新PackageId为GeWuYou.GFramework.SourceGenerators.Attributes - 移除不必要的PackageReadmeFile配置 --- ...k.Godot.SourceGenerators.Attributes.csproj | 7 +++-- .../logging/GodotLogAttribute.cs | 4 ++- .../GFramework.Godot.SourceGenerators.csproj | 31 +++++++++++++++++-- .../logging/GodotLoggerGenerator.cs | 4 ++- ...amework.SourceGenerators.Attributes.csproj | 2 +- .../GFramework.SourceGenerators.csproj | 1 - 6 files changed, 39 insertions(+), 10 deletions(-) diff --git a/GFramework.Godot.SourceGenerators.Attributes/GFramework.Godot.SourceGenerators.Attributes.csproj b/GFramework.Godot.SourceGenerators.Attributes/GFramework.Godot.SourceGenerators.Attributes.csproj index 237d661..bd765aa 100644 --- a/GFramework.Godot.SourceGenerators.Attributes/GFramework.Godot.SourceGenerators.Attributes.csproj +++ b/GFramework.Godot.SourceGenerators.Attributes/GFramework.Godot.SourceGenerators.Attributes.csproj @@ -1,9 +1,10 @@  - net10.0 - enable - enable + netstandard2.0 + GeWuYou.GFramework.SourceGenerators.Attributes + 1.0.0 + 10 diff --git a/GFramework.Godot.SourceGenerators.Attributes/logging/GodotLogAttribute.cs b/GFramework.Godot.SourceGenerators.Attributes/logging/GodotLogAttribute.cs index 4508d35..41a6bdd 100644 --- a/GFramework.Godot.SourceGenerators.Attributes/logging/GodotLogAttribute.cs +++ b/GFramework.Godot.SourceGenerators.Attributes/logging/GodotLogAttribute.cs @@ -1,5 +1,7 @@ #nullable enable -namespace GFramework.SourceGenerators.Attributes.logging; +using System; + +namespace GFramework.Godot.SourceGenerators.Attributes.logging; /// /// Godot日志特性,用于在类上标记以自动生成日志字段 diff --git a/GFramework.Godot.SourceGenerators/GFramework.Godot.SourceGenerators.csproj b/GFramework.Godot.SourceGenerators/GFramework.Godot.SourceGenerators.csproj index 350752c..846ea41 100644 --- a/GFramework.Godot.SourceGenerators/GFramework.Godot.SourceGenerators.csproj +++ b/GFramework.Godot.SourceGenerators/GFramework.Godot.SourceGenerators.csproj @@ -1,9 +1,21 @@  - net10.0 - enable - enable + GeWuYou.GFramework.Godot.SourceGenerators + netstandard2.0 + true + true + latest + true + + + true + + false + + true + Generated + true @@ -16,4 +28,17 @@ + + + + + + + + + + diff --git a/GFramework.Godot.SourceGenerators/logging/GodotLoggerGenerator.cs b/GFramework.Godot.SourceGenerators/logging/GodotLoggerGenerator.cs index ef84ac4..3abd4e1 100644 --- a/GFramework.Godot.SourceGenerators/logging/GodotLoggerGenerator.cs +++ b/GFramework.Godot.SourceGenerators/logging/GodotLoggerGenerator.cs @@ -1,4 +1,6 @@ -using System.Text; +using System; +using System.Linq; +using System.Text; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; diff --git a/GFramework.SourceGenerators.Attributes/GFramework.SourceGenerators.Attributes.csproj b/GFramework.SourceGenerators.Attributes/GFramework.SourceGenerators.Attributes.csproj index 2bac1cd..698a56e 100644 --- a/GFramework.SourceGenerators.Attributes/GFramework.SourceGenerators.Attributes.csproj +++ b/GFramework.SourceGenerators.Attributes/GFramework.SourceGenerators.Attributes.csproj @@ -1,7 +1,7 @@  netstandard2.0 - GeWuYou.GFramework.Generator.Attributes + GeWuYou.GFramework.SourceGenerators.Attributes 1.0.0 10 diff --git a/GFramework.SourceGenerators/GFramework.SourceGenerators.csproj b/GFramework.SourceGenerators/GFramework.SourceGenerators.csproj index b62eee6..c0ed0f2 100644 --- a/GFramework.SourceGenerators/GFramework.SourceGenerators.csproj +++ b/GFramework.SourceGenerators/GFramework.SourceGenerators.csproj @@ -12,7 +12,6 @@ true false - README.md true Generated