Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 39 additions & 27 deletions src/Fallout.Build/Host.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,46 +27,53 @@ protected Host()

internal virtual string OutputTemplate => Logging.TimestampOutputTemplate;

// True-color ANSI for Fallout yellow (#F5C800). Modern terminals
// (Windows Terminal, VS Code, macOS Terminal.app, GitHub Actions logs)
// render this directly; older sinks ignore the escape bytes.

protected virtual string LogoYellow { get => ""; }

protected virtual string LogoDimmed { get => ""; }

protected virtual string LogoReset { get => ""; }

protected internal void WriteLogo()
{
Debug();
// True-color ANSI for Fallout yellow (#F5C800). Modern terminals
// (Windows Terminal, VS Code, macOS Terminal.app, GitHub Actions logs)
// render this directly; older sinks ignore the escape bytes.
const string Y = "";
const string D = "";
const string R = "";

new[]
{
$"{Y}███████╗ █████╗ ██╗ ██╗ ██████╗ ██╗ ██╗████████╗{R}",
$"{Y}██╔════╝██╔══██╗██║ ██║ ██╔═══██╗██║ ██║╚══██╔══╝{R}",
$"{Y}█████╗ ███████║██║ ██║ ██║ ██║██║ ██║ ██║ {R}",
$"{Y}██╔══╝ ██╔══██║██║ ██║ ██║ ██║██║ ██║ ██║ {R}",
$"{Y}██║ ██║ ██║███████╗███████╗╚██████╔╝╚██████╔╝ ██║ {R}",
$"{Y}╚═╝ ╚═╝ ╚═╝╚══════╝╚══════╝ ╚═════╝ ╚═════╝ ╚═╝ {R}",
$"{LogoYellow}███████╗ █████╗ ██╗ ██╗ ██████╗ ██╗ ██╗████████╗{LogoReset}",
$"{LogoYellow}██╔════╝██╔══██╗██║ ██║ ██╔═══██╗██║ ██║╚══██╔══╝{LogoReset}",
$"{LogoYellow}█████╗ ███████║██║ ██║ ██║ ██║██║ ██║ ██║ {LogoReset}",
$"{LogoYellow}██╔══╝ ██╔══██║██║ ██║ ██║ ██║██║ ██║ ██║ {LogoReset}",
$"{LogoYellow}██║ ██║ ██║███████╗███████╗╚██████╔╝╚██████╔╝ ██║ {LogoReset}",
$"{LogoYellow}╚═╝ ╚═╝ ╚═╝╚══════╝╚══════╝ ╚═════╝ ╚═════╝ ╚═╝ {LogoReset}",
string.Empty,
$" {D}.NET build system{R}",
$" {Y}☢{R} {D}survived the NUKE{R}"
$" {LogoDimmed}.NET build system{LogoReset}",
$" {LogoYellow}☢{LogoReset} {LogoDimmed}survived the NUKE{LogoReset}"
}.ForEach(x => Debug(x.Replace(" ", " ")));

Debug();
}

protected internal virtual IDisposable WriteBlock(string text)
{
return DelegateDisposable.CreateBracket(
() =>
{
var formattedBlockText = text
.Split(new[] { EnvironmentInfo.NewLine }, StringSplitOptions.None)
.Select(Theme.FormatInformation);

Debug();
Debug("╬" + '═'.Repeat(text.Length + 5));
formattedBlockText.ForEach(x => Debug($"║ {x}"));
Debug("╬" + '═'.Repeat(Math.Max(text.Length - 4, 2)));
Debug();
});
return DelegateDisposable.CreateBracket(() =>
{
var formattedBlockText = text
.Split(new[]
{
EnvironmentInfo.NewLine
}, StringSplitOptions.None)
.Select(Theme.FormatInformation);

Debug();
Debug("╬" + '═'.Repeat(text.Length + 5));
formattedBlockText.ForEach(x => Debug($"║ {x}"));
Debug("╬" + '═'.Repeat(Math.Max(text.Length - 4, 2)));
Debug();
});
}

protected internal virtual void ReportWarning(string text, string details = null)
Expand Down Expand Up @@ -144,18 +151,23 @@ static string GetInformation(ExecutableTarget target)
case ExecutionStatus.Skipped:
Debug(line);
break;

case ExecutionStatus.Succeeded:
Success(line);
break;

case ExecutionStatus.Aborted:
case ExecutionStatus.NotRun:
Warning(line);
break;

case ExecutionStatus.Failed:
Error(line);
break;

case ExecutionStatus.Collective:
break;

default:
throw new NotSupportedException(target.Status.ToString());
}
Expand Down
5 changes: 4 additions & 1 deletion src/Fallout.Common/CI/GitLab/GitLab.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using Fallout.Common.Utilities;

namespace Fallout.Common.CI.GitLab;
Expand All @@ -19,6 +18,10 @@ public partial class GitLab : Host, IBuildServer
private const string SectionStartSequence = "\u001b[0K";
private const string SectionResetSequence = "\r\u001b[0K";

protected override string LogoYellow => "";

protected override string LogoDimmed => "";

private readonly Action<string> _messageSink;

internal GitLab()
Expand Down
Loading