Compare commits
No commits in common. "c1d61d8a5cf0c4b246148601cdc963c71dfb255f" and "7eb2e750e91ee9e702b5e8fd72ed32f7f54e998e" have entirely different histories.
c1d61d8a5c
...
7eb2e750e9
6 changed files with 23 additions and 51 deletions
|
|
@ -1,3 +1,4 @@
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Immutable;
|
using System.Collections.Immutable;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
|
||||||
|
|
@ -1,51 +1,24 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netstandard2.0</TargetFramework>
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
<LangVersion>latest</LangVersion>
|
<IsPackable>false</IsPackable>
|
||||||
|
<LangVersion>latest</LangVersion>
|
||||||
|
|
||||||
<!-- Source Generator Tags -->
|
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
|
||||||
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
|
<IsRoslynCompiler>true</IsRoslynCompiler>
|
||||||
<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>
|
|
||||||
|
|
||||||
<!-- Include Package Assets -->
|
<RootNamespace>Godot.Sharp.Extended</RootNamespace>
|
||||||
<ItemGroup>
|
<AssemblyName>Godot.Sharp.Extended</AssemblyName>
|
||||||
<None Include="README.md" Pack="true" PackagePath="\" />
|
<PackageId>Godot.Sharp.Extended</PackageId>
|
||||||
</ItemGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<!-- Ensure package as Source Generator -->
|
<ItemGroup>
|
||||||
<ItemGroup>
|
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0">
|
||||||
<None Include="$(OutputPath)\$(AssemblyName).dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false"/>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
</ItemGroup>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
|
</PackageReference>
|
||||||
<!-- Roslyn Assemblies -->
|
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.14.0" />
|
||||||
<ItemGroup>
|
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.14.0" />
|
||||||
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0">
|
</ItemGroup>
|
||||||
<PrivateAssets>all</PrivateAssets>
|
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
|
||||||
</PackageReference>
|
|
||||||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.14.0"/>
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
#nullable enable
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Immutable;
|
using System.Collections.Immutable;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
#nullable enable
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Immutable;
|
using System.Collections.Immutable;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
@ -30,6 +29,7 @@ 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!.ToString();
|
var nodeProp = attributeData.ConstructorArguments[0].Value as string;
|
||||||
var godotProp = attributeData.ConstructorArguments[1].Value!.ToString();
|
var godotProp = attributeData.ConstructorArguments[1].Value as string;
|
||||||
|
|
||||||
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);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
#nullable enable
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Immutable;
|
using System.Collections.Immutable;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue