Skip to content

Commit 609ebd0

Browse files
committed
RELEASE 2.5.0
1 parent 5e2a4d1 commit 609ebd0

9 files changed

Lines changed: 149 additions & 146 deletions

File tree

CustomGeneratorTests/CustomGeneratorTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
88
</PropertyGroup>
99
<ItemGroup>
10-
<PackageReference Include="GodotSharp.SourceGenerators" Version="2.4.1-241118-1954.Release" />
10+
<PackageReference Include="GodotSharp.SourceGenerators" Version="2.5.0" />
1111
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.8.0" PrivateAssets="all" />
1212
</ItemGroup>
1313
</Project>

Godot 3 Tests/Godot 3 Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</ItemGroup>
1111
<ItemGroup>
1212
<PackageReference Include="FluentAssertions" Version="6.12.1" />
13-
<PackageReference Include="GodotSharp.SourceGenerators" Version="2.4.1-241118-1954.Release" />
13+
<PackageReference Include="GodotSharp.SourceGenerators" Version="2.5.0" />
1414
</ItemGroup>
1515
<ItemGroup>
1616
<ProjectReference Include="..\CustomGeneratorTests\CustomGeneratorTests.csproj" OutputItemType="analyzer" />

Godot 3 Tests/Run.cs

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -8,58 +8,58 @@
88

