Skip to content

Commit 7d811d2

Browse files
committed
Add new Godot integration to the new Runtime/Integrations folder.
Add a .targets file to automatically include and compile the source files in consumer projects for seamless source-only package integration. Disable context in logs by default. Move Unity integration to a new Runtime/Integrations folder. Change the NuGet package type to a source-only package. Add a new Directory.Build.props file to improve local development for Godot. Configure local development to target net8.0 when working with Godot. Include LICENSE.md and CHANGELOG.md files in the final NuGet package. Update tags in package.json. Update the .editorconfig file. Update VSCode settings.json.
1 parent 869b4a9 commit 7d811d2

File tree

204 files changed

+3408
-54
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

204 files changed

+3408
-54
lines changed

.editorconfig

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,33 @@
1-
2-
; ---------------------------
3-
; 2021 Juan Delgado (JuDelCo)
4-
; ---------------------------
1+
; This .editorconfig file is used to enforce code style and formatting standards
2+
; across the project. Please adhere to these settings to ensure consistency.
3+
; - Juan Delgado (@JuDelCo)
54

65
; Basic text editor config
76
; Reference: http://editorconfig.org
7+
[*]
8+
charset = utf-8
9+
end_of_line = lf
10+
11+
; .NET CSharp files
812
[*.cs]
913
indent_style = tab
1014
indent_size = 4
11-
charset = utf-8
15+
trim_trailing_whitespace = true
16+
insert_final_newline = true
1217

13-
; Code analysis - Ignore rules (NET native project & Unity3D project)
18+
; Code analysis - Ignore rules (.NET native)
1419
[**bin/**.cs]
1520
generated_code = true
1621
[**obj/**.cs]
1722
generated_code = true
23+
24+
; Code analysis - Ignore rules (Unity3D)
25+
; Extra:
26+
; 1- Create a new file in: %UnityEditor_Folder%/Editor/Data/Resources/PackageManager/.editorconfig
27+
; 2- Add this to the file to prevent Unity built-in packages to be analyzed:
28+
; [**.cs]
29+
; generated_code = true
30+
; 3- You need to repeat it for each Unity installation
1831
[**PackageCache/**.cs]
1932
generated_code = true
2033
[Assets/Plugins/**.cs]
@@ -29,11 +42,16 @@ csharp_prefer_simple_using_statement = false:none
2942
csharp_style_prefer_switch_expression = false:none
3043
csharp_style_conditional_delegate_call = false:none
3144
csharp_style_implicit_object_creation_when_type_is_apparent = false:none
45+
csharp_space_after_cast = true
46+
csharp_space_between_parentheses = false
47+
csharp_space_between_method_declaration_parameter_list_parentheses = false
48+
csharp_space_between_method_call_parameter_list_parentheses = false
49+
dotnet_sort_system_directives_first = true
3250
dotnet_code_quality_unused_parameters = non_public:none
3351
dotnet_style_object_initializer = false:silent
3452
dotnet_style_collection_initializer = false:silent
3553
dotnet_style_readonly_field = false:silent
3654
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
3755
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
3856
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
39-
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:none
57+
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:none

.vscode/settings.json

Lines changed: 34 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,38 @@
11
{
22
"files.exclude": {
3+
// -------------------------------
4+
// System / Git / Editor
5+
// -------------------------------
36
"**/.DS_Store": true,
47
"**/.hidden": true,
8+
"*.lnk": true,
59
"**/.git": true,
610
"**/.gitignore": true,
711
"**/.gitattributes": true,
812
"**/.gitmodules": true,
913
"**/.editorconfig": true,
14+
".vscode/": true,
15+
".vs/": true,
16+
// -------------------------------
17+
// Visual Studio & Build Artifacts
18+
// -------------------------------
1019
"**/*.booproj": true,
1120
"**/*.pidb": true,
1221
"**/*.suo": true,
1322
"**/*.user": true,
1423
"**/*.userprefs": true,
1524
"**/*.dll": true,
16-
"**/*.pdb": true,
1725
"**/*.exe": true,
18-
"**/*.pdf": true,
19-
"**/*.mid": true,
20-
"**/*.midi": true,
21-
"**/*.wav": true,
26+
"**/*.pdb": true,
27+
"**/bin/": true,
28+
"**/Bin/": true,
29+
"**/obj/": true,
30+
"**/Obj/": true,
31+
"**/nuget.config": true,
32+
"**/runtimes/": true,
33+
// -------------------------------
34+
// Media Files
35+
// -------------------------------
2236
"**/*.gif": true,
2337
"**/*.ico": true,
2438
"**/*.jpg": true,
@@ -28,6 +42,9 @@
2842
"**/*.tga": true,
2943
"**/*.tif": true,
3044
"**/*.tiff": true,
45+
"**/*.mid": true,
46+
"**/*.midi": true,
47+
"**/*.wav": true,
3148
"**/*.3ds": true,
3249
"**/*.3DS": true,
3350
"**/*.fbx": true,
@@ -38,33 +55,26 @@
3855
"**/*.MA": true,
3956
"**/*.obj": true,
4057
"**/*.OBJ": true,
41-
// ----------------
42-
".vs/": true,
43-
".vscode/": true,
44-
".gradle/": true,
45-
"*.lnk": true,
46-
"**/bin/": true,
47-
"**/Bin/": true,
48-
"**/obj/": true,
49-
"**/Obj/": true,
50-
"**/LICENSE": true,
51-
"**/LICENSE.md": true,
52-
//"**/*.csproj": true,
53-
"**/nuget.config": true,
54-
"**/runtimes/": true,
55-
// ----------------
58+
"**/*.pdf": true,
59+
// -------------------------------
60+
// Unity & Game Assets
61+
// -------------------------------
62+
"Library/": true,
5663
"**/*.asset": true,
5764
"**/*.asmdef": true,
58-
"**/*.unityproj": true,
65+
"**/*.anim": true,
5966
"**/*.cubemap": true,
67+
"**/*.controller": true,
6068
"**/*.flare": true,
6169
"**/*.mat": true,
6270
"**/*.meta": true,
6371
"**/*.prefab": true,
64-
"**/*.unity": true,
65-
"**/*.anim": true,
66-
"**/*.controller": true,
6772
"**/*.physicsMaterial2D": true,
73+
"**/*.unity": true,
74+
"**/*.unityproj": true,
75+
"**/LICENSE": true,
76+
"**/LICENSE.md": true,
77+
".gradle/": true,
6878
},
6979
"files.watcherExclude": {
7080
"**/.git/objects/**": true,

CHANGELOG.md

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,28 @@
11

22
# Changelog
33

4+
## [1.46.0] - 2025-03-24.
5+
6+
### Added
7+
8+
- Add new Godot integration to the new Runtime/Integrations folder.
9+
- Add a .targets file to automatically include and compile the source files in consumer projects for seamless source-only package integration.
10+
11+
### Changed
12+
13+
- Disable context in logs by default.
14+
- Move Unity integration to a new Runtime/Integrations folder.
15+
- Change the NuGet package type to a source-only package.
16+
- Add a new Directory.Build.props file to improve local development for Godot.
17+
- Configure local development to target net8.0 when working with Godot.
18+
19+
### Improved
20+
21+
- Include LICENSE.md and CHANGELOG.md files in the final NuGet package.
22+
- Update tags in package.json.
23+
- Update the .editorconfig file.
24+
- Update VSCode settings.json.
25+
426
## [1.45.0] - 2025-03-13
527

628
### Improved
@@ -223,16 +245,3 @@
223245
### Improved
224246

225247
- Add new internal service cache for all internal service usage.
226-
227-
[1.45.0]: https://github.com/JuDelCo/Core/compare/v1.44.0...v1.45.0
228-
[1.44.0]: https://github.com/JuDelCo/Core/compare/v1.43.0...v1.44.0
229-
[1.43.0]: https://github.com/JuDelCo/Core/compare/v1.42.0...v1.43.0
230-
[1.42.0]: https://github.com/JuDelCo/Core/compare/v1.41.0...v1.42.0
231-
[1.41.0]: https://github.com/JuDelCo/Core/compare/v1.40.0...v1.41.0
232-
[1.40.0]: https://github.com/JuDelCo/Core/compare/v1.39.0...v1.40.0
233-
[1.39.0]: https://github.com/JuDelCo/Core/compare/v1.38.0...v1.39.0
234-
[1.38.0]: https://github.com/JuDelCo/Core/compare/v1.37.0...v1.38.0
235-
[1.37.0]: https://github.com/JuDelCo/Core/compare/v1.36.0...v1.37.0
236-
[1.36.0]: https://github.com/JuDelCo/Core/compare/v1.35.0...v1.36.0
237-
[1.35.0]: https://github.com/JuDelCo/Core/compare/v1.34.0...v1.35.0
238-
[1.34.0]: https://github.com/JuDelCo/Core/compare/v1.33.0...v1.34.0

Core.csproj

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,49 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<Version>1.45.0</Version>
5-
<Authors>Juan Delgado (@JuDelCo)</Authors>
64
<Title>JuCore</Title>
5+
<Version>1.46.0</Version>
76
<AssemblyName>JuCore</AssemblyName>
7+
<Authors>Juan Delgado (@JuDelCo)</Authors>
8+
<Copyright>Copyright (c) 2016-2025 Juan Delgado (@JuDelCo)</Copyright>
89
<Description>Service locator (IoC Container), object factory, util classes and lots of services to ease the development of C# applications and games</Description>
9-
<RepositoryType>git</RepositoryType>
1010
<PackageId>JuDelCo.Lib.Core</PackageId>
11+
<PackageTags>Core;JuCore;IOC;Container;ServiceLocator;DependencyInjection;Utilities;Service;Factory;Event;Eventbus;Log;Promise;Timer;Coroutine;Task;Cache;Data;Sync;Async;Pool;FSM;Time;Color;Util</PackageTags>
1112
<PackageReadmeFile>README.md</PackageReadmeFile>
1213
<PackageProjectUrl>https://github.com/JuDelCo/Core</PackageProjectUrl>
1314
<RepositoryUrl>https://github.com/JuDelCo/Core</RepositoryUrl>
15+
<RepositoryType>git</RepositoryType>
1416
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1517
</PropertyGroup>
1618

1719
<ItemGroup>
18-
<None Include="README.md" Pack="true" PackagePath="\"/>
20+
<None Include="README.md" Pack="true" PackagePath="/"/>
21+
<None Include="CHANGELOG.md" Pack="true" PackagePath="/"/>
22+
<None Include="LICENSE.md" Pack="true" PackagePath="/"/>
23+
<None Include="build/JuDelCo.Lib.Core.targets" Pack="true" PackagePath="build" />
24+
<Content Include="**/*.cs" Exclude="bin/**;obj/**" Pack="true" PackagePath="contentFiles/cs/any/" />
1925
</ItemGroup>
2026

2127
<PropertyGroup>
2228
<OutputType>Library</OutputType>
23-
<TargetFramework>netstandard2.0</TargetFramework>
29+
<IncludeBuildOutput>false</IncludeBuildOutput>
30+
<NoWarn>$(NoWarn);NU5128</NoWarn>
31+
<InvariantGlobalization>true</InvariantGlobalization>
32+
</PropertyGroup>
2433

34+
<PropertyGroup>
2535
<IsLinux Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))' == 'true'">true</IsLinux>
2636
<IsOSX Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))' == 'true'">true</IsOSX>
2737
<IsWindows Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))' == 'true'">true</IsWindows>
38+
<IsGodotBuild Condition="$([System.Text.RegularExpressions.Regex]::IsMatch($(DefineConstants), 'GODOT'))">true</IsGodotBuild>
39+
</PropertyGroup>
2840

