Skip to content

Commit

Permalink
fix: Get correct PackageCompiler.SdkDirectory for all platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
Jklawreszuk committed May 25, 2024
1 parent 081bafb commit 47b4afb
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions sources/assets/Stride.Core.Assets/Compiler/PackageCompiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@ public class PackageCompiler : IPackageCompiler
static PackageCompiler()
{
// Compute StrideSdkDir from this assembly
// TODO Move this code to a reusable method
var codeBase = typeof(PackageCompiler).Assembly.Location;
var uri = new UriBuilder(codeBase);
var path = Path.GetDirectoryName(Uri.UnescapeDataString(uri.Path));
SdkDirectory = Path.GetFullPath(Path.Combine(path, @"..\.."));
// from ../bin/Debug/net{version} -> ../bin
SdkDirectory = Directory.GetParent(codeBase)?.Parent?.Parent?.FullName ?? "";
}

/// <summary>
Expand Down

0 comments on commit 47b4afb

Please sign in to comment.