99
namespace GodotTests
1010
{
11-
[SceneTree]
12-
public abstract partial class Run : Control
13-
{
14-
private static IEnumerable<Func<ITest>> Tests
15-
{
16-
get
17-
{
18-
yield return ITest.GetTest<AmbiguousTypeWithImplicitUsings>;
19-
yield return ITest.GetTest<BuiltInScriptTest>;
20-
yield return ITest.GetTest<CachedNodes>;
21-
yield return ITest.GetTest<DiscardWorkaroundTest>;
22-
yield return ITest.GetTest<EditableChildrenTest>;
23-
yield return ITest.GetTest<EditableChildrenWithTraversalTest>;
24-
yield return ITest.GetTest<EmptyScene>;
25-
yield return ITest.GetTest<EmptySceneWithNoNamespace>;
26-
yield return ITest.GetTest<ExternalGdScriptTest>;
27-
yield return ITest.GetTest<GenericRootTest>;
28-
yield return ITest.GetTest<GodotNotifyTests>;
29-
yield return ITest.GetTest<GodotOverrideInheritanceTest>;
30-
yield return ITest.GetTest<GodotOverrideTest>;
31-
yield return ITest.GetTest<ImplicitConversionTests>;
32-
yield return ITest.GetTest<InheritedScene>;
33-
yield return ITest.GetTest<InheritedSceneWithBaseChanges1>;
34-
yield return ITest.GetTest<InheritedSceneWithBaseChanges2>;
35-
yield return ITest.GetTest<InheritedSceneWithInstancedScene>;
36-
yield return ITest.GetTest<InheritingSceneWithoutScript>;
37-
yield return ITest.GetTest<InputMapAttributeTests>;
38-
yield return ITest.GetTest<InstancedScene>;
39-
yield return ITest.GetTest<InstancedSceneFromDifferentNamespace>;
40-
yield return ITest.GetTest<InstancingSceneWithoutScript>;
41-
yield return ITest.GetTest<InstantiateTests>;
42-
yield return ITest.GetTest<LayerNamesAttributeTests>;
43-
yield return ITest.GetTest<LoadAsPlaceholderTest>;
44-
yield return ITest.GetTest<NotifyPartialPropertiesTest>;
45-
yield return ITest.GetTest<OnInstantiateWithDefaultParamsTest>;
46-
yield return ITest.GetTest<PathTooLongError>;
47-
yield return ITest.GetTest<RootScene>;
48-
yield return ITest.GetTest<RootSceneWithNoNamespace>;
49-
yield return ITest.GetTest<SameNameTest>;
50-
yield return ITest.GetTest<ScriptForSceneWithDifferentName>;
51-
yield return ITest.GetTest<ScriptForSceneWithDifferentPath>;
52-
yield return ITest.GetTest<SubNodeSceneTreeTest>;
53-
yield return ITest.GetTest<TraverseInstancedScene>;
54-
yield return ITest.GetTest<TypeNameCaseMismatchTest>;
55-
yield return ITest.GetTest<UniqueSceneNameAccessTest>;
56-
yield return ITest.GetTest<UnsupportedInheritedOverride>;
57-
yield return ITest.GetTest<UnsupportedInstancedOverride>;
58-
}
59-
}
11+
[SceneTree]
12+
public abstract partial class Run : Control
13+
{
14+
private static IEnumerable<Func<ITest>> Tests
15+
{
16+
get
17+
{
18+
yield return ITest.GetTest<AmbiguousTypeWithImplicitUsings>;
19+
yield return ITest.GetTest<BuiltInScriptTest>;
20+
yield return ITest.GetTest<CachedNodes>;
21+
yield return ITest.GetTest<DiscardWorkaroundTest>;
22+
yield return ITest.GetTest<EditableChildrenTest>;
23+
yield return ITest.GetTest<EditableChildrenWithTraversalTest>;
24+
yield return ITest.GetTest<EmptyScene>;
25+
yield return ITest.GetTest<EmptySceneWithNoNamespace>;
26+
yield return ITest.GetTest<ExternalGdScriptTest>;
27+
yield return ITest.GetTest<GenericRootTest>;
28+
yield return ITest.GetTest<GodotNotifyTests>;
29+
yield return ITest.GetTest<GodotOverrideInheritanceTest>;
30+
yield return ITest.GetTest<GodotOverrideTest>;
31+
yield return ITest.GetTest<ImplicitConversionTests>;
32+
yield return ITest.GetTest<InheritedScene>;
33+
yield return ITest.GetTest<InheritedSceneWithBaseChanges1>;
34+
yield return ITest.GetTest<InheritedSceneWithBaseChanges2>;
35+
yield return ITest.GetTest<InheritedSceneWithInstancedScene>;
36+
yield return ITest.GetTest<InheritingSceneWithoutScript>;
37+
yield return ITest.GetTest<InputMapAttributeTests>;
38+
yield return ITest.GetTest<InstancedScene>;
39+
yield return ITest.GetTest<InstancedSceneFromDifferentNamespace>;
40+
yield return ITest.GetTest<InstancingSceneWithoutScript>;
41+
yield return ITest.GetTest<InstantiateTests>;
42+
yield return ITest.GetTest<LayerNamesAttributeTests>;
43+
yield return ITest.GetTest<LoadAsPlaceholderTest>;
44+
yield return ITest.GetTest<NotifyPartialPropertiesTest>;
45+
yield return ITest.GetTest<OnInstantiateWithDefaultParamsTest>;
46+
yield return ITest.GetTest<PathTooLongError>;
47+
yield return ITest.GetTest<RootScene>;
48+
yield return ITest.GetTest<RootSceneWithNoNamespace>;
49+
yield return ITest.GetTest<SameNameTest>;
50+
yield return ITest.GetTest<ScriptForSceneWithDifferentName>;
51+
yield return ITest.GetTest<ScriptForSceneWithDifferentPath>;
52+
yield return ITest.GetTest<SubNodeSceneTreeTest>;
53+
yield return ITest.GetTest<TraverseInstancedScene>;
54+
yield return ITest.GetTest<TypeNameCaseMismatchTest>;
55+
yield return ITest.GetTest<UniqueSceneNameAccessTest>;
56+
yield return ITest.GetTest<UnsupportedInheritedOverride>;
57+
yield return ITest.GetTest<UnsupportedInstancedOverride>;
58+
}
59+
}
6060

61-
[GodotOverride]
62-
public void OnReady()
63-
=> _.TestRunner.Initialise(Tests);
64-
}
61+
[GodotOverride]
62+
public void OnReady()
63+
=> _.TestRunner.Initialise(Tests);
64+
}
6565
}

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.2" />
15-
<PackageReference Include="GodotSharp.SourceGenerators" Version="2.4.1-241118-1954.Release" />
15+
<PackageReference Include="GodotSharp.SourceGenerators" Version="2.5.0" />
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.2" />
13-
<PackageReference Include="GodotSharp.SourceGenerators" Version="2.4.1-241118-1954.Release" />
13+
<PackageReference Include="GodotSharp.SourceGenerators" Version="2.5.0" />
1414
</ItemGroup>
1515
</Project>

