Skip to content

Commit 89b65fb

Browse files
committed
Pre-release and documentation updates
1 parent a78723b commit 89b65fb

7 files changed

Lines changed: 79 additions & 71 deletions

File tree

CustomGeneratorTests/CustomGeneratorTests.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
<PropertyGroup>
33
<LangVersion>preview</LangVersion>
44
<TargetFramework>netstandard2.0</TargetFramework>
5+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
56
<PreserveCompilationContext>true</PreserveCompilationContext>
67
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
78
</PropertyGroup>
89
<ItemGroup>
9-
<PackageReference Include="GodotSharp.SourceGenerators" Version="2.4.0-240625-1312.Release" PrivateAssets="all" />
10+
<PackageReference Include="GodotSharp.SourceGenerators" Version="2.4.0-240626-1054.Release" />
1011
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.8.0" PrivateAssets="all" />
1112
</ItemGroup>
1213
</Project>

Godot 3 Tests/Godot 3 Tests.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22
<PropertyGroup>
33
<LangVersion>preview</LangVersion>
44
<TargetFramework>netstandard2.1</TargetFramework>
5+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
56
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
67
</PropertyGroup>
78
<ItemGroup>
89
<None Include="**\*.tscn" />
910
</ItemGroup>
1011
<ItemGroup>
1112
<PackageReference Include="FluentAssertions" Version="6.12.0" />
12-
<PackageReference Include="GodotSharp.SourceGenerators" Version="2.4.0-240625-1312.Release" />
13+
<PackageReference Include="GodotSharp.SourceGenerators" Version="2.4.0-240626-1054.Release" />
1314
</ItemGroup>
1415
<ItemGroup>
1516
<ProjectReference Include="..\CustomGeneratorTests\CustomGeneratorTests.csproj" OutputItemType="analyzer" />

Godot 4 Tests/Godot 4 Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</ItemGroup>
1313
<ItemGroup>
1414
<PackageReference Include="FluentAssertions" Version="6.12.0" />
15-
<PackageReference Include="GodotSharp.SourceGenerators" Version="2.4.0-240625-1312.Release" />
15+
<PackageReference Include="GodotSharp.SourceGenerators" Version="2.4.0-240626-1054.Release" />
1616
</ItemGroup>
1717
<ItemGroup>
1818
<ProjectReference Include="..\CustomGeneratorTests\CustomGeneratorTests.csproj" OutputItemType="analyzer" />

NRT.Tests/GD3.NRT/GD3.NRT.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
</ItemGroup>
1111
<ItemGroup>
1212
<PackageReference Include="FluentAssertions" Version="6.12.0" />
13-
<PackageReference Include="GodotSharp.SourceGenerators" Version="2.4.0-240625-1312.Release" />
13+
<PackageReference Include="GodotSharp.SourceGenerators" Version="2.4.0-240626-1054.Release" />
1414
</ItemGroup>
1515
</Project>

NRT.Tests/GD4.NRT/GD4.NRT.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
</ItemGroup>
1111
<ItemGroup>
1212
<PackageReference Include="FluentAssertions" Version="6.12.0" />
13-
<PackageReference Include="GodotSharp.SourceGenerators" Version="2.4.0-240625-1312.Release" />
13+
<PackageReference Include="GodotSharp.SourceGenerators" Version="2.4.0-240626-1054.Release" />
1414
</ItemGroup>
1515
</Project>

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ Generates:
113113
* Generates public events Value1Changed & Value1Changing and a private class to manage field and event delivery
114114
* (Automagically triggers nested changes for Resource and Resource[])
115115
* Events are triggered only if value is different
116+
* [NEW] Initial value can be set without triggering update (useful when using a non-nullable reference type)
116117
```cs
117118
public partial class NotifyTest : Node
118119
{
@@ -125,8 +126,8 @@ public partial class NotifyTest : Node
125126

126127
public override void _Ready()
127128
{
128-
Value1Changing += () => GD.Print("Value1Changing raised before changing the value");
129-
Value1Changed += () => GD.Print("Value1Changed raised after changing the value");
129+
Value1Changing += () => GD.Print("Value1Changing raised before value is changed");
130+
Value1Changed += () => GD.Print("Value1Changed raised after value is changed");
130131

131132
// You can also subscribe to private events if needed
132133
// _value1.Changing += OnValue1Changing;
@@ -137,6 +138,9 @@ public partial class NotifyTest : Node
137138
Value1 = 2; // Raise Value1Changing and Value1Changed
138139
Value1 = 2; // No event is raised since value is the same
139140
}
141+
142+
public NotifyTest()
143+
=> InitValue1(7); // [NEW] Set initial value without triggering events (optional)
140144
}
141145
```
142146
### `InputMap`

