Compare commits

..

4 commits

Author SHA1 Message Date
c1d61d8a5c Added Readme file 2025-09-26 17:02:48 -05:00
e7d78ec639 Cleanup 2025-09-26 17:02:42 -05:00
0828883bef Added Nullable flags 2025-09-26 17:02:36 -05:00
f75542e45e Updated CSProj
Updated to properly format based upon source generator specs.
2025-09-26 17:02:19 -05:00
6 changed files with 51 additions and 23 deletions

View file

@ -1,4 +1,3 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.Immutable; using System.Collections.Immutable;
using System.Linq; using System.Linq;

View file

@ -1,24 +1,51 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework> <TargetFramework>netstandard2.0</TargetFramework>
<IsPackable>false</IsPackable> <LangVersion>latest</LangVersion>
<LangVersion>latest</LangVersion>
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules> <!-- Source Generator Tags -->
<IsRoslynCompiler>true</IsRoslynCompiler> <EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
<IsRoslynCompiler>true</IsRoslynCompiler>
<RootNamespace>Godot.Sharp.Extended</RootNamespace>
<AssemblyName>Godot.Sharp.Extended.Generators</AssemblyName>
<!-- Nuget Tags -->
<IsPackable>true</IsPackable>
<PackageId>Godot.Sharp.Extended</PackageId>
<AssemblyTitle>Godot Sharp Extended</AssemblyTitle>
<Version>1.0.0</Version>
<Authors>Mario Steele</Authors>
<Description>Extended Source Generators for Godot Game Engine</Description>
<Copyright>Copyright (c) 2025 Mario Steele</Copyright>
<PackageProjectUrl>https://github.com/eumario/Godot.Sharp.Extended</PackageProjectUrl>
<RepositoryUrl>https://github.com/eumario/Godot.Sharp.Extended</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageTags>godot, generator</PackageTags>
<PackageReleaseNotes>Built for Godot 4.x</PackageReleaseNotes>
</PropertyGroup>
<RootNamespace>Godot.Sharp.Extended</RootNamespace> <!-- Include Package Assets -->
<AssemblyName>Godot.Sharp.Extended</AssemblyName> <ItemGroup>
<PackageId>Godot.Sharp.Extended</PackageId> <None Include="README.md" Pack="true" PackagePath="\" />
</PropertyGroup> </ItemGroup>
<ItemGroup> <!-- Ensure package as Source Generator -->
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0"> <ItemGroup>
<PrivateAssets>all</PrivateAssets> <None Include="$(OutputPath)\$(AssemblyName).dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false"/>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> </ItemGroup>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.14.0" /> <!-- Roslyn Assemblies -->
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.14.0" /> <ItemGroup>
</ItemGroup> <PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.14.0"/>
</ItemGroup>
</Project> </Project>

View file

@ -1,3 +1,4 @@
#nullable enable
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.Immutable; using System.Collections.Immutable;
using System.Linq; using System.Linq;

View file

@ -1,3 +1,4 @@
#nullable enable
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.Immutable; using System.Collections.Immutable;
using System.Linq; using System.Linq;
@ -29,7 +30,6 @@ public class NodePropBindGenerator : IIncrementalGenerator
} }
} }
"""; """;
public void Initialize(IncrementalGeneratorInitializationContext context) public void Initialize(IncrementalGeneratorInitializationContext context)
{ {
context.RegisterPostInitializationOutput(ctx => ctx.AddSource( context.RegisterPostInitializationOutput(ctx => ctx.AddSource(
@ -108,8 +108,8 @@ public class NodePropBindGenerator : IIncrementalGenerator
if (attributeData is null) continue; if (attributeData is null) continue;
var nodeProp = attributeData.ConstructorArguments[0].Value as string; var nodeProp = attributeData.ConstructorArguments[0].Value!.ToString();
var godotProp = attributeData.ConstructorArguments[1].Value as string; var godotProp = attributeData.ConstructorArguments[1].Value!.ToString();
var memberDefinition = new MemberDefinition(fieldSymbol.Type.Name, fieldSymbol.Name, nodeProp, godotProp); var memberDefinition = new MemberDefinition(fieldSymbol.Type.Name, fieldSymbol.Name, nodeProp, godotProp);
classDefinition.MemberDefinitions.Add(memberDefinition); classDefinition.MemberDefinitions.Add(memberDefinition);

0
README.md Normal file
View file

View file

@ -1,3 +1,4 @@
#nullable enable
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.Immutable; using System.Collections.Immutable;
using System.IO; using System.IO;