From d582dffe4047f4a785986487e9881b25d1773ba6 Mon Sep 17 00:00:00 2001 From: GeWuYou <95328647+GeWuYou@users.noreply.github.com> Date: Sat, 21 Mar 2026 21:20:32 +0800 Subject: [PATCH 1/3] =?UTF-8?q?refactor(generators):=20=E5=B0=86=E6=BA=90?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90=E5=99=A8=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E7=9B=AE=E6=A0=87=E6=A1=86=E6=9E=B6=E9=99=8D=E7=BA=A7=E8=87=B3?= =?UTF-8?q?=20netstandard2.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将 GFramework.Godot.SourceGenerators 项目的目标框架从 netstandard2.1 更改为 netstandard2.0 - 将 GFramework.SourceGenerators.Abstractions 项目的目标框架从 netstandard2.1 更改为 netstandard2.0 - 将 GFramework.SourceGenerators 项目的目标框架从 netstandard2.1 更改为 netstandard2.0 - 将 GFramework.SourceGenerators.Common 项目的目标框架从 netstandard2.1 更改为 netstandard2.0 - 从 GFramework.SourceGenerators 项目中移除对 GFramework.Core.Abstractions 的引用 - 从 GFramework.SourceGenerators.Abstractions 项目中移除对 GFramework.Core.Abstractions 的引用 - 更新 PriorityGenerator 中的语法检查逻辑,使用 Any 替代 All 进行 partial 关键字检查 - 更新 PriorityAttribute 文档注释中的 cref 格式为 c 标签 --- .../Directory.Build.props | 2 +- .../GFramework.Godot.SourceGenerators.csproj | 2 +- .../Bases/PriorityAttribute.cs | 2 +- GFramework.SourceGenerators.Abstractions/Directory.Build.props | 2 +- .../GFramework.SourceGenerators.Abstractions.csproj | 3 --- GFramework.SourceGenerators.Common/Directory.Build.props | 2 +- GFramework.SourceGenerators/Bases/PriorityGenerator.cs | 2 +- GFramework.SourceGenerators/GFramework.SourceGenerators.csproj | 3 +-- 8 files changed, 7 insertions(+), 11 deletions(-) diff --git a/GFramework.Godot.SourceGenerators.Abstractions/Directory.Build.props b/GFramework.Godot.SourceGenerators.Abstractions/Directory.Build.props index 7417131..82f43af 100644 --- a/GFramework.Godot.SourceGenerators.Abstractions/Directory.Build.props +++ b/GFramework.Godot.SourceGenerators.Abstractions/Directory.Build.props @@ -1,7 +1,7 @@ - netstandard2.1 + netstandard2.0 true true true diff --git a/GFramework.SourceGenerators.Abstractions/Bases/PriorityAttribute.cs b/GFramework.SourceGenerators.Abstractions/Bases/PriorityAttribute.cs index e5bae68..d406bb9 100644 --- a/GFramework.SourceGenerators.Abstractions/Bases/PriorityAttribute.cs +++ b/GFramework.SourceGenerators.Abstractions/Bases/PriorityAttribute.cs @@ -1,7 +1,7 @@ namespace GFramework.SourceGenerators.Abstractions.Bases; /// -/// 标记类的优先级,自动生成 接口实现 +/// 标记类的优先级,自动生成 GFramework.Core.Abstractions.Bases.IPrioritized 接口实现。 /// /// /// 使用此特性可以避免手动实现 IPrioritized 接口。 diff --git a/GFramework.SourceGenerators.Abstractions/Directory.Build.props b/GFramework.SourceGenerators.Abstractions/Directory.Build.props index 7417131..82f43af 100644 --- a/GFramework.SourceGenerators.Abstractions/Directory.Build.props +++ b/GFramework.SourceGenerators.Abstractions/Directory.Build.props @@ -1,7 +1,7 @@ - netstandard2.1 + netstandard2.0 true true - netstandard2.1 + netstandard2.0 true true true @@ -30,7 +30,6 @@ - From 884249649d581bbbccad2dd41c50db5ea600b065 Mon Sep 17 00:00:00 2001 From: GeWuYou <95328647+GeWuYou@users.noreply.github.com> Date: Sat, 21 Mar 2026 21:30:29 +0800 Subject: [PATCH 2/3] =?UTF-8?q?chore(build):=20=E9=85=8D=E7=BD=AE=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E6=9E=84=E5=BB=BA=E5=B1=9E=E6=80=A7=E4=BB=A5=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E6=BA=90=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 为 GFramework.Godot 项目添加 GodotProjectDir 属性默认值 - 在 GFramework 元包中添加 NoPackageAnalysis 属性配置 - 为不同 .NET 版本添加占位符文件到包输出中 - 确保源代码生成器在标准 SDK 构建中正常运行 --- GFramework.Godot/GFramework.Godot.csproj | 3 +++ GFramework.csproj | 5 +++++ packaging/_._ | 1 + 3 files changed, 9 insertions(+) create mode 100644 packaging/_._ diff --git a/GFramework.Godot/GFramework.Godot.csproj b/GFramework.Godot/GFramework.Godot.csproj index 8c0f986..5d79219 100644 --- a/GFramework.Godot/GFramework.Godot.csproj +++ b/GFramework.Godot/GFramework.Godot.csproj @@ -6,6 +6,9 @@ enable net8.0;net9.0;net10.0 true + + $(MSBuildProjectDirectory) diff --git a/GFramework.csproj b/GFramework.csproj index 20f2339..3d65cb3 100644 --- a/GFramework.csproj +++ b/GFramework.csproj @@ -16,11 +16,16 @@ README.md net8.0;net9.0;net10.0 false + + false + + + diff --git a/packaging/_._ b/packaging/_._ new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/packaging/_._ @@ -0,0 +1 @@ + From a42ec0c2829d22658c5339f3e7148d65c6305a75 Mon Sep 17 00:00:00 2001 From: GeWuYou <95328647+GeWuYou@users.noreply.github.com> Date: Sat, 21 Mar 2026 21:31:52 +0800 Subject: [PATCH 3/3] =?UTF-8?q?fix(generator):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E4=BC=98=E5=85=88=E7=BA=A7=E7=94=9F=E6=88=90=E5=99=A8=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E9=83=A8=E5=88=86=E5=85=B3=E9=94=AE=E5=AD=97=E6=A3=80?= =?UTF-8?q?=E6=9F=A5=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将语法节点的部分关键字检查从 Any 操作改为 All 操作 - 修正了对非部分类的诊断报告条件判断 - 确保只有当所有修饰符都不是部分关键字时才报告错误 --- GFramework.SourceGenerators/Bases/PriorityGenerator.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GFramework.SourceGenerators/Bases/PriorityGenerator.cs b/GFramework.SourceGenerators/Bases/PriorityGenerator.cs index 941aa01..6298500 100644 --- a/GFramework.SourceGenerators/Bases/PriorityGenerator.cs +++ b/GFramework.SourceGenerators/Bases/PriorityGenerator.cs @@ -56,7 +56,7 @@ public sealed class PriorityGenerator : MetadataAttributeClassGeneratorBase } // 3. 必须是 partial - if (!syntax.Modifiers.Any(m => m.IsKind(SyntaxKind.PartialKeyword))) + if (syntax.Modifiers.All(m => !m.IsKind(SyntaxKind.PartialKeyword))) { context.ReportDiagnostic(Diagnostic.Create( PriorityDiagnostic.MustBePartial,