diff --git a/.gitignore b/.gitignore index add57be..ba56cfd 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ bin/ obj/ /packages/ riderModule.iml -/_ReSharper.Caches/ \ No newline at end of file +/_ReSharper.Caches/ +GFramework.sln.DotSettings.user \ No newline at end of file diff --git a/GFramework.Core/architecture/IArchitectureExtensible.cs b/GFramework.Core/architecture/IArchitectureExtensible.cs deleted file mode 100644 index 1fd93a7..0000000 --- a/GFramework.Core/architecture/IArchitectureExtensible.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace GFramework.Core.architecture; - -/// -/// 可扩展架构接口,继承自IArchitecture接口,提供模块安装和生命周期钩子注册功能 -/// -public interface IArchitectureExtensible : IArchitecture -{ - /// - /// 安装架构模块 - /// - /// 要安装的架构模块实例 - void InstallModule(IArchitectureModule module); - - /// - /// 注册架构生命周期钩子 - /// - /// 要注册的架构生命周期钩子实例 - void RegisterLifecycleHook(IArchitectureLifecycle hook); -} \ No newline at end of file diff --git a/GFramework.Godot.SourceGenerators.Abstractions/Directory.Build.props b/GFramework.Godot.SourceGenerators.Abstractions/Directory.Build.props new file mode 100644 index 0000000..3a9b545 --- /dev/null +++ b/GFramework.Godot.SourceGenerators.Abstractions/Directory.Build.props @@ -0,0 +1,26 @@ + + + + netstandard2.0 + true + true + + preview + + + + + + all + runtime; build; native; contentfiles; analyzers + + + all + runtime; build; native; contentfiles; analyzers + + + diff --git a/GFramework.Godot.SourceGenerators.Abstractions/GFramework.Godot.SourceGenerators.Abstractions.csproj b/GFramework.Godot.SourceGenerators.Abstractions/GFramework.Godot.SourceGenerators.Abstractions.csproj index 3d2751f..3e7de14 100644 --- a/GFramework.Godot.SourceGenerators.Abstractions/GFramework.Godot.SourceGenerators.Abstractions.csproj +++ b/GFramework.Godot.SourceGenerators.Abstractions/GFramework.Godot.SourceGenerators.Abstractions.csproj @@ -1,11 +1,17 @@  + - netstandard2.0 - GeWuYou.GFramework.Godot.SourceGenerators.Attributes - 1.0.0 - 10 - GFramework.Godot.SourceGenerators.Attributes + false + true + T:System.Diagnostics.CodeAnalysis.NotNullWhenAttribute + + + + diff --git a/GFramework.Godot.SourceGenerators.Abstractions/logging/GodotLogAttribute.cs b/GFramework.Godot.SourceGenerators.Abstractions/logging/GodotLogAttribute.cs index a3b2b92..2de1603 100644 --- a/GFramework.Godot.SourceGenerators.Abstractions/logging/GodotLogAttribute.cs +++ b/GFramework.Godot.SourceGenerators.Abstractions/logging/GodotLogAttribute.cs @@ -1,5 +1,6 @@ -#nullable enable -namespace GFramework.GFramework.Godot.SourceGenerators.Abstractions.logging; +using System; + +namespace GFramework.Godot.SourceGenerators.Abstractions.logging; /// /// Godot日志特性,用于在类上标记以自动生成日志字段 diff --git a/GFramework.Godot.SourceGenerators/GFramework.Godot.SourceGenerators.csproj b/GFramework.Godot.SourceGenerators/GFramework.Godot.SourceGenerators.csproj index db5e1fd..f5268a0 100644 --- a/GFramework.Godot.SourceGenerators/GFramework.Godot.SourceGenerators.csproj +++ b/GFramework.Godot.SourceGenerators/GFramework.Godot.SourceGenerators.csproj @@ -4,39 +4,58 @@ GeWuYou.GFramework.Godot.SourceGenerators netstandard2.0 - + true false latest + enable true Generated - + - + + all + runtime; build; native; contentfiles; analyzers + - + - - + + - + - + + + + + + + + + + diff --git a/GFramework.SourceGenerators.Abstractions/Directory.Build.props b/GFramework.SourceGenerators.Abstractions/Directory.Build.props new file mode 100644 index 0000000..82f43af --- /dev/null +++ b/GFramework.SourceGenerators.Abstractions/Directory.Build.props @@ -0,0 +1,24 @@ + + + + netstandard2.0 + true + true + + preview + + + + all + runtime; build; native; contentfiles; analyzers + + + all + runtime; build; native; contentfiles; analyzers + + + diff --git a/GFramework.SourceGenerators.Abstractions/GFramework.SourceGenerators.Abstractions.csproj b/GFramework.SourceGenerators.Abstractions/GFramework.SourceGenerators.Abstractions.csproj index 17d60c6..f7470af 100644 --- a/GFramework.SourceGenerators.Abstractions/GFramework.SourceGenerators.Abstractions.csproj +++ b/GFramework.SourceGenerators.Abstractions/GFramework.SourceGenerators.Abstractions.csproj @@ -1,12 +1,17 @@  + + - netstandard2.0 - GeWuYou.GFramework.SourceGenerators.Attributes - 1.0.0 - 10 - GFramework.SourceGenerators.Attributes + false + true + T:System.Diagnostics.CodeAnalysis.NotNullWhenAttribute + + - + diff --git a/GFramework.SourceGenerators.Abstractions/enums/EnumExtensionsAttribute.cs b/GFramework.SourceGenerators.Abstractions/enums/EnumExtensionsAttribute.cs index 3fca257..8c7a47f 100644 --- a/GFramework.SourceGenerators.Abstractions/enums/EnumExtensionsAttribute.cs +++ b/GFramework.SourceGenerators.Abstractions/enums/EnumExtensionsAttribute.cs @@ -1,4 +1,6 @@ -namespace GFramework.GFramework.SourceGenerators.Abstractions.enums; +using System; + +namespace GFramework.SourceGenerators.Abstractions.enums; /// /// 标注在 enum 上,Source Generator 会为该 enum 生成扩展方法。 diff --git a/GFramework.SourceGenerators.Abstractions/logging/LogAttribute.cs b/GFramework.SourceGenerators.Abstractions/logging/LogAttribute.cs index 6256089..52e7325 100644 --- a/GFramework.SourceGenerators.Abstractions/logging/LogAttribute.cs +++ b/GFramework.SourceGenerators.Abstractions/logging/LogAttribute.cs @@ -1,5 +1,7 @@ #nullable enable -namespace GFramework.GFramework.SourceGenerators.Abstractions.logging; +using System; + +namespace GFramework.SourceGenerators.Abstractions.logging; /// /// 标注在类上,Source Generator 会为该类自动生成一个日志记录器字段。 @@ -7,6 +9,9 @@ namespace GFramework.GFramework.SourceGenerators.Abstractions.logging; [AttributeUsage(AttributeTargets.Class, Inherited = false)] public sealed class LogAttribute : Attribute { + /// + /// 初始化 LogAttribute 类的新实例 + /// public LogAttribute() { } @@ -20,6 +25,7 @@ public sealed class LogAttribute : Attribute Name = name; } + /// 日志分类名(默认使用类名) public string? Name { get; set; } diff --git a/GFramework.SourceGenerators.Abstractions/rule/ContextAwareAttribute.cs b/GFramework.SourceGenerators.Abstractions/rule/ContextAwareAttribute.cs index 433c16f..d1060d0 100644 --- a/GFramework.SourceGenerators.Abstractions/rule/ContextAwareAttribute.cs +++ b/GFramework.SourceGenerators.Abstractions/rule/ContextAwareAttribute.cs @@ -1,4 +1,6 @@ -namespace GFramework.GFramework.SourceGenerators.Abstractions.rule; +using System; + +namespace GFramework.SourceGenerators.Attributes.rule; /// /// 标记该类需要自动实现 IContextAware diff --git a/GFramework.SourceGenerators.Common/Directory.Build.props b/GFramework.SourceGenerators.Common/Directory.Build.props new file mode 100644 index 0000000..016f796 --- /dev/null +++ b/GFramework.SourceGenerators.Common/Directory.Build.props @@ -0,0 +1,23 @@ + + + netstandard2.0 + true + true + + preview + + + + all + runtime; build; native; contentfiles; analyzers + + + all + runtime; build; native; contentfiles; analyzers + + + diff --git a/GFramework.SourceGenerators.Common/GFramework.SourceGenerators.Common.csproj b/GFramework.SourceGenerators.Common/GFramework.SourceGenerators.Common.csproj index 20d6f77..a1c3b5b 100644 --- a/GFramework.SourceGenerators.Common/GFramework.SourceGenerators.Common.csproj +++ b/GFramework.SourceGenerators.Common/GFramework.SourceGenerators.Common.csproj @@ -1,8 +1,9 @@  - netstandard2.0 - 10 + false + true + T:System.Diagnostics.CodeAnalysis.NotNullWhenAttribute diff --git a/GFramework.SourceGenerators.Tests/GFramework.SourceGenerators.Tests.csproj b/GFramework.SourceGenerators.Tests/GFramework.SourceGenerators.Tests.csproj index ec7d901..911926f 100644 --- a/GFramework.SourceGenerators.Tests/GFramework.SourceGenerators.Tests.csproj +++ b/GFramework.SourceGenerators.Tests/GFramework.SourceGenerators.Tests.csproj @@ -10,7 +10,6 @@ - diff --git a/GFramework.SourceGenerators/GFramework.SourceGenerators.csproj b/GFramework.SourceGenerators/GFramework.SourceGenerators.csproj index eee4406..2f35e22 100644 --- a/GFramework.SourceGenerators/GFramework.SourceGenerators.csproj +++ b/GFramework.SourceGenerators/GFramework.SourceGenerators.csproj @@ -19,25 +19,43 @@ - + + all + runtime; build; native; contentfiles; analyzers + - + - + + + + + + + + + + diff --git a/GFramework.SourceGenerators/logging/LoggerGenerator.cs b/GFramework.SourceGenerators/logging/LoggerGenerator.cs index 5d931c0..a6d0ba1 100644 --- a/GFramework.SourceGenerators/logging/LoggerGenerator.cs +++ b/GFramework.SourceGenerators/logging/LoggerGenerator.cs @@ -1,7 +1,4 @@ -#nullable enable - - -using System; +using System; using System.Linq; using System.Text; using GFramework.SourceGenerators.Common.diagnostics; diff --git a/GFramework.csproj b/GFramework.csproj index 2ea6e5e..bbdeb31 100644 --- a/GFramework.csproj +++ b/GFramework.csproj @@ -24,9 +24,6 @@ - - GFramework.SorceGenerators\bin\Debug\netstandard2.0\GFramework.Generator.Attributes.dll - GFramework.SorceGenerators\logging\README.md @@ -40,12 +37,12 @@ GFramework.SorceGenerators\AnalyzerReleases.Unshipped.md - - + + @@ -66,24 +63,24 @@ GFramework.SorceGenerators\logging\LoggerGenerator.cs - - + + - - + + diff --git a/GFramework.sln.DotSettings.user b/GFramework.sln.DotSettings.user deleted file mode 100644 index 444ecc6..0000000 --- a/GFramework.sln.DotSettings.user +++ /dev/null @@ -1,17 +0,0 @@ - - ForceIncluded - ForceIncluded - ForceIncluded - ForceIncluded - ForceIncluded - ForceIncluded - <SessionState ContinuousTestingMode="0" IsActive="True" Name="Generates_ContextAware_Code" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"> - <TestAncestor> - <TestId>NUnit3x::BB047F43-6AA0-4EA0-8AE9-E6B9784D9E8E::net8.0::GFramework.SourceGenerators.Tests.rule.ContextAwareGeneratorTests</TestId> - </TestAncestor> -</SessionState> - <SessionState ContinuousTestingMode="0" Name="Generates_ContextAware_Code" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"> - <TestAncestor> - <TestId>NUnit3x::BB047F43-6AA0-4EA0-8AE9-E6B9784D9E8E::net8.0::GFramework.SourceGenerators.Tests.rule.ContextAwareGeneratorTests</TestId> - </TestAncestor> -</SessionState> \ No newline at end of file