Skip to content

Commit 758f5bf

Browse files
committed
* General code cleanup
1 parent 2aa4993 commit 758f5bf

File tree

12 files changed

+4007
-3854
lines changed

12 files changed

+4007
-3854
lines changed
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
#region BSD License
2+
/*
3+
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
4+
* Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac & Ahmed Abdelhameed, tobitege et al. 2025 - 2025. All rights reserved.
5+
*/
6+
#endregion
7+
8+
namespace Krypton.Build;
9+
10+
public sealed class AppState
11+
{
12+
public ChannelType Channel { get; set; }
13+
public BuildAction Action { get; set; }
14+
public string Configuration { get; set; } = "Release";
15+
public string RootPath { get; set; } = string.Empty;
16+
public string MsBuildPath { get; set; } = string.Empty;
17+
18+
public string ProjectFile { get; set; } = string.Empty;
19+
public string TextLogPath { get; set; } = string.Empty;
20+
public string BinLogPath { get; set; } = string.Empty;
21+
22+
public TailBuffer Tail { get; } = new TailBuffer(200);
23+
public int TailLines { get; set; }
24+
public bool IsRunning { get; set; }
25+
public int LastExitCode { get; set; }
26+
public DateTime? StartTimeUtc { get; set; }
27+
public int ErrorCount { get; set; }
28+
public int WarningCount { get; set; }
29+
30+
public bool SummaryReady { get; set; }
31+
public IReadOnlyList<string>? SummaryLines { get; set; }
32+
public int SummaryOffset { get; set; }
33+
34+
public Action<string>? OnOutput { get; set; }
35+
public Process? Process { get; set; }
36+
public Queue<string>? PendingTargets { get; set; }
37+
public PackMode PackMode { get; set; } = PackMode.Pack;
38+
public Action? RequestRenderAll { get; set; }
39+
public bool AutoScroll { get; set; } = true;
40+
41+
public Queue<string>? NuGetPushQueue { get; set; }
42+
public TasksPage TasksPage { get; set; } = TasksPage.Ops;
43+
public NuGetAction NuGetAction { get; set; } = NuGetAction.RebuildPack;
44+
public NuGetSource NuGetSource { get; set; } = NuGetSource.Default;
45+
public bool NuGetCreateZip { get; set; }
46+
public string NuGetCustomSource { get; set; } = string.Empty;
47+
public bool NuGetIncludeSymbols { get; set; }
48+
public string? NuGetLastZipPath { get; set; }
49+
public bool NuGetRunPushAfterMsBuild { get; set; }
50+
public bool NuGetRunZipAfterMsBuild { get; set; }
51+
public bool NuGetSkipDuplicate { get; set; } = true;
52+
public string? LastCompletedTarget { get; set; }
53+
}
54+
55+
public sealed class TailBuffer
56+
{
57+
private int capacity;
58+
private readonly LinkedList<string> lines = new LinkedList<string>();
59+
private readonly object sync = new object();
60+
61+
public TailBuffer(int capacity)
62+
{
63+
this.capacity = capacity;
64+
}
65+
66+
public void SetCapacity(int newCapacity)
67+
{
68+
if (newCapacity <= 0)
69+
{
70+
return;
71+
}
72+
lock (sync)
73+
{
74+
capacity = newCapacity;
75+
while (lines.Count > capacity)
76+
{
77+
lines.RemoveFirst();
78+
}
79+
}
80+
}
81+
82+
public void Clear()
83+
{
84+
lock (sync)
85+
{
86+
lines.Clear();
87+
}
88+
}
89+
}
File renamed without changes.
File renamed without changes.
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#region BSD License
2+
/*
3+
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
4+
* Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), tobitege et al. 2025 - 2025. All rights reserved.
5+
*/
6+
#endregion
7+
8+
namespace Krypton.Build;
9+
10+
public enum ChannelType
11+
{
12+
Nightly,
13+
Canary,
14+
Stable
15+
}
16+
17+
public enum BuildAction
18+
{
19+
Build,
20+
Rebuild,
21+
Pack,
22+
BuildPack,
23+
Debug,
24+
NuGetTools,
25+
Installer
26+
}
27+
28+
public enum PackMode
29+
{
30+
Pack,
31+
PackLite,
32+
PackAll
33+
}
34+
35+
public enum TasksPage
36+
{
37+
Ops,
38+
NuGet
39+
}
40+
41+
public enum NuGetAction
42+
{
43+
RebuildPack,
44+
Push,
45+
PackPush,
46+
BuildPackPush,
47+
Tools
48+
}
49+
50+
public enum NuGetSource
51+
{
52+
Default,
53+
NuGetOrg,
54+
GitHub,
55+
Custom
56+
}
File renamed without changes.

Scripts/ModernBuild/classes/AppState.cs

Lines changed: 0 additions & 92 deletions
This file was deleted.

Scripts/ModernBuild/enums/enumerations.cs

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)