29-
<InvariantGlobalization>true</InvariantGlobalization>
41+
<PropertyGroup Condition="'$(IsGodotBuild)'!='true'">
42+
<TargetFramework>netstandard2.0</TargetFramework>
43+
</PropertyGroup>
44+
45+
<PropertyGroup Condition="'$(IsGodotBuild)'=='true'">
46+
<TargetFramework>net8.0</TargetFramework>
3047
</PropertyGroup>
3148

3249
<PropertyGroup Condition="'$(IsLinux)'=='true'">

Directory.Build.props

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<!--
2+
This file (Directory.Build.props) is intended solely for local development purposes.
3+
It is used to enhance the development experience (e.g., by adding specific defines for Godot integration)
4+
when building projects with MSBuild in your local environment (such as in VSCode with OmniSharp).
5+
6+
IMPORTANT:
7+
- To disable this when creating a new NuGet package (to target netstandard2.0) use 'dotnet pack -p:DisableGodotReferences=true'.
8+
- Unity's Package Manager (UPM) ignores this file when importing packages from a Git repository.
9+
10+
In summary, any settings or defines specified here are only applied during local development
11+
and will not affect the build process in consumer environments like Unity or in published packages.
12+
-->
13+
<Project>
14+
<PropertyGroup>
15+
<GodotInstallationPath Condition="'$(GodotInstallationPath)'==''">/opt/Godot/GodotSharp/</GodotInstallationPath>
16+
<DefineConstants Condition="'$(DisableGodotReferences)' != 'true'">$(DefineConstants);GODOT4;GODOT4_3_OR_GREATER</DefineConstants>
17+
<!--<DefineConstants Condition="'$(DisableGodotReferences)' != 'true'">$(DefineConstants);GODOT4;GODOT4_3_OR_GREATER;GODOT_EDITOR</DefineConstants>-->
18+
</PropertyGroup>
19+
<ItemGroup Condition="'$(DisableGodotReferences)' != 'true' and $(DefineConstants.Contains('GODOT4_3_OR_GREATER'))">
20+
<Reference Include="GodotSharp">
21+
<HintPath>$(GodotInstallationPath)Api/Release/GodotSharp.dll</HintPath>
22+
</Reference>
23+
<!--<Reference Include="GodotSharpEditor">
24+
<HintPath>$(GodotInstallationPath)Api/Release/GodotSharpEditor.dll</HintPath>
25+
</Reference>-->
26+
<!--<Reference Include="GodotPlugins">
27+
<HintPath>$(GodotInstallationPath)Api/Release/GodotPlugins.dll</HintPath>
28+
</Reference>-->
29+
</ItemGroup>
30+
</Project>

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The Wiki explains [**how to install**](https://github.com/JuDelCo/Core/wiki/Usag
2121
- For **Unity**, update the dependencies in the ```/Packages/manifest.json``` file in your project folder by adding:
2222

2323
```json
24-
"com.judelco.core": "https://github.com/JuDelCo/Core.git#v1.45.0",
24+
"com.judelco.core": "https://github.com/JuDelCo/Core.git#v1.46.0",
2525
```
2626

2727
- For native **.NET projects**, **Godot**, etc... run the following command in the console of your .NET project to add the package:

Runtime/Core/Log/Log.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ private static string TruncateFolders(string path)
6666
#endif
6767
}
6868

69-
internal static bool contextEnabled = true;
69+
internal static bool contextEnabled = false;
7070
internal static bool folderTrim = false;
7171
}
7272
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// SPDX-License-Identifier: MIT
2+
// Copyright (c) 2025-2025 Juan Delgado (@JuDelCo)
3+
4+
#if GODOT4_3_OR_GREATER
5+
6+
using System;
7+
using Godot;
8+
9+
namespace Ju.Handlers
10+
{
11+
public struct NodeLinkHandler : ILinkHandler
12+
{
13+
private readonly WeakReference nodeRef;
14+
private readonly bool alwaysActive;
15+
16+
public NodeLinkHandler(Node node, bool alwaysActive = false)
17+
{
18+
this.nodeRef = new WeakReference(node);
19+
this.alwaysActive = alwaysActive;
20+
}
21+
22+
public bool IsActive => !IsDestroyed && (alwaysActive || (((Node) nodeRef.Target).IsInsideTree() && ((Node) nodeRef.Target).CanProcess()));
23+
public bool IsDestroyed => !nodeRef.IsAlive || !GodotObject.IsInstanceValid((Node) nodeRef.Target) || ((Node) nodeRef.Target) == null;
24+
}
25+
}
26+
27+
#endif
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// SPDX-License-Identifier: MIT
2+
// Copyright (c) 2025-2025 Juan Delgado (@JuDelCo)
3+
4+
#if GODOT4_3_OR_GREATER
5+
6+
namespace Ju.Services
7+
{
8+
public struct GodotAppFocusEvent : ISerializableEvent
9+
{
10+
public bool hasFocus;
11+
12+
public GodotAppFocusEvent(bool hasFocus)
13+
{
14+
this.hasFocus = hasFocus;
15+
}
16+
17+
public string Serialize()
18+
{
19+
return string.Format("[ hasFocus: {0} ]", hasFocus);
20+
}
21+
}
22+
}
23+
24+
#endif
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// SPDX-License-Identifier: MIT
2+
// Copyright (c) 2025-2025 Juan Delgado (@JuDelCo)
3+
4+
#if GODOT4_3_OR_GREATER
5+
6+
namespace Ju.Services
7+
{
8+
public struct GodotAppNotificationEvent : ISerializableEvent
9+
{
10+
public int what;
11+
12+
public GodotAppNotificationEvent(int what)
13+
{
14+
this.what = what;
15+
}
16+
17+
public string Serialize()
18+
{
19+
return string.Format("[ what: {0} ]", what);
20+
}
21+
}
22+
}
23+
24+
#endif

0 commit comments

Comments
 (0)