Fix deploying NuGet packages to include correct library file name

#3900
This commit is contained in:
Wojtek Figat
2026-01-22 19:57:16 +01:00
parent ecfd03f79c
commit 6dbfd25bdb
2 changed files with 41 additions and 8 deletions

View File

@@ -103,9 +103,22 @@ namespace Flax.Build.NativeCpp
Framework = framework;
}
internal string GetLibPath(string nugetPath)
internal string GetLibFolder(string nugetPath)
{
return Path.Combine(nugetPath, Name, Version, "lib", Framework, $"{Name}.dll");
return Path.Combine(nugetPath, Name, Version, "lib", Framework);
}
internal string GetLibPath(string nugetPath, string libFolder = null)
{
if (libFolder == null)
libFolder = GetLibFolder(nugetPath);
var dlls = Directory.GetFiles(libFolder, "*.dll", SearchOption.TopDirectoryOnly);
if (dlls.Length == 0)
{
Log.Error($"Missing NuGet package \"{Name}, {Version}, {Framework}\" binaries (folder: {libFolder})");
return string.Empty;
}
return dlls[0];
}
}