Build script project from editor

- Added `ContinueWith` to BackgroundTask
- Added setting for Path to `dotnet` executable
- Added detection and check of installed .Net SDKs
This commit is contained in:
Simon Lübeß
2026-10-23 22:21:16 +02:00
committed by Simon Lübeß
parent 9c90b6bb3f
commit 4488bd7d9c
15 changed files with 727 additions and 23 deletions
@@ -0,0 +1,87 @@
using System;
namespace GlitchyEngine.Scripting;
enum DotNetVersionType
{
case Normal;
case Preview(int Number);
case ReleaseCandidate(int Number);
case Unknown;
public int GetSortingOrder()
{
switch (this)
{
case .Normal:
return 3;
case .ReleaseCandidate:
return 2;
case .Preview:
return 1;
case .Unknown:
return 0;
}
}
}
struct DotNetVersion
{
public int Major;
public int Minor;
public int Patch;
public DotNetVersionType Type;
public this()
{
this = default;
}
public this(int major, int minor, int patch, DotNetVersionType type)
{
Major = major;
Minor = minor;
Patch = patch;
Type = type;
}
public override void ToString(String outBuffer)
{
outBuffer.AppendF($"{Major}.{Minor}.{Patch}");
switch (Type)
{
case .Normal:
// Nothing to do.
case .Preview(int Number):
outBuffer.AppendF($" (Preview {Number})");
case .ReleaseCandidate(int Number):
outBuffer.AppendF($" (Release Candidate {Number})");
case .Unknown:
outBuffer.Append(" (Unknown release type)");
}
}
public static int operator <=>(DotNetVersion lhs, DotNetVersion rhs)
{
if (lhs.Major != rhs.Major)
if (lhs.Major > rhs.Major)
return 1;
else
return -1;
if (lhs.Minor != rhs.Minor)
if (lhs.Minor > rhs.Minor)
return 1;
else
return -1;
if (lhs.Patch != rhs.Patch)
if (lhs.Patch > rhs.Patch)
return 1;
else
return -1;
return lhs.Type.GetSortingOrder() <=> rhs.Type.GetSortingOrder();
}
}