Add compile listener to create github annotations

This commit is contained in:
Andrew Kahr 2023-11-06 21:19:53 -08:00
parent b20286a361
commit 1d274c7d6d
2 changed files with 43 additions and 0 deletions

View File

@ -0,0 +1,32 @@
using UnityEngine;
using UnityEditor;
namespace UnityBuilderAction.Reporting
{
[InitializeOnLoad]
static class CompileListener
{
static CompileListener()
{
if (Application.isBatchMode)
{
Application.logMessageReceived += Application_logMessageReceived;
}
}
private static void Application_logMessageReceived(string condition, string stackTrace, LogType type)
{
string prefix = "";
switch (type)
{
case LogType.Error:
prefix = "error";
break;
case LogType.Warning:
prefix = "warning";
break;
}
Debug.Log($"::{prefix} ::{condition}\n{stackTrace}");
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: fad44373fb7b61a4bb584e2675795aca
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: