Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
557bd4b
* Resolves #2103
PWagner1 Jul 29, 2025
e90e3cd
Merge branch 'alpha' into 2103-bugfeature-request-ensure-that-krypton…
PWagner1 Jul 29, 2025
aef90c0
* Correct logic
PWagner1 Jul 29, 2025
026672e
* Fix fallout
PWagner1 Jul 29, 2025
411f33e
* Fix missing properties
PWagner1 Aug 2, 2025
fde701e
* Control buttons
PWagner1 Aug 3, 2025
0fdb496
* Fix for 4 states
PWagner1 Aug 3, 2025
0e13ed6
* General fixes
PWagner1 Aug 3, 2025
3820203
Merge branch 'alpha' into 2103-bugfeature-request-ensure-that-krypton…
PWagner1 Aug 4, 2025
b390ea5
* Modifications
PWagner1 Aug 6, 2025
f3edd79
Merge branch 'alpha' into 2103-bugfeature-request-ensure-that-krypton…
PWagner1 Aug 7, 2025
c3fb842
Merge branch 'alpha' into 2103-bugfeature-request-ensure-that-krypton…
PWagner1 Aug 8, 2025
f531439
* More modifications
PWagner1 Aug 9, 2025
b5d3399
Merge branch 'alpha' into 2103-bugfeature-request-ensure-that-krypton…
PWagner1 Aug 10, 2025
d30f441
Merge branch 'alpha' into 2103-bugfeature-request-ensure-that-krypton…
PWagner1 Aug 11, 2025
f5b0bef
Merge branch 'alpha' into 2103-bugfeature-request-ensure-that-krypton…
PWagner1 Aug 12, 2025
21d4268
Merge branch 'alpha' into 2103-bugfeature-request-ensure-that-krypton…
PWagner1 Aug 13, 2025
a167cfc
Merge branch 'alpha' into 2103-bugfeature-request-ensure-that-krypton…
PWagner1 Aug 14, 2025
6870f15
Merge branch 'alpha' into 2103-bugfeature-request-ensure-that-krypton…
PWagner1 Aug 16, 2025
b739811
* TestApp modifications
PWagner1 Aug 16, 2025
86346f0
* Archive creation
PWagner1 Aug 16, 2025
a5137cc
* Update scripts
PWagner1 Aug 16, 2025
04ac2a0
Merge branch 'alpha' into 2103-bugfeature-request-ensure-that-krypton…
PWagner1 Aug 16, 2025
11ad251
Merge branch 'alpha' into 2103-bugfeature-request-ensure-that-krypton…
PWagner1 Aug 16, 2025
783d019
Merge branch 'alpha' into 2103-bugfeature-request-ensure-that-krypton…
PWagner1 Aug 16, 2025
0890f80
Update KryptonForm.cs
PWagner1 Aug 16, 2025
069b581
Merge branch 'alpha' into 2103-bugfeature-request-ensure-that-krypton…
PWagner1 Aug 17, 2025
47635eb
Merge branch 'alpha' into 2103-bugfeature-request-ensure-that-krypton…
PWagner1 Aug 18, 2025
b537804
Merge branch 'alpha' into 2103-bugfeature-request-ensure-that-krypton…
PWagner1 Aug 18, 2025
5b9292d
Merge branch 'alpha' into 2103-bugfeature-request-ensure-that-krypton…
PWagner1 Aug 21, 2025
50c664b
* Tests
PWagner1 Aug 21, 2025
007827c
Merge branch 'alpha' into 2103-bugfeature-request-ensure-that-krypton…
PWagner1 Aug 24, 2025
09a2a83
Merge branch 'alpha' into 2103-bugfeature-request-ensure-that-krypton…
PWagner1 Aug 27, 2025
fe4586a
Merge branch 'alpha' into 2103-bugfeature-request-ensure-that-krypton…
PWagner1 Aug 30, 2025
c29485b
Merge branch 'alpha' into 2103-bugfeature-request-ensure-that-krypton…
PWagner1 Sep 1, 2025
be77b3b
Merge branch 'alpha' into 2103-bugfeature-request-ensure-that-krypton…
PWagner1 Sep 5, 2025
cf4c109
* Commented out duplicate code (temporary)
PWagner1 Sep 5, 2025
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
134 changes: 67 additions & 67 deletions Documents/Changelog/Changelog.md

Large diffs are not rendered by default.

127 changes: 63 additions & 64 deletions Scripts/ModernBuild/classes/AppState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,86 +7,85 @@

using Krypton.Build;

namespace Krypton.Build
namespace Krypton.Build;

public sealed class AppState
{
public sealed class AppState
{
public ChannelType Channel { get; set; }
public BuildAction Action { get; set; }
public string Configuration { get; set; } = "Release";
public string RootPath { get; set; } = string.Empty;
public string MsBuildPath { get; set; } = string.Empty;
public ChannelType Channel { get; set; }
public BuildAction Action { get; set; }
public string Configuration { get; set; } = "Release";
public string RootPath { get; set; } = string.Empty;
public string MsBuildPath { get; set; } = string.Empty;

public string ProjectFile { get; set; } = string.Empty;
public string TextLogPath { get; set; } = string.Empty;
public string BinLogPath { get; set; } = string.Empty;
public string ProjectFile { get; set; } = string.Empty;
public string TextLogPath { get; set; } = string.Empty;
public string BinLogPath { get; set; } = string.Empty;

public TailBuffer Tail { get; } = new TailBuffer(200);
public int TailLines { get; set; }
public bool IsRunning { get; set; }
public int LastExitCode { get; set; }
public DateTime? StartTimeUtc { get; set; }
public int ErrorCount { get; set; }
public int WarningCount { get; set; }
public TailBuffer Tail { get; } = new TailBuffer(200);
public int TailLines { get; set; }
public bool IsRunning { get; set; }
public int LastExitCode { get; set; }
public DateTime? StartTimeUtc { get; set; }
public int ErrorCount { get; set; }
public int WarningCount { get; set; }

public bool SummaryReady { get; set; }
public IReadOnlyList<string>? SummaryLines { get; set; }
public int SummaryOffset { get; set; }
public bool SummaryReady { get; set; }
public IReadOnlyList<string>? SummaryLines { get; set; }
public int SummaryOffset { get; set; }

public Action<string>? OnOutput { get; set; }
public Process? Process { get; set; }
public Queue<string>? PendingTargets { get; set; }
public PackMode PackMode { get; set; } = PackMode.Pack;
public Action? RequestRenderAll { get; set; }
public bool AutoScroll { get; set; } = true;
public Action<string>? OnOutput { get; set; }
public Process? Process { get; set; }
public Queue<string>? PendingTargets { get; set; }
public PackMode PackMode { get; set; } = PackMode.Pack;
public Action? RequestRenderAll { get; set; }
public bool AutoScroll { get; set; } = true;

public Queue<string>? NuGetPushQueue { get; set; }
public TasksPage TasksPage { get; set; } = TasksPage.Ops;
public NuGetAction NuGetAction { get; set; } = NuGetAction.RebuildPack;
public NuGetSource NuGetSource { get; set; } = NuGetSource.Default;
public bool NuGetCreateZip { get; set; }
public string NuGetCustomSource { get; set; } = string.Empty;
public bool NuGetIncludeSymbols { get; set; }
public string? NuGetLastZipPath { get; set; }
public bool NuGetRunPushAfterMsBuild { get; set; }
public bool NuGetRunZipAfterMsBuild { get; set; }
public bool NuGetSkipDuplicate { get; set; } = true;
public string? LastCompletedTarget { get; set; }
}
public Queue<string>? NuGetPushQueue { get; set; }
public TasksPage TasksPage { get; set; } = TasksPage.Ops;
public NuGetAction NuGetAction { get; set; } = NuGetAction.RebuildPack;
public NuGetSource NuGetSource { get; set; } = NuGetSource.Default;
public bool NuGetCreateZip { get; set; }
public string NuGetCustomSource { get; set; } = string.Empty;
public bool NuGetIncludeSymbols { get; set; }
public string? NuGetLastZipPath { get; set; }
public bool NuGetRunPushAfterMsBuild { get; set; }
public bool NuGetRunZipAfterMsBuild { get; set; }
public bool NuGetSkipDuplicate { get; set; } = true;
public string? LastCompletedTarget { get; set; }
}

public sealed class TailBuffer
public sealed class TailBuffer
{
private int capacity;
private readonly LinkedList<string> lines = new LinkedList<string>();
private readonly object sync = new object();

public TailBuffer(int capacity)
{
private int capacity;
private readonly LinkedList<string> lines = new LinkedList<string>();
private readonly object sync = new object();
this.capacity = capacity;
}

public TailBuffer(int capacity)
public void SetCapacity(int newCapacity)
{
if (newCapacity <= 0)
{
this.capacity = capacity;
return;
}

public void SetCapacity(int newCapacity)
lock (sync)
{
if (newCapacity <= 0)
{
return;
}
lock (sync)
capacity = newCapacity;
while (lines.Count > capacity)
{
capacity = newCapacity;
while (lines.Count > capacity)
{
lines.RemoveFirst();
}
lines.RemoveFirst();
}
}
}

public void Clear()
public void Clear()
{
lock (sync)
{
lock (sync)
{
lines.Clear();
}
lines.Clear();
}
}
}
}
83 changes: 41 additions & 42 deletions Scripts/ModernBuild/enums/enumerations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,52 +5,51 @@
*/
#endregion

namespace Krypton.Build
namespace Krypton.Build;

public enum ChannelType
{
public enum ChannelType
{
Nightly,
Canary,
Stable }
Nightly,
Canary,
Stable }

public enum BuildAction
{
Build,
Rebuild,
Pack,
BuildPack,
Debug,
NuGetTools,
Installer
}
public enum BuildAction
{
Build,
Rebuild,
Pack,
BuildPack,
Debug,
NuGetTools,
Installer
}

public enum PackMode
{
Pack,
PackLite,
PackAll
}
public enum PackMode
{
Pack,
PackLite,
PackAll
}

public enum TasksPage
{
Ops,
NuGet
}
public enum TasksPage
{
Ops,
NuGet
}

public enum NuGetAction
{
RebuildPack,
Push,
PackPush,
BuildPackPush,
Tools
}
public enum NuGetAction
{
RebuildPack,
Push,
PackPush,
BuildPackPush,
Tools
}

public enum NuGetSource
{
Default,
NuGetOrg,
GitHub,
Custom
}
public enum NuGetSource
{
Default,
NuGetOrg,
GitHub,
Custom
}
51 changes: 51 additions & 0 deletions Scripts/build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<PropertyGroup>
<RootFolder>$(MSBuildProjectDirectory)</RootFolder>
<Configuration>Release</Configuration>
<ReleaseBuildPath>..\Bin\Release\Zips</ReleaseBuildPath>
<ReleaseZipName>Krypton-Release</ReleaseZipName>
</PropertyGroup>

<Target Name="Clean">
Expand Down Expand Up @@ -74,4 +76,53 @@
</ItemGroup>
<Exec Command="nuget.exe push %(NugetPkgs.Identity)" />
</Target>

<Target Name="CreateReleaseZip">
<PropertyGroup>
<StringDate>$([System.DateTime]::Now.ToString('yyyyMMdd'))</StringDate>
</PropertyGroup>
<ItemGroup>
<DebugApplicationFiles Include="..\Bin\Release\**\*.*" Exclude="..\Bin\Release\*vshost.exe*;..\Bin\Release\**\*.json;..\Bin\Release\**\*.pdb" />
</ItemGroup>
<MakeDir Directories="$(ReleaseBuildPath)"/>

<!-- Using 7-Zip for ZIP creation (compatible with all MSBuild versions) -->
<Exec Command="7z.exe a -tzip &quot;$(ReleaseBuildPath)\$(ReleaseZipName)_$(StringDate).zip&quot; &quot;..\Bin\Release\*&quot; -x!*.json -x!*.pdb"
Condition="Exists('C:\Program Files\7-Zip\7z.exe')"
WorkingDirectory="$(ReleaseBuildPath)" />