SourceGenerators/SourceGenerators.csproj

Lines changed: 66 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -5,91 +5,93 @@
55
<LangVersion>preview</LangVersion>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<TargetFramework>netstandard2.0</TargetFramework>
8+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
89
<AssemblyName>GodotSharp.SourceGenerators</AssemblyName>
910
<RootNamespace>GodotSharp.SourceGenerators</RootNamespace>
1011
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
1112
</PropertyGroup>
1213

1314
<!-- Package Settings -->
1415
<PropertyGroup>
15-
<Authors>Cat-Lips</Authors>
1616
<Description>
17-
C# Source Generators for use with the Godot Game Engine (supports Godot 4 and .NET 8!)
17+
C# Source Generators for use with the Godot Game Engine
1818

19-
* `SceneTree` class attribute:
20-
-- Generates class property for uniquely named nodes
21-
-- Provides strongly typed access to the scene hierarchy (via `_` operator)
22-
* `GodotOverride` method attribute:
23-
-- Allows use of On*, instead of virtual _* overrides
24-
-- (Requires partial method declaration for use with Godot 4.0)
25-
* `Notify` property attribute:
26-
-- Generates boiler plate code, triggering only when values differ
27-
-- (Automagically triggers nested changes for Resource and Resource[])
28-
* `InputMap` class attribute:
29-
-- Provides strongly typed access to input actions defined in project.godot
30-
* `LayerNames` class attribute:
31-
-- Provide strongly typed access to layer names defined in godot.project
32-
* `CodeComments` class attribute:
33-
-- Provides a nested static class to access property comments from code (useful for in-game tooltips, etc)
34-
* `OnInstantiate` method attribute:
35-
-- Generates a static Instantiate method with matching args that calls attributed method as part of the instantiation process
36-
-- (Also generates a protected constructor to ensure proper initialisation - can be deactivated via attribute)
37-
* `OnImport` method attribute (GD4 only):
38-
-- Generates default plugin overrides and options to make plugin class cleaner (inherit from OnImportEditorPlugin)
19+
* `SceneTree` class attribute:
20+
-- Generates class property for uniquely named nodes
21+
-- Provides strongly typed access to the scene hierarchy (via `_` operator)
22+
* `GodotOverride` method attribute:
23+
-- Allows use of On*, instead of virtual _* overrides
24+
-- (Requires partial method declaration for use with Godot 4.0)
25+
* `Notify` property attribute:
26+
-- Generates boiler plate code, triggering only when values differ
27+
-- (Automagically triggers nested changes for Resource and Resource[])
28+
* `InputMap` class attribute:
29+
-- Provides strongly typed access to input actions defined in project.godot
30+
* `LayerNames` class attribute:
31+
-- Provide strongly typed access to layer names defined in godot.project
32+
* `CodeComments` class attribute:
33+
-- Provides a nested static class to access property comments from code (useful for in-game tooltips, etc)
34+
* `OnInstantiate` method attribute:
35+
-- Generates a static Instantiate method with matching args that calls attributed method as part of the instantiation process
36+
-- (Also generates a protected constructor to ensure proper initialisation - can be deactivated or overridden via attribute)
37+
* `OnImport` method attribute (GD4 only):
38+
-- Generates default plugin overrides and options to make plugin class cleaner (inherit from OnImportEditorPlugin)
3939

40-
* Includes base classes/helpers to create project specific source generators
41-
</Description>
40+
* Includes base classes/helpers to create project specific source generators
41+
</Description>
4242
<PackageReleaseNotes>
43-
v.2.4.0
44-
- ADDED: Added LayerNames attribute
43+
v.2.4.0 (preview)
44+
- ADDED: LayerNames attribute
45+
- ADDED: [NEW] Support for Nullable Reference Types (for `Notify` and `OnInstantiate`)
4546

46-
v.2.3.4
47-
- ADDED: Support for .NET 8.0
48-
- ADDED: Nested InputMap entries
49-
- ADDED: OnImport attribute for editor only builds (GD4 only)
47+
v.2.3.4
48+
- ADDED: Support for .NET 8.0
49+
- ADDED: Nested InputMap entries
50+
- ADDED: OnImport attribute for editor only builds (GD4 only)
5051

