Skip to content

Commit 7457741

Browse files
committed
update aspire instructions for godot
1 parent 21eb8e7 commit 7457741

File tree

3 files changed

+6
-35
lines changed

3 files changed

+6
-35
lines changed

tools/AppHost/GodotExtensions.cs

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ public static IResourceBuilder<ExecutableResource> AddGodot(
2424
{
2525
name ??= Path.GetFileNameWithoutExtension(projectPath);
2626
var projectDirectory = Path.GetDirectoryName(projectPath) ?? ".";
27-
var godotPath = GetGodotExecutablePath();
2827

2928
// Build the arguments list
3029
var arguments = new List<string>
@@ -40,10 +39,9 @@ public static IResourceBuilder<ExecutableResource> AddGodot(
4039
// Create a standard ExecutableResource (since custom ones don't seem to work well)
4140
var godotResource = builder.AddExecutable(
4241
name: name,
43-
command: godotPath,
42+
command: "godot",
4443
workingDirectory: projectDirectory,
4544
args: arguments.ToArray());
46-
//.WithEnvironment("OTEL_EXPORTER_OTLP_ENDPOINT", Environment.GetEnvironmentVariable("OTEL_EXPORTER_OTLP_ENDPOINT") ?? throw new InvalidOperationException("OTEL_EXPORTER_OTLP_ENDPOINT environment variable is not set"));
4745

4846
// Add a lifecycle hook to handle building before startup
4947
builder.Services.AddSingleton<IDistributedApplicationEventingSubscriber>(sp =>
@@ -55,35 +53,6 @@ public static IResourceBuilder<ExecutableResource> AddGodot(
5553
return godotResource;
5654
}
5755

58-
/// <summary>
59-
/// Gets the Godot executable path based on the current platform.
60-
/// </summary>
61-
private static string GetGodotExecutablePath()
62-
{
63-
// First check for GODOT environment variable
64-
var godotPath = Environment.GetEnvironmentVariable("GODOT");
65-
if (!string.IsNullOrWhiteSpace(godotPath))
66-
{
67-
return godotPath;
68-
}
69-
70-
// Fallback to platform-specific defaults
71-
if (OperatingSystem.IsMacOS())
72-
{
73-
return "godot";
74-
}
75-
else if (OperatingSystem.IsWindows())
76-
{
77-
return "godot.exe";
78-
}
79-
else if (OperatingSystem.IsLinux())
80-
{
81-
return "godot";
82-
}
83-
84-
throw new PlatformNotSupportedException("Current platform is not supported for Godot execution.");
85-
}
86-
8756
private class GodotBuildEventSubscriber : IDistributedApplicationEventingSubscriber
8857
{
8958
private readonly string _projectPath;

tools/AppHost/Properties/launchSettings.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
"ASPNETCORE_ENVIRONMENT": "Development",
1111
"DOTNET_ENVIRONMENT": "Development",
1212
"DOTNET_DASHBOARD_OTLP_ENDPOINT_URL": "https://localhost:21295",
13-
"DOTNET_RESOURCE_SERVICE_ENDPOINT_URL": "https://localhost:22130",
14-
"GODOT": "C:/Users/Matthew/Documents/Godot/Path/godot.exe"
13+
"DOTNET_RESOURCE_SERVICE_ENDPOINT_URL": "https://localhost:22130"
1514
}
1615
}
1716
}

tools/AppHost/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
Running SharpIDE via the Aspire AppHost allows you to inspect the OTEL telemetry and logs
44

55
### Setup
6-
1. Replace `GODOT` environment variable with the path to your executable in launchSettings.json
6+
1. Download the latest godot (.NET) binary, and put it somewhere (e.g. Documents/Godot/Path)
7+
2. Rename e.g. Godot_v4.6.1-stable_mono_win64.exe to godot.exe
8+
3. Put the folder containing the godot executable on your PATH, and ensure it resolves from a shell
9+
4. Done - Aspire will launch godot via the executable on the PATH
710

811
TODO: Create better godot integration with aspire/wait for libgodot.

0 commit comments

Comments
 (0)