<!-- Fallback: Using PowerShell Compress-Archive if 7-Zip not available -->
<Exec Command="powershell.exe -Command &quot;Get-ChildItem '..\Bin\Release\*' -Recurse | Where-Object {$_.Extension -notin '.json','.pdb'} | Compress-Archive -DestinationPath '$(ReleaseBuildPath)\$(ReleaseZipName)_$(StringDate).zip' -Force&quot;"
Condition="!Exists('C:\Program Files\7z.exe')" />
</Target>

<Target Name="CreateReleaseTar">
<PropertyGroup>
<StringDate>$([System.DateTime]::Now.ToString('yyyyMMdd'))</StringDate>
</PropertyGroup>
<ItemGroup>
<DebugApplicationFiles Include="..\Bin\Release\**\*.*" Exclude="..\Bin\Release\*vshost.exe*;..\Bin\Release\**\*.json;..\Bin\Release\**\*.pdb" />
</ItemGroup>
<MakeDir Directories="$(ReleaseBuildPath)"/>

<!-- Method 1: Using 7-Zip if available (recommended for Windows) -->
<Exec Command="7z.exe a -ttar &quot;$(ReleaseBuildPath)\$(ReleaseZipName)_$(StringDate).tar&quot; &quot;..\Bin\Release\*&quot; -x!*.json -x!*.pdb"
Condition="Exists('C:\Program Files\7-Zip\7z.exe')"
WorkingDirectory="$(ReleaseBuildPath)" />
<Exec Command="7z.exe a -tgzip &quot;$(ReleaseBuildPath)\$(ReleaseZipName)_$(StringDate).tar.gz&quot; &quot;$(ReleaseBuildPath)\$(ReleaseZipName)_$(StringDate).tar&quot;"
Condition="Exists('C:\Program Files\7-Zip\7z.exe')"
WorkingDirectory="$(ReleaseBuildPath)" />
<Delete Files="$(ReleaseBuildPath)\$(ReleaseZipName)_$(StringDate).tar"
Condition="Exists('C:\Program Files\7-Zip\7z.exe')" />

<!-- Method 2: Using PowerShell tar command (Windows 10/11) -->
<Exec Command="powershell.exe -Command tar -czf &quot;$(ReleaseBuildPath)\$(ReleaseZipName)_$(StringDate)_ps.tar.gz&quot; -C &quot;..\Bin\Release&quot; . --exclude=*.json --exclude=*.pdb"
Condition="Exists('C:\Windows\System32\tar.exe')" />

<!-- Method 3: Using Git Bash tar if available -->
<Exec Command="&quot;C:\Program Files\Git\bin\bash.exe&quot; -c &quot;cd ../Bin/Release &amp;&amp; tar -czf &quot;$(ReleaseBuildPath)/$(ReleaseZipName)_$(StringDate)_git.tar.gz&quot; * --exclude=*.json --exclude=*.pdb&quot;"
Condition="Exists('C:\Program Files\Git\bin\bash.exe')" />
</Target>

<Target Name="CreateAllReleaseArchives" DependsOnTargets="CreateReleaseZip;CreateReleaseTar" />
</Project>
53 changes: 46 additions & 7 deletions Scripts/canary.proj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<PropertyGroup>
<RootFolder>$(MSBuildProjectDirectory)</RootFolder>
<Configuration>Canary</Configuration>
<CanaryBuildPath>..\Bin\Canary\Zips</CanaryBuildPath>
<CanaryZipName>Krypton-Canary</CanaryZipName>
</PropertyGroup>

<Target Name="Clean">
Expand Down Expand Up @@ -59,17 +61,54 @@
<Exec Command="nuget.exe push %(NugetPkgs.Identity)" />
</Target>

<Target Name="CreateNightlyZip">


<Target Name="CreateCanaryZip">
<PropertyGroup>
<StringDate>$([System.DateTime]::Now.ToString('yyyyMMdd'))</StringDate>
</PropertyGroup>
<ItemGroup>
<DebugApplicationFiles Include="..\Bin\Canary\**\*.*" Exclude="..\Bin\Canary\*vshost.exe*;..\Bin\Canary\**\*.json;..\Bin\Canary\**\*.pdb" />
</ItemGroup>
<MakeDir Directories="$(CanaryBuildPath)"/>