51-
v.2.1.0
52-
- ADDED: CodeComments attribute
53-
- ADDED: OnInstantiate attribute (with protected constructor)
54-
- ADDED: Inline changed action on Notify setter
55-
- ADDED: Implicit operators as an alternative to calling .Get() on scene tree for non-leaf nodes
52+
v.2.1.0
53+
- ADDED: CodeComments attribute
54+
- ADDED: OnInstantiate attribute (with protected constructor)
55+
- ADDED: Inline changed action on Notify setter
56+
- ADDED: Implicit operators as an alternative to calling .Get() on scene tree for non-leaf nodes
5657

57-
v.2.0.0
58-
- ADDED: Support for Godot 4.0
59-
-- KnownIssue: GodotOverride requires an additional partial method override declaration
60-
- CHANGED: Notify must be used on property instead of field to access privately generated content
61-
- ADDED: InputMap attribute
58+
v.2.0.0
59+
- ADDED: Support for Godot 4.0
60+
-- KnownIssue: GodotOverride requires an additional partial method override declaration
61+
- CHANGED: Notify must be used on property instead of field to access privately generated content
62+
- ADDED: InputMap attribute
6263

63-
v.1.3.3
64-
- ADDED: Support for placeholder scenes
65-
- ADDED: Support for editable instanced scenes
66-
- FIXED: GodotOverride in derived class now calls rather than hides base method
67-
- FIXED: Previously, types could not share the same name. This has now been fixed.
68-
- ADDED: Notify attribute (with support for [Export])
69-
- ADDED: Added support for uniquely named nodes (ie, Godot 3.5 - GetNode("%MyUniqueNode"))
64+
v.1.3.3
65+
- ADDED: Support for placeholder scenes
66+
- ADDED: Support for editable instanced scenes
67+
- FIXED: GodotOverride in derived class now calls rather than hides base method
68+
- FIXED: Previously, types could not share the same name. This has now been fixed.
69+
- ADDED: Notify attribute (with support for [Export])
70+
- ADDED: Support for uniquely named nodes (ie, Godot 3.5 - GetNode("%MyUniqueNode"))
7071

71-
v.1.2.0
72-
- Replaces ISourceGenerator with IIncrementalGenerator for faster builds
73-
- Hierarchy of inherited scenes are now fully accessible from base classes
74-
- Hierarchy of instanced scenes can be made accessible using [SceneTree(traverseInstancedScenes=true)]
75-
- FIXED: Modifications (overrides) of inheritance hierarchy now supported
76-
- FIXED: Inheriting/Instancing scenes without scripts now supported
77-
- FIXED: Consumers with implicit usings enabled now supported
72+
v.1.2.0
73+
- Replaces ISourceGenerator with IIncrementalGenerator for faster builds
74+
- Hierarchy of inherited scenes are now fully accessible from base classes
75+
- Hierarchy of instanced scenes can be made accessible using [SceneTree(traverseInstancedScenes=true)]
76+
- FIXED: Modifications (overrides) of inheritance hierarchy now supported
77+
- FIXED: Inheriting/Instancing scenes without scripts now supported
78+
- FIXED: Consumers with implicit usings enabled now supported
7879

79-
v.1.1.4
80-
- Exposed base classes/helpers to help create project specific source generators
80+
v.1.1.4
81+
- Exposed base classes/helpers to help create project specific source generators
8182

82-
v.1.0.0
83-
- Initial release (SceneTree/GodotOverride)
84-
</PackageReleaseNotes>
83+
v.1.0.0
84+
- Initial release (SceneTree/GodotOverride)
85+
</PackageReleaseNotes>
86+
<Authors>Cat-Lips</Authors>
87+
<PackageReadmeFile>README.md</PackageReadmeFile>
88+
<PackageTags>Godot C# SourceGenerator</PackageTags>
89+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
90+
<PackageLicenseExpression>MIT</PackageLicenseExpression>
8591
<RepositoryUrl>https://github.com/Cat-Lips/GodotSharp.SourceGenerators</RepositoryUrl>
8692
<PackageProjectUrl>https://github.com/Cat-Lips/GodotSharp.SourceGenerators</PackageProjectUrl>
87-
<PackageLicenseExpression>MIT</PackageLicenseExpression>
88-
<PackageTags>Godot C# SourceGenerator</PackageTags>
89-
<PackageReadmeFile>README.md</PackageReadmeFile>
90-
<!--<Version>2.3.4</Version>-->
9193
<Version>2.4.0-$([System.DateTime]::Now.ToString(yyMMdd-HHmm)).$(Configuration)</Version>
92-
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
94+
<!--<Version>2.3.4</Version>-->
9395
</PropertyGroup>
9496
<ItemGroup>
9597
<None Include="..\README.md" Pack="true" PackagePath="\" Link="Package\docs\README.md" />

0 commit comments

Comments
 (0)