From a516f09cf5760d0080986536422577c937894908 Mon Sep 17 00:00:00 2001 From: antopilo Date: Fri, 4 Apr 2025 17:21:08 -0400 Subject: [PATCH] Added generator to work with prebuild steps --- NuakeNetGenerator/Source/Generator.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/NuakeNetGenerator/Source/Generator.cs b/NuakeNetGenerator/Source/Generator.cs index 01c7329d..9b3d49eb 100644 --- a/NuakeNetGenerator/Source/Generator.cs +++ b/NuakeNetGenerator/Source/Generator.cs @@ -125,7 +125,9 @@ class Generator static void Main() { // Read file bindings.json - string json = File.ReadAllText("../../../../Editor/Build/Debug/Binaries/bindings.json"); + string fullPath = Path.Combine(AppContext.BaseDirectory, "../../../../Editor/Build/Debug/Binaries/bindings.json"); + Console.WriteLine(fullPath); + string json = File.ReadAllText(fullPath); // parse the json Bindings bindings = System.Text.Json.JsonSerializer.Deserialize(json); @@ -159,7 +161,8 @@ class Generator // WriteFiles foreach (var module in filesToWrite) { - string filePath = Path.Combine("../../../../NuakeNet/Source/Generated", module.FileName); + string fullfilePath = Path.Combine(AppContext.BaseDirectory, "../../../../NuakeNet/Source/Generated"); + string filePath = Path.Combine(fullfilePath, module.FileName); File.WriteAllText(filePath, module.Content); Console.WriteLine($"Wrote {module.FileName} to {filePath}"); }