mirror of
https://github.com/game-ci/unity-builder.git
synced 2025-07-04 12:25:19 -04:00

* Refactor to typescript (config part) * Refactor to typescript (convert extensions, minor fixes) * Refactor to typescript (move from `action` to `dist`) * Re-enable integrity-check for dist index.js * Fix all tests and lints * fix parsing major versions * Test patch level to be digits only * debug * debug * uncache * manual compile * debug * debug * Debug * Build lib - doh * remove diff check * Make kubernetes workflow manual * Properly generate 3 digit for simple major tags * Remove ts-ignore * re-enable cache
51 lines
1.3 KiB
C#
51 lines
1.3 KiB
C#
using System;
|
|
using UnityEditor;
|
|
using UnityEditor.Build.Reporting;
|
|
|
|
namespace UnityBuilderAction.Reporting
|
|
{
|
|
public class StdOutReporter
|
|
{
|
|
static string EOL = Environment.NewLine;
|
|
|
|
public static void ReportSummary(BuildSummary summary)
|
|
{
|
|
Console.WriteLine(
|
|
$"{EOL}" +
|
|
$"###########################{EOL}" +
|
|
$"# Build results #{EOL}" +
|
|
$"###########################{EOL}" +
|
|
$"{EOL}" +
|
|
$"Duration: {summary.totalTime.ToString()}{EOL}" +
|
|
$"Warnings: {summary.totalWarnings.ToString()}{EOL}" +
|
|
$"Errors: {summary.totalErrors.ToString()}{EOL}" +
|
|
$"Size: {summary.totalSize.ToString()} bytes{EOL}" +
|
|
$"{EOL}"
|
|
);
|
|
}
|
|
|
|
public static void ExitWithResult(BuildResult result)
|
|
{
|
|
if (result == BuildResult.Succeeded) {
|
|
Console.WriteLine("Build succeeded!");
|
|
EditorApplication.Exit(0);
|
|
}
|
|
|
|
if (result == BuildResult.Failed) {
|
|
Console.WriteLine("Build failed!");
|
|
EditorApplication.Exit(101);
|
|
}
|
|
|
|
if (result == BuildResult.Cancelled) {
|
|
Console.WriteLine("Build cancelled!");
|
|
EditorApplication.Exit(102);
|
|
}
|
|
|
|
if (result == BuildResult.Unknown) {
|
|
Console.WriteLine("Build result is unknown!");
|
|
EditorApplication.Exit(103);
|
|
}
|
|
}
|
|
}
|
|
}
|