<!-- Using 7-Zip for ZIP creation (compatible with all MSBuild versions) -->
<Exec Command="7z.exe a -tzip &quot;$(CanaryBuildPath)\$(CanaryZipName)_$(StringDate).zip&quot; &quot;..\Bin\Canary\*&quot; -x!*.json -x!*.pdb"
Condition="Exists('C:\Program Files\7-Zip\7z.exe')"
WorkingDirectory="$(CanaryBuildPath)" />

<!-- Fallback: Using PowerShell Compress-Archive if 7-Zip not available -->
<Exec Command="powershell.exe -Command &quot;Get-ChildItem '..\Bin\Canary\*' -Recurse | Where-Object {$_.Extension -notin '.json','.pdb'} | Compress-Archive -DestinationPath '$(CanaryBuildPath)\$(CanaryZipName)_$(StringDate).zip' -Force&quot;"
Condition="!Exists('C:\Program Files\7z.exe')" />
</Target>

<Target Name="CreateCanaryTar">
<PropertyGroup>
<StringDate>$([System.DateTime]::Now.ToString('yyyyMMdd'))</StringDate>
</PropertyGroup>
<ItemGroup>
<DebugApplicationFiles Include="..\Bin\Canary\**\*.*" Exclude="..\Bin\Canary\*vshost.exe*" />
<DebugApplicationFiles Include="..\Bin\Canary\**\*.*" Exclude="..\Bin\Canary\*vshost.exe*;..\Bin\Canary\**\*.json;..\Bin\Canary\**\*.pdb" />
</ItemGroup>
<MakeDir Directories="$(NightlyBuildPath)"/>
<Zip Files="@(DebugApplicationFiles)"
WorkingDirectory="..\Bin\Canary"
ZipFileName="$(NightlyBuildPath)\$(StringDate)_$(NightlyZipName).zip"
ZipLevel="9" />
<MakeDir Directories="$(CanaryBuildPath)"/>

<!-- Method 1: Using 7-Zip if available (recommended for Windows) -->
<Exec Command="7z.exe a -ttar &quot;$(CanaryBuildPath)\$(CanaryZipName)_$(StringDate).tar&quot; &quot;..\Bin\Canary\*&quot; -x!*.json -x!*.pdb"
Condition="Exists('C:\Program Files\7-Zip\7z.exe')"
WorkingDirectory="$(CanaryBuildPath)" />
<Exec Command="7z.exe a -tgzip &quot;$(CanaryBuildPath)\$(CanaryZipName)_$(StringDate).tar.gz&quot; &quot;$(CanaryBuildPath)\$(CanaryZipName)_$(StringDate).tar&quot;"
Condition="Exists('C:\Program Files\7-Zip\7z.exe')"
WorkingDirectory="$(CanaryBuildPath)" />
<Delete Files="$(CanaryBuildPath)\$(CanaryZipName)_$(StringDate).tar"
Condition="Exists('C:\Program Files\7-Zip\7z.exe')" />

<!-- Method 2: Using PowerShell tar command (Windows 10/11) -->
<Exec Command="powershell.exe -Command tar -czf &quot;$(CanaryBuildPath)\$(CanaryZipName)_$(StringDate)_ps.tar.gz&quot; -C &quot;..\Bin\Canary&quot; . --exclude=*.json --exclude=*.pdb"
Condition="Exists('C:\Windows\System32\tar.exe')" />

<!-- Method 3: Using Git Bash tar if available -->
<Exec Command="&quot;C:\Program Files\Git\bin\bash.exe&quot; -c &quot;cd ../Bin/Canary &amp;&amp; tar -czf &quot;$(CanaryBuildPath)/$(CanaryZipName)_$(StringDate)_git.tar.gz&quot; * --exclude=*.json --exclude=*.pdb&quot;"
Condition="Exists('C:\Program Files\Git\bin\bash.exe')" />
</Target>

<Target Name="CreateAllCanaryArchives" DependsOnTargets="CreateCanaryZip;CreateCanaryTar" />
</Project>
Loading