Skip to content

Commit

Permalink
Fixes uploading debug symbols for Mono backend
Browse files Browse the repository at this point in the history
  • Loading branch information
demelev committed Feb 26, 2024
1 parent 3debb26 commit 0807f82
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/Sentry.Unity.Editor/Native/BuildPostProcess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ public static void OnPostProcessBuild(BuildTarget target, string executablePath)
var logger = options?.DiagnosticLogger ?? new UnityLogger(options ?? new SentryUnityOptions());
var isMono = PlayerSettings.GetScriptingBackend(targetGroup) == ScriptingImplementation.Mono2x;

var buildOutputDir = Path.GetDirectoryName(executablePath);
var executableName = Path.GetFileName(executablePath);

try
{
if (options is null)
Expand All @@ -38,22 +41,23 @@ public static void OnPostProcessBuild(BuildTarget target, string executablePath)

if (!options.IsValid())
{
logger.LogDebug("Native support disabled.");
logger.LogDebug("Sentry is disabled, no need in native support.");
return;
}

if (cliOptions?.UploadSymbols is true)
{
UploadDebugSymbols(logger, target, buildOutputDir, executableName, options, cliOptions, isMono);
}

if (!IsEnabledForPlatform(target, options))
{
logger.LogDebug("Native support for the current platform is disabled in the configuration.");
return;
}

logger.LogDebug("Adding native support.");

var buildOutputDir = Path.GetDirectoryName(executablePath);
var executableName = Path.GetFileName(executablePath);
AddCrashHandler(logger, target, buildOutputDir, executableName);
UploadDebugSymbols(logger, target, buildOutputDir, executableName, options, cliOptions, isMono);
}
catch (Exception e)
{
Expand Down

0 comments on commit 0807f82

Please sign in to comment.