NRT.Tests/GD3.NRT/Main.cs

Lines changed: 72 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -3,89 +3,89 @@
33

44
namespace NRT.Tests
55
{
6-
[SceneTree]
7-
public partial class Main : Node
8-
{
9-
[GodotOverride]
10-
private void OnReady()
11-
{
12-
// Setup
13-
var nullableWithNull = TestWithNullableNRT.Instantiate();
14-
var nullableWithNotNull = TestWithNullableNRT.Instantiate("not null", "not null");
15-
var nonNullableWithEmpty = TestWithNonNullableNRT.Instantiate(); // (should not compile with null/default)
16-
var nonNullableWithNotEmpty = TestWithNonNullableNRT.Instantiate("not empty", "not empty");
6+
[SceneTree]
7+
public partial class Main : Node
8+
{
9+
[GodotOverride]
10+
private void OnReady()
11+
{
12+
// Setup
13+
var nullableWithNull = TestWithNullableNRT.Instantiate();
14+
var nullableWithNotNull = TestWithNullableNRT.Instantiate("not null", "not null");
15+
var nonNullableWithEmpty = TestWithNonNullableNRT.Instantiate(); // (should not compile with null/default)
16+
var nonNullableWithNotEmpty = TestWithNonNullableNRT.Instantiate("not empty", "not empty");
1717

18-
TestInstantiate();
19-
TestNotify();
20-
TestNotifyWithAction();
18+
TestInstantiate();
19+
TestNotify();
20+
TestNotifyWithAction();
2121

22-
// Teardown
23-
nullableWithNull.Free();
24-
nullableWithNotNull.Free();
25-
nonNullableWithEmpty.Free();
26-
nonNullableWithNotEmpty.Free();
22+
// Teardown
23+
nullableWithNull.Free();
24+
nullableWithNotNull.Free();
25+
nonNullableWithEmpty.Free();
26+
nonNullableWithNotEmpty.Free();
2727

28-
GD.Print("TEST PASS OK");
28+
GD.Print("TEST PASS OK");
2929

30-
GetTree().Quit();
30+
GetTree().Quit();
3131

32-
void TestInstantiate()
33-
{
34-
nullableWithNull.InstantiateValue1.Should().Be(null);
35-
nullableWithNull.InstantiateValue2.Should().Be(default);
36-
nullableWithNotNull.InstantiateValue1.Should().Be("not null");
37-
nullableWithNotNull.InstantiateValue2.Should().Be("not null");
38-
nonNullableWithEmpty.InstantiateValue1.Should().Be(string.Empty);
39-
nonNullableWithEmpty.InstantiateValue2.Should().Be(default!);
40-
nonNullableWithNotEmpty.InstantiateValue1.Should().Be("not empty");
41-
nonNullableWithNotEmpty.InstantiateValue2.Should().Be("not empty");
42-
}
32+
void TestInstantiate()
33+
{
34+
nullableWithNull.InstantiateValue1.Should().Be(null);
35+
nullableWithNull.InstantiateValue2.Should().Be(default);
36+
nullableWithNotNull.InstantiateValue1.Should().Be("not null");
37+
nullableWithNotNull.InstantiateValue2.Should().Be("not null");
38+
nonNullableWithEmpty.InstantiateValue1.Should().Be(string.Empty);
39+
nonNullableWithEmpty.InstantiateValue2.Should().Be(default!);
40+
nonNullableWithNotEmpty.InstantiateValue1.Should().Be("not empty");
41+
nonNullableWithNotEmpty.InstantiateValue2.Should().Be("not empty");
42+
}
4343

44-
void TestNotify()
45-
{
46-
nullableWithNull.NotifyTest.Should().Be(null);
47-
nullableWithNotNull.NotifyTest.Should().Be(null);
48-
nonNullableWithEmpty.NotifyTest.Should().Be(string.Empty);
49-
nonNullableWithNotEmpty.NotifyTest.Should().Be(string.Empty);
44+
void TestNotify()
45+
{
46+
nullableWithNull.NotifyTest.Should().Be(null);
47+
nullableWithNotNull.NotifyTest.Should().Be(null);
48+
nonNullableWithEmpty.NotifyTest.Should().Be(string.Empty);
49+
nonNullableWithNotEmpty.NotifyTest.Should().Be(string.Empty);
5050

51-
nullableWithNull.NotifyTest = null;
52-
nullableWithNotNull.NotifyTest = "not null";
53-
nonNullableWithEmpty.NotifyTest = string.Empty; // (should not compile with null)
54-
nonNullableWithNotEmpty.NotifyTest = "not empty";
51+
nullableWithNull.NotifyTest = null;
52+
nullableWithNotNull.NotifyTest = "not null";
53+
nonNullableWithEmpty.NotifyTest = string.Empty; // (should not compile with null)
54+
nonNullableWithNotEmpty.NotifyTest = "not empty";
5555

56-
nullableWithNull.NotifyTest.Should().Be(null);
57-
nullableWithNotNull.NotifyTest.Should().Be("not null");
58-
nonNullableWithEmpty.NotifyTest.Should().Be(string.Empty);
59-
nonNullableWithNotEmpty.NotifyTest.Should().Be("not empty");
60-
}
56+
nullableWithNull.NotifyTest.Should().Be(null);
57+
nullableWithNotNull.NotifyTest.Should().Be("not null");
58+
nonNullableWithEmpty.NotifyTest.Should().Be(string.Empty);
59+
nonNullableWithNotEmpty.NotifyTest.Should().Be("not empty");
60+
}
6161

62-
void TestNotifyWithAction()
63-
{
64-
nullableWithNull.NotifyActionValue.Should().Be(null);
65-
nullableWithNotNull.NotifyActionValue.Should().Be(null);
66-
nonNullableWithEmpty.NotifyActionValue.Should().Be(string.Empty);
67-
nonNullableWithNotEmpty.NotifyActionValue.Should().Be(string.Empty);
62+
void TestNotifyWithAction()
63+
{
64+
nullableWithNull.NotifyActionValue.Should().Be(null);
65+
nullableWithNotNull.NotifyActionValue.Should().Be(null);
66+
nonNullableWithEmpty.NotifyActionValue.Should().Be(string.Empty);
67+
nonNullableWithNotEmpty.NotifyActionValue.Should().Be(string.Empty);
6868

69-
nullableWithNull.NotifyTestWithAction.Should().Be(null);
70-
nullableWithNotNull.NotifyTestWithAction.Should().Be(null);
71-
nonNullableWithEmpty.NotifyTestWithAction.Should().Be(string.Empty);
72-
nonNullableWithNotEmpty.NotifyTestWithAction.Should().Be(string.Empty);
69+
nullableWithNull.NotifyTestWithAction.Should().Be(null);
70+
nullableWithNotNull.NotifyTestWithAction.Should().Be(null);
71+
nonNullableWithEmpty.NotifyTestWithAction.Should().Be(string.Empty);
72+
nonNullableWithNotEmpty.NotifyTestWithAction.Should().Be(string.Empty);
7373

74-
nullableWithNull.NotifyTestWithAction = null;
75-
nullableWithNotNull.NotifyTestWithAction = "not null";
76-
nonNullableWithEmpty.NotifyTestWithAction = string.Empty; // (should not compile with null)
77-
nonNullableWithNotEmpty.NotifyTestWithAction = "not empty";
74+
nullableWithNull.NotifyTestWithAction = null;
75+
nullableWithNotNull.NotifyTestWithAction = "not null";
76+
nonNullableWithEmpty.NotifyTestWithAction = string.Empty; // (should not compile with null)
77+
nonNullableWithNotEmpty.NotifyTestWithAction = "not empty";
7878

79-
nullableWithNull.NotifyTestWithAction.Should().Be(null);
80-
nullableWithNotNull.NotifyTestWithAction.Should().Be("not null");
81-
nonNullableWithEmpty.NotifyTestWithAction.Should().Be(string.Empty);
82-
nonNullableWithNotEmpty.NotifyTestWithAction.Should().Be("not empty");
79+
nullableWithNull.NotifyTestWithAction.Should().Be(null);
80+
nullableWithNotNull.NotifyTestWithAction.Should().Be("not null");
81+
nonNullableWithEmpty.NotifyTestWithAction.Should().Be(string.Empty);
82+
nonNullableWithNotEmpty.NotifyTestWithAction.Should().Be("not empty");
8383

84-
nullableWithNull.NotifyActionValue.Should().Be(null);
85-
nullableWithNotNull.NotifyActionValue.Should().Be("not null");
86-
nonNullableWithEmpty.NotifyActionValue.Should().Be(string.Empty);
87-
nonNullableWithNotEmpty.NotifyActionValue.Should().Be("not empty");
88-
}
89-
}
90-
}
84+
nullableWithNull.NotifyActionValue.Should().Be(null);
85+
nullableWithNotNull.NotifyActionValue.Should().Be("not null");
86+
nonNullableWithEmpty.NotifyActionValue.Should().Be(string.Empty);
87+
nonNullableWithNotEmpty.NotifyActionValue.Should().Be("not empty");
88+
}
89+
}
90+
}
9191
}

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.2" />
13-
<PackageReference Include="GodotSharp.SourceGenerators" Version="2.4.1-241118-1954.Release" />
13+
<PackageReference Include="GodotSharp.SourceGenerators" Version="2.5.0" />
1414
</ItemGroup>
1515
</Project>

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# GodotSharp.SourceGenerators
22

