Add deploying game debug symbols for Windows builds

This commit is contained in:
Wojtek Figat
2024-12-06 11:37:01 +01:00
parent ca15318ade
commit a2087297e0
2 changed files with 28 additions and 0 deletions

View File

@@ -93,6 +93,22 @@ namespace Flax.Deploy
BuildPlatform(platform, architectures);
}
}
if (Platform.BuildTargetPlatform == TargetPlatform.Windows)
{
Log.Info("Compressing game debug symbols files...");
var gamePackageZipPath = Path.Combine(Deployer.PackageOutputPath, "GameDebugSymbols.zip");
Utilities.FileDelete(gamePackageZipPath);
using (var zip = new Ionic.Zip.ZipFile())
{
zip.AddDirectory(Path.Combine(Deployer.PackageOutputPath, "GameDebugSymbols"));
zip.CompressionLevel = Ionic.Zlib.CompressionLevel.BestCompression;
zip.Comment = string.Format("Flax Game {0}.{1}.{2}\nDate: {3}", Deployer.VersionMajor, Deployer.VersionMinor, Deployer.VersionBuild, DateTime.UtcNow);
zip.Save(gamePackageZipPath);
}
Log.Info("Compressed game debug symbols package size: " + Utilities.GetFileSize(gamePackageZipPath));
}
Utilities.DirectoryDelete(Path.Combine(Deployer.PackageOutputPath, "GameDebugSymbols"));
}
if (Configuration.DeployEditor)

View File

@@ -28,6 +28,18 @@ namespace Flax.Deploy
string dst = Path.Combine(Deployer.PackageOutputPath, platformName);
Utilities.DirectoryDelete(dst);
// Deploy debug files for crashes debugging
foreach (var configuration in new[] { TargetConfiguration.Debug, TargetConfiguration.Development, TargetConfiguration.Release })
{
if (platform == TargetPlatform.Windows)
{
var dstDebug = Path.Combine(Deployer.PackageOutputPath, $"GameDebugSymbols/{platform}/{configuration}");
Directory.CreateDirectory(dstDebug);
var binaries = Path.Combine(src, "Binaries", "Game", "x64", configuration.ToString());
DeployFiles(binaries, dstDebug, "*.pdb");
}
}
// Deploy files
{
DeployFolder(platformsRoot, Deployer.PackageOutputPath, platformName);