diff --git a/GFramework.Godot.SourceGenerators.Attributes/GFramework.Godot.SourceGenerators.Attributes.csproj b/GFramework.Godot.SourceGenerators.Abstractions/GFramework.Godot.SourceGenerators.Abstractions.csproj similarity index 78% rename from GFramework.Godot.SourceGenerators.Attributes/GFramework.Godot.SourceGenerators.Attributes.csproj rename to GFramework.Godot.SourceGenerators.Abstractions/GFramework.Godot.SourceGenerators.Abstractions.csproj index 71decee..3d2751f 100644 --- a/GFramework.Godot.SourceGenerators.Attributes/GFramework.Godot.SourceGenerators.Attributes.csproj +++ b/GFramework.Godot.SourceGenerators.Abstractions/GFramework.Godot.SourceGenerators.Abstractions.csproj @@ -5,6 +5,7 @@ GeWuYou.GFramework.Godot.SourceGenerators.Attributes 1.0.0 10 + GFramework.Godot.SourceGenerators.Attributes diff --git a/GFramework.Godot.SourceGenerators.Attributes/logging/GodotLogAttribute.cs b/GFramework.Godot.SourceGenerators.Abstractions/logging/GodotLogAttribute.cs similarity index 92% rename from GFramework.Godot.SourceGenerators.Attributes/logging/GodotLogAttribute.cs rename to GFramework.Godot.SourceGenerators.Abstractions/logging/GodotLogAttribute.cs index 17afa44..a3b2b92 100644 --- a/GFramework.Godot.SourceGenerators.Attributes/logging/GodotLogAttribute.cs +++ b/GFramework.Godot.SourceGenerators.Abstractions/logging/GodotLogAttribute.cs @@ -1,7 +1,5 @@ #nullable enable -using System; - -namespace GFramework.Godot.SourceGenerators.Attributes.logging; +namespace GFramework.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 41bc1f3..db5e1fd 100644 --- a/GFramework.Godot.SourceGenerators/GFramework.Godot.SourceGenerators.csproj +++ b/GFramework.Godot.SourceGenerators/GFramework.Godot.SourceGenerators.csproj @@ -23,8 +23,7 @@ - + @@ -36,5 +35,8 @@ PackagePath="analyzers/dotnet/cs" Visible="false"/> - + + + + diff --git a/GFramework.Godot.SourceGenerators/logging/GodotLoggerGenerator.cs b/GFramework.Godot.SourceGenerators/logging/GodotLoggerGenerator.cs index db47829..06e8cdc 100644 --- a/GFramework.Godot.SourceGenerators/logging/GodotLoggerGenerator.cs +++ b/GFramework.Godot.SourceGenerators/logging/GodotLoggerGenerator.cs @@ -16,7 +16,7 @@ namespace GFramework.Godot.SourceGenerators.logging; public sealed class GodotLoggerGenerator : IIncrementalGenerator { private const string AttributeMetadataName = - "GFramework.Godot.SourceGenerators.Attributes.logging.GodotLogAttribute"; + "GFramework.Godot.SourceGenerators.Abstractions.logging.GodotLogAttribute"; private const string AttributeShortName = "GodotLogAttribute"; private const string AttributeShortNameWithoutSuffix = "GodotLog"; diff --git a/GFramework.SourceGenerators.Attributes/GFramework.SourceGenerators.Attributes.csproj b/GFramework.SourceGenerators.Abstractions/GFramework.SourceGenerators.Abstractions.csproj similarity index 84% rename from GFramework.SourceGenerators.Attributes/GFramework.SourceGenerators.Attributes.csproj rename to GFramework.SourceGenerators.Abstractions/GFramework.SourceGenerators.Abstractions.csproj index 5ec19a5..17d60c6 100644 --- a/GFramework.SourceGenerators.Attributes/GFramework.SourceGenerators.Attributes.csproj +++ b/GFramework.SourceGenerators.Abstractions/GFramework.SourceGenerators.Abstractions.csproj @@ -4,6 +4,7 @@ GeWuYou.GFramework.SourceGenerators.Attributes 1.0.0 10 + GFramework.SourceGenerators.Attributes diff --git a/GFramework.SourceGenerators.Attributes/enums/EnumExtensionsAttribute.cs b/GFramework.SourceGenerators.Abstractions/enums/EnumExtensionsAttribute.cs similarity index 88% rename from GFramework.SourceGenerators.Attributes/enums/EnumExtensionsAttribute.cs rename to GFramework.SourceGenerators.Abstractions/enums/EnumExtensionsAttribute.cs index 1e388ca..3fca257 100644 --- a/GFramework.SourceGenerators.Attributes/enums/EnumExtensionsAttribute.cs +++ b/GFramework.SourceGenerators.Abstractions/enums/EnumExtensionsAttribute.cs @@ -1,6 +1,4 @@ -using System; - -namespace GFramework.SourceGenerators.Attributes.enums; +namespace GFramework.GFramework.SourceGenerators.Abstractions.enums; /// /// 标注在 enum 上,Source Generator 会为该 enum 生成扩展方法。 diff --git a/GFramework.SourceGenerators.Attributes/logging/LogAttribute.cs b/GFramework.SourceGenerators.Abstractions/logging/LogAttribute.cs similarity index 92% rename from GFramework.SourceGenerators.Attributes/logging/LogAttribute.cs rename to GFramework.SourceGenerators.Abstractions/logging/LogAttribute.cs index a38f0d3..6256089 100644 --- a/GFramework.SourceGenerators.Attributes/logging/LogAttribute.cs +++ b/GFramework.SourceGenerators.Abstractions/logging/LogAttribute.cs @@ -1,7 +1,5 @@ #nullable enable -using System; - -namespace GFramework.SourceGenerators.Attributes.logging; +namespace GFramework.GFramework.SourceGenerators.Abstractions.logging; /// /// 标注在类上,Source Generator 会为该类自动生成一个日志记录器字段。 diff --git a/GFramework.SourceGenerators.Attributes/rule/ContextAwareAttribute.cs b/GFramework.SourceGenerators.Abstractions/rule/ContextAwareAttribute.cs similarity index 72% rename from GFramework.SourceGenerators.Attributes/rule/ContextAwareAttribute.cs rename to GFramework.SourceGenerators.Abstractions/rule/ContextAwareAttribute.cs index d1060d0..433c16f 100644 --- a/GFramework.SourceGenerators.Attributes/rule/ContextAwareAttribute.cs +++ b/GFramework.SourceGenerators.Abstractions/rule/ContextAwareAttribute.cs @@ -1,6 +1,4 @@ -using System; - -namespace GFramework.SourceGenerators.Attributes.rule; +namespace GFramework.GFramework.SourceGenerators.Abstractions.rule; /// /// 标记该类需要自动实现 IContextAware diff --git a/GFramework.SourceGenerators.Tests/rule/ContextAwareGeneratorTests.cs b/GFramework.SourceGenerators.Tests/rule/ContextAwareGeneratorTests.cs index bb5d942..dd23b7e 100644 --- a/GFramework.SourceGenerators.Tests/rule/ContextAwareGeneratorTests.cs +++ b/GFramework.SourceGenerators.Tests/rule/ContextAwareGeneratorTests.cs @@ -22,7 +22,7 @@ public class ContextAwareGeneratorTests const string source = """ using System; - namespace GFramework.SourceGenerators.Attributes.rule + namespace GFramework.SourceGenerators.Abstractions.rule { [AttributeUsage(AttributeTargets.Class)] public sealed class ContextAwareAttribute : Attribute @@ -32,7 +32,7 @@ public class ContextAwareGeneratorTests namespace TestApp { - using GFramework.SourceGenerators.Attributes.rule; + using GFramework.SourceGenerators.Abstractions.rule; [ContextAware] public partial class MyRule: GFramework.Core.rule.IContextAware @@ -89,7 +89,7 @@ public class ContextAwareGeneratorTests const string source = """ using System; - namespace GFramework.SourceGenerators.Attributes.rule + namespace GFramework.SourceGenerators.Abstractions.rule { [AttributeUsage(AttributeTargets.Class)] public sealed class ContextAwareAttribute : Attribute @@ -99,7 +99,7 @@ public class ContextAwareGeneratorTests namespace TestApp { - using GFramework.SourceGenerators.Attributes.rule; + using GFramework.SourceGenerators.Abstractions.rule; using GFramework.Core.rule; // 间接接口:继承自 IContextAware diff --git a/GFramework.SourceGenerators/GFramework.SourceGenerators.csproj b/GFramework.SourceGenerators/GFramework.SourceGenerators.csproj index 37b5ec8..eee4406 100644 --- a/GFramework.SourceGenerators/GFramework.SourceGenerators.csproj +++ b/GFramework.SourceGenerators/GFramework.SourceGenerators.csproj @@ -24,8 +24,7 @@ - + @@ -37,5 +36,8 @@ PackagePath="analyzers/dotnet/cs" Visible="false"/> - + + + + diff --git a/GFramework.SourceGenerators/enums/EnumExtensionsGenerator.cs b/GFramework.SourceGenerators/enums/EnumExtensionsGenerator.cs index 9e31593..9d9b36f 100644 --- a/GFramework.SourceGenerators/enums/EnumExtensionsGenerator.cs +++ b/GFramework.SourceGenerators/enums/EnumExtensionsGenerator.cs @@ -11,7 +11,7 @@ namespace GFramework.SourceGenerators.enums; public class EnumExtensionsGenerator : IIncrementalGenerator { private const string AttributeFullName = - "GFramework.SourceGenerators.Attributes.generator.enums.GenerateEnumExtensionsAttribute"; + "GFramework.SourceGenerators.Abstractions.generator.enums.GenerateEnumExtensionsAttribute"; public void Initialize(IncrementalGeneratorInitializationContext context) { diff --git a/GFramework.SourceGenerators/logging/LoggerGenerator.cs b/GFramework.SourceGenerators/logging/LoggerGenerator.cs index b298ce5..5d931c0 100644 --- a/GFramework.SourceGenerators/logging/LoggerGenerator.cs +++ b/GFramework.SourceGenerators/logging/LoggerGenerator.cs @@ -18,7 +18,7 @@ namespace GFramework.SourceGenerators.logging; [Generator] public sealed class LoggerGenerator : IIncrementalGenerator { - private const string AttributeMetadataName = "GFramework.SourceGenerators.Attributes.logging.LogAttribute"; + private const string AttributeMetadataName = "GFramework.SourceGenerators.Abstractions.logging.LogAttribute"; private const string AttributeShortName = "LogAttribute"; private const string AttributeShortNameWithoutSuffix = "Log"; diff --git a/GFramework.SourceGenerators/rule/ContextAwareGenerator.cs b/GFramework.SourceGenerators/rule/ContextAwareGenerator.cs index 0124541..56655ad 100644 --- a/GFramework.SourceGenerators/rule/ContextAwareGenerator.cs +++ b/GFramework.SourceGenerators/rule/ContextAwareGenerator.cs @@ -11,7 +11,7 @@ namespace GFramework.SourceGenerators.rule; public sealed class ContextAwareGenerator : IIncrementalGenerator { private const string AttributeMetadataName = - "GFramework.SourceGenerators.Attributes.rule.ContextAwareAttribute"; + "GFramework.SourceGenerators.Abstractions.rule.ContextAwareAttribute"; public void Initialize(IncrementalGeneratorInitializationContext context) { diff --git a/GFramework.sln b/GFramework.sln index f1efe57..ca953de 100644 --- a/GFramework.sln +++ b/GFramework.sln @@ -4,7 +4,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GFramework ", "GFramework.c EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GFramework.SourceGenerators", "GFramework.SourceGenerators\GFramework.SourceGenerators.csproj", "{E9D51809-0351-4B83-B85B-B5F469AAB3B8}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GFramework.SourceGenerators.Attributes", "GFramework.SourceGenerators.Attributes\GFramework.SourceGenerators.Attributes.csproj", "{84C5C3C9-5620-4924-BA04-92F813F2B70F}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GFramework.SourceGenerators.Abstractions", "GFramework.SourceGenerators.Abstractions\GFramework.SourceGenerators.Abstractions.csproj", "{84C5C3C9-5620-4924-BA04-92F813F2B70F}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GFramework.Core", "GFramework.Core\GFramework.Core.csproj", "{A6D5854D-79EA-487A-9ED9-396E6A1F8031}" EndProject @@ -14,7 +14,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GFramework.Game", "GFramewo EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GFramework.Godot.SourceGenerators", "GFramework.Godot.SourceGenerators\GFramework.Godot.SourceGenerators.csproj", "{C56FD287-CBC6-4C44-B3DF-103FA3660CA0}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GFramework.Godot.SourceGenerators.Attributes", "GFramework.Godot.SourceGenerators.Attributes\GFramework.Godot.SourceGenerators.Attributes.csproj", "{3A1132B7-EC3B-4BB6-A752-8ADC92BC08A0}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GFramework.Godot.SourceGenerators.Abstractions", "GFramework.Godot.SourceGenerators.Abstractions\GFramework.Godot.SourceGenerators.Abstractions.csproj", "{3A1132B7-EC3B-4BB6-A752-8ADC92BC08A0}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GFramework.SourceGenerators.Common", "GFramework.SourceGenerators.Common\GFramework.SourceGenerators.Common.csproj", "{3DB57A3A-ACCF-47BE-A17B-2ADD68B6C8AA}" EndProject