diff --git a/ActionGenerator.cs b/Generators/ActionGenerator.cs similarity index 92% rename from ActionGenerator.cs rename to Generators/ActionGenerator.cs index 664fe64..a1334b6 100644 --- a/ActionGenerator.cs +++ b/Generators/ActionGenerator.cs @@ -39,14 +39,14 @@ public class ActionGenerator : IIncrementalGenerator using System; using Godot; - namespace Godot.Sharp.Extended; + namespace Godot.Sharp.Extended.Generators; public partial class Actions { {{memberCode}} } """; - ctx.AddSource("Godot.Sharp.Extended.Actions.g.cs", SourceText.From(code, Encoding.UTF8)); + ctx.AddSource("Godot.Sharp.Extended.Generators.Actions.g.cs", SourceText.From(code, Encoding.UTF8)); } public List GetActions(string content) diff --git a/Godot.Sharp.Extended.csproj b/Generators/Godot.Sharp.Extended.Generators.csproj similarity index 94% rename from Godot.Sharp.Extended.csproj rename to Generators/Godot.Sharp.Extended.Generators.csproj index c91bb9d..76a778e 100644 --- a/Godot.Sharp.Extended.csproj +++ b/Generators/Godot.Sharp.Extended.Generators.csproj @@ -14,7 +14,7 @@ true - Godot.Sharp.Extended + Godot.Sharp.Extended.Generators Godot Sharp Extended 1.0.0 Mario Steele @@ -47,5 +47,8 @@ + + + diff --git a/NodeBindGenerator.cs b/Generators/NodeBindGenerator.cs similarity index 96% rename from NodeBindGenerator.cs rename to Generators/NodeBindGenerator.cs index bbc7bf9..89a7c58 100644 --- a/NodeBindGenerator.cs +++ b/Generators/NodeBindGenerator.cs @@ -14,7 +14,7 @@ public class NodeBindGenerator : IIncrementalGenerator { private const string AttributeSourceCode = """ // - namespace Godot.Sharp.Extended; + namespace Godot.Sharp.Extended.Generators; [System.AttributeUsage(System.AttributeTargets.Property | System.AttributeTargets.Field)] public class NodeBindAttribute : Attribute @@ -60,7 +60,7 @@ public class NodeBindGenerator : IIncrementalGenerator continue; var attributeName = symbol.ContainingType.ToDisplayString(); - if (attributeName == $"Godot.Sharp.Extended.NodeBind") + if (attributeName == $"Godot.Sharp.Extended.Generators.NodeBind") return declarationSyntax; } @@ -150,7 +150,7 @@ public class NodeBindGenerator : IIncrementalGenerator } } """; - ctx.AddSource($"Godot.Sharp.Extended.{definition.ClassName}.NodeBind.g.cs", SourceText.From(code, Encoding.UTF8)); + ctx.AddSource($"Godot.Sharp.Extended.Generators.{definition.ClassName}.NodeBind.g.cs", SourceText.From(code, Encoding.UTF8)); } private class ClassDefinition diff --git a/NodePropBindGenerator.cs b/Generators/NodePropBindGenerator.cs similarity index 96% rename from NodePropBindGenerator.cs rename to Generators/NodePropBindGenerator.cs index 86f0f29..681f9cb 100644 --- a/NodePropBindGenerator.cs +++ b/Generators/NodePropBindGenerator.cs @@ -15,7 +15,7 @@ public class NodePropBindGenerator : IIncrementalGenerator { private const string AttributeSourceCode = """ // - namespace Godot.Sharp.Extended; + namespace Godot.Sharp.Extended.Generators; [System.AttributeUsage(System.AttributeTargets.Member)] public class NodePropBindAttribute : System.Attribute @@ -69,7 +69,7 @@ public class NodePropBindGenerator : IIncrementalGenerator continue; var attributeName = symbol.ContainingType.ToDisplayString(); - if (attributeName == "Godot.Sharp.Extended.NodePropBind") + if (attributeName == "Godot.Sharp.Extended.Generators.NodePropBind") return declarationSyntax; } @@ -104,7 +104,7 @@ public class NodePropBindGenerator : IIncrementalGenerator if (semanticModel.GetDeclaredSymbol(variable) is not IFieldSymbol fieldSymbol) continue; var attributeData = fieldSymbol.GetAttributes() - .FirstOrDefault(ad => ad.AttributeClass?.ToDisplayString() == "Godot.Sharp.Extended.NodePropBindAttribute"); + .FirstOrDefault(ad => ad.AttributeClass?.ToDisplayString() == "Godot.Sharp.Extended.Generators.NodePropBindAttribute"); if (attributeData is null) continue; @@ -159,7 +159,7 @@ public class NodePropBindGenerator : IIncrementalGenerator {{propCode}} } """; - context.AddSource($"Godot.Sharp.Extended.{definition.ClassName}.NodeBind.g.cs", SourceText.From(code, Encoding.UTF8)); + context.AddSource($"Godot.Sharp.Extended.Generators.{definition.ClassName}.NodeBind.g.cs", SourceText.From(code, Encoding.UTF8)); } private class ClassDefinition(string theNamespace, string className, HashSet usingNamespaceName, List memberDefinitions) diff --git a/ResourceGenerator.cs b/Generators/ResourceGenerator.cs similarity index 97% rename from ResourceGenerator.cs rename to Generators/ResourceGenerator.cs index e6f1100..1a458f1 100644 --- a/ResourceGenerator.cs +++ b/Generators/ResourceGenerator.cs @@ -16,7 +16,7 @@ public class ResourceGenerator : IIncrementalGenerator { private const string AttributeSourceCode = """ // - namespace Godot.Sharp.Extended; + namespace Godot.Sharp.Extended.Generators; [System.AttributeUsage(System.AttributeTargets.Property | System.AttributeTargets.Field)] public class ResourcePathAttribute : System.Attribute @@ -82,7 +82,7 @@ public class ResourceGenerator : IIncrementalGenerator { var symbolInfo = ctx.SemanticModel.GetSymbolInfo(attributeSyntax); if (symbolInfo.Symbol is not IMethodSymbol attributeSymbol) continue; - if (attributeSymbol.ContainingType.ToDisplayString() != "Godot.Sharp.Extended.ResourcePath") continue; + if (attributeSymbol.ContainingType.ToDisplayString() != "Godot.Sharp.Extended.Generators.ResourcePath") continue; var parameter = attributeSyntax.ArgumentList; var pathArgument = parameter?.Arguments[0]; @@ -200,7 +200,7 @@ public class ResourceGenerator : IIncrementalGenerator {{allMethod}} } """; - context.AddSource($"Godot.Sharp.Extended.{classDefinition.ClassName}.Res.g.cs", SourceText.From(code, Encoding.UTF8)); + context.AddSource($"Godot.Sharp.Extended.Generators.{classDefinition.ClassName}.Res.g.cs", SourceText.From(code, Encoding.UTF8)); } } diff --git a/SceneGenerator.cs b/Generators/SceneGenerator.cs similarity index 92% rename from SceneGenerator.cs rename to Generators/SceneGenerator.cs index b3ad16d..5e1573e 100644 --- a/SceneGenerator.cs +++ b/Generators/SceneGenerator.cs @@ -49,7 +49,7 @@ public class SceneGenerator : IIncrementalGenerator using System; using Godot; - namespace Godot.Sharp.Extended; + namespace Godot.Sharp.Extended.Generators; public class Scenes { @@ -57,7 +57,7 @@ public class SceneGenerator : IIncrementalGenerator } """; - context.AddSource("Godot.Sharp.Extended.Scenes.g.cs", SourceText.From(code, Encoding.UTF8)); + context.AddSource("Godot.Sharp.Extended.Generators.Scenes.g.cs", SourceText.From(code, Encoding.UTF8)); } } diff --git a/StringExtensionMethods.cs b/Generators/StringExtensionMethods.cs similarity index 100% rename from StringExtensionMethods.cs rename to Generators/StringExtensionMethods.cs