3-
C# Source Generators for use with the Godot Game Engine (supports Godot 4 and .NET 8!)
3+
C# Source Generators for use with the Godot Game Engine (supports Godot 4 and .NET 9!)
44
* `SceneTree` class attribute:
55
* Generates class property for uniquely named nodes
66
* Provides strongly typed access to the scene hierarchy (via `_` operator)
77
* `GodotOverride` method attribute:
88
* Allows use of On*, instead of virtual _* overrides
9-
* (Requires partial method declaration for use with Godot 4.0)
9+
* (Requires partial method declaration for use with Godot 4)
1010
* `Notify` property attribute:
1111
* Generates boiler plate code, triggering only when values differ
1212
* (Automagically triggers nested changes for Resource and Resource[])
@@ -122,10 +122,13 @@ Generates:
122122
* Generates public events Value1Changed & Value1Changing and a private class to manage field and event delivery
123123
* (Automagically triggers nested changes for Resource and Resource[])
124124
* Events are triggered only if value is different
125-
* [NEW] Initial value can be set without triggering update (useful when using a non-nullable reference type)
125+
* Initial value can be set without triggering update (useful when using a non-nullable reference type)
126+
* [NEW] Supports partial properties!
126127
```cs
127128
public partial class NotifyTest : Node
128129
{
130+
[Notify] public partial int Value { get; set; } // [NEW] Partial properties now supported
131+
129132
[Notify]
130133
public float Value1
131134
{
@@ -149,7 +152,7 @@ public partial class NotifyTest : Node
149152
}
150153

151154
public NotifyTest()
152-
=> InitValue1(7); // [NEW] Set initial value without triggering events (optional)
155+
=> InitValue1(7); // Set initial value without triggering events (optional)
153156
}
154157
```
155158
### `InputMap`

0 commit comments

Comments
 (0)