Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
4be6553
📝 Chore(Submodules): Sync.
Dynesshely Mar 31, 2024
968f8d6
📝 Chore(Submodules): Sync
Dynesshely Apr 7, 2024
faafe0e
📄 Docs(README): Overseas link support
Dynesshely Apr 16, 2024
803c2ad
📝 Chore(cheese): Adapt to new cheese script engine
Dynesshely Jun 21, 2024
26eceee
💾 Feat: Try dotnet source generator
Dynesshely Jun 21, 2024
2654a0a
📝 Chore(Submodules): Sync
Dynesshely Jun 21, 2024
f132306
📝 Chore: Better publish script
Dynesshely Jun 26, 2024
75ebf40
📝 Chore(ReSharper): Dictionary
Dynesshely Jun 26, 2024
601f75b
📝 Chore(i18n): Available to execute XamlMLE through cheese
Dynesshely Jun 26, 2024
58f2694
📝 Chore: Sync `KitX SDK` and other submodules
Dynesshely Sep 9, 2024
3d81b0d
📝 Chore: Sync submodules
Dynesshely Sep 9, 2024
a1a3e31
💾 Feat(Publisher): Available to ignore `.packignore` file when it not…
Dynesshely Sep 28, 2024
db5a04a
📝 Chore: Better cheese scripts support
Dynesshely Sep 28, 2024
7d3996a
📝 Chore: Updated
Dynesshely Sep 28, 2024
0fc6689
📝 Chore: Sync
Dynesshely Sep 29, 2024
b51a662
📝 Chore: Added <NoWarns>, but it seems not took effect
Dynesshely Dec 30, 2024
8d7e9b2
📝 Chore: Updated NuGet packages
Dynesshely Dec 30, 2024
1225dae
📝 Chore: Sync submodules
Dynesshely Dec 30, 2024
cce76ce
📄 Docs: Better versions list
Dynesshely Dec 30, 2024
362b947
📄 Docs: Updated target version
Dynesshely Jan 1, 2025
5564e7b
💾 🎇 Feat, Style(Dashboard): All-round optimization
Dynesshely Jan 9, 2025
ebbd7b0
📝 Chore: Adapt to vscode stand-alone development
Dynesshely Feb 15, 2025
3c6c7d9
📝 Chore(vscode-workspace): Auto refresh git repositories
Dynesshely Feb 15, 2025
8c80cee
📝 Chore(formatter): Turn to csharpier
Dynesshely Feb 15, 2025
c3cd395
📝 Chore(vscode-workspace): Sync default formatter
Dynesshely Feb 15, 2025
52ce53a
📝 Chore(UDE): Better format options
Dynesshely Feb 15, 2025
5fdd192
📝 Chore(dotnet): Migrate to `.slnx` format solution file
Dynesshely Feb 18, 2025
69f114b
📝 Chore(dotnet): Make vscode to open `KitX.slnx` at startup
Dynesshely Feb 20, 2025
619b1a2
📝 Chore(Submodules): Sync
Dynesshely Apr 2, 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
16 changes: 16 additions & 0 deletions .cheese/KitX.Cheese.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<PropertyGroup>
<NoWarn>CS8802</NoWarn>
<NoWarn>CS0246</NoWarn>
<NoWarn>CS0103</NoWarn>
<NoWarn>CS0136</NoWarn>
</PropertyGroup>

</Project>
58 changes: 58 additions & 0 deletions .cheese/references.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
return new List<ReferenceItem>()
{
new ReferenceItem
{
Name = "Common.Activity",
Location = "Reference/Common.Activity",
Url = "[email protected]:Crequency/Common.Activity.git",
Branch = "dev=main",
RemoteBranch = "origin/dev=main",
Type = ReferenceType.GitRepo,
},
new ReferenceItem
{
Name = "Common.Algorithm",
Location = "Reference/Common.Algorithm",
Url = "[email protected]:Crequency/Common.Algorithm.git",
Branch = "dev=main",
RemoteBranch = "origin/dev=main",
Type = ReferenceType.GitRepo,
},
new ReferenceItem
{
Name = "Common.BasicHelper",
Location = "Reference/Common.BasicHelper",
Url = "[email protected]:Crequency/Common.BasicHelper.git",
Branch = "dev=main",
RemoteBranch = "origin/dev=main",
Type = ReferenceType.GitRepo,
},
new ReferenceItem
{
Name = "Common.Update",
Location = "Reference/Common.Update",
Url = "[email protected]:Crequency/Common.Update.git",
Branch = "dev=main",
RemoteBranch = "origin/dev=main",
Type = ReferenceType.GitRepo,
},
new ReferenceItem
{
Name = "Csharpell",
Location = "Reference/Csharpell",
Url = "[email protected]:Dynesshely/Csharpell.git",
Branch = "dev=main",
RemoteBranch = "origin/dev=main",
Type = ReferenceType.GitRepo,
},
new ReferenceItem
{
Name = "XamlMultiLanguageEditor",
Location = "KitX SDK/Reference/XamlMultiLanguageEditor",
Url = "[email protected]:Dynesshely/XamlMultiLanguageEditor.git",
Branch = "dev=main",
RemoteBranch = "origin/dev=main",
Type = ReferenceType.GitRepo,
InSubmodule = true,
},
};
56 changes: 0 additions & 56 deletions .cheese/references.json

This file was deleted.

11 changes: 11 additions & 0 deletions .cheese/scripts/dev-maintainers/clean-root.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System;
using System.IO;
using System.Threading;

while (true)
{
if (Directory.Exists("Config"))
Directory.Delete("Config", true);

Thread.Sleep(5000);
}
46 changes: 46 additions & 0 deletions .cheese/scripts/i18n.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
using System.Diagnostics;
using Common.BasicHelper.Core.Shell;
using Common.BasicHelper.Utils.Extensions;
using Spectre.Console;

var utilsToLaunch = AnsiConsole.Prompt(
new MultiSelectionPrompt<string>()
.Title("Which [green]i18n utils[/] are to be launched ?")
.NotRequired()
.PageSize(10)
.MoreChoicesText("[grey](Move up and down to reveal more utils)[/]")
.InstructionsText("[grey](Press [blue]<space>[/] to toggle a i18n util, [green]<enter>[/] to accept)[/]")
.AddChoices(
new[] {
"KitX Dashboard (XamlMLE)"
}
)
);

var baseDir = PathHelper.Instance.BaseSlnDir;

foreach (var util in utilsToLaunch)
{
AnsiConsole.MarkupLine($"@ Launching {util}");

switch (util)
{
case "KitX Dashboard (XamlMLE)":
var xamlMleDir = $"{baseDir}/KitX SDK/Reference/XamlMultiLanguageEditor".GetFullPath();
var scriptPath = $"{xamlMleDir}/run.ps1".GetFullPath();

var args = new StringBuilder()
.Append($" -WorkingDirectory \"{xamlMleDir}\"")
.Append($" -Command \"& '{scriptPath}'\"")
.ToString()
;

Console.WriteLine(args);

var result = "pwsh".ExecuteAsCommand(args: args, findInPath: true);

Console.WriteLine(result);

break;
}
}
163 changes: 163 additions & 0 deletions .cheese/scripts/publish.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
using System.Diagnostics;
using System.IO.Compression;
using System.Text.Json;
using Common.BasicHelper.Utils.Extensions;
using Spectre.Console;

AnsiConsole.Write(new FigletText("KitX Publisher").Centered().Color(Color.Blue));

PathHelper.Instance.AssertInSlnDirectory(out _);

var baseDir = PathHelper.Instance.BaseSlnDir;

var publishDir = $"{baseDir}/KitX Publish".GetFullPath();

if (Directory.Exists(publishDir))
foreach (var dir in new DirectoryInfo(publishDir).GetDirectories())
Directory.Delete(dir.FullName, true);

const string pro = "Properties/";
const string pub = "PublishProfiles/";

var path = $"{baseDir}/KitX Clients/KitX Dashboard/KitX Dashboard/".GetFullPath();
var abPubPath = $"{path}{pro}{pub}".GetFullPath();
var files = Directory.GetFiles(abPubPath, "*.pubxml", SearchOption.AllDirectories);

var logsDir = $"{publishDir}/logs".GetFullPath();
var log = $"{logsDir}/log-{DateTime.Now:yyyy-MM-dd-HH-mm-ss}.log".GetFullPath();
if (!Directory.Exists(logsDir))
Directory.CreateDirectory(logsDir);

var packIgnore = $"{publishDir}/.packignore".GetFullPath();
var packIgnoreExists = File.Exists(packIgnore);

var finishedThreads = 0;
var executingThreadIndex = 0;

const string prompt = "[white]>>>[/]";

AnsiConsole
.Progress()
.Columns(
new ProgressColumn[]
{
new TaskDescriptionColumn(),
new ProgressBarColumn(),
new PercentageColumn(),
new SpinnerColumn(),
}
)
.Start(ctx =>
{
var genTask = ctx.AddTask("[green]Publishing[/]");
var packTask = ctx.AddTask("[blue]Packing[/]");

{
AnsiConsole.Write(new Rule($"[blue]Begin Generating[/]"));

AnsiConsole.MarkupLine($"{prompt} Found {files.Length} profiles");
AnsiConsole.Markup(
$"{prompt} Generating logs at: \"{Path.GetRelativePath(baseDir, log)}\""
);
AnsiConsole.WriteLine();

packTask.IsIndeterminate = true;

foreach (var item in files)
{
var index = executingThreadIndex++;
var filename = Path.GetFileName(item);
const string cmd = "dotnet";
var arg = new StringBuilder()
.Append("publish ")
.Append($"\"{(path + "/KitX.Dashboard.csproj").GetFullPath()}\" ")
.Append($"\"/p:PublishProfile={item}\"")
.ToString();

AnsiConsole.MarkupLine($"{prompt} 📄 [white]{filename}[/]: [gray]{cmd} {arg}[/]");

var process = new Process();
var psi = new ProcessStartInfo()
{
FileName = cmd,
Arguments = arg,
UseShellExecute = false,
CreateNoWindow = true,
RedirectStandardOutput = true,
RedirectStandardError = true,
};
process.StartInfo = psi;
process.Start();

while (!process.StandardOutput.EndOfStream)
{
var line = process.StandardOutput.ReadLine();

File.AppendAllText(log, Environment.NewLine + line);
}

process.WaitForExit();

++finishedThreads;

genTask.Increment((1.0 / files.Length) * 100);

AnsiConsole.MarkupLine(
$"{prompt} Finished task_{index}, still {files.Length - finishedThreads} tasks waiting"
);

AnsiConsole.Write(new Rule($"[red]Finished task-{index}[/]"));
}

AnsiConsole.MarkupLine($"{prompt} All tasks done.");

genTask.StopTask();
}

{
AnsiConsole.MarkupLine($"{prompt} Begin packing.");

if (packIgnoreExists)
AnsiConsole.MarkupLine(
$"{prompt} `.packignore` not exists, all folder will be packed."
);

packTask.IsIndeterminate = false;

var ignoredDirectories = packIgnoreExists
? JsonSerializer.Deserialize<List<string>>(File.ReadAllText(packIgnore))
: new List<string>();

var folders = new DirectoryInfo(publishDir).GetDirectories().ToList();

folders.RemoveAll(f => ignoredDirectories.Contains(f.Name));

foreach (var folder in folders)
{
var name = folder.Name;
var zipFileName = $"{publishDir}/{name}.zip";

AnsiConsole.MarkupLine($"{prompt} Packing 📂 [yellow]{name}[/]");

if (File.Exists(zipFileName))
File.Delete(zipFileName);

ZipFile.CreateFromDirectory(
folder.FullName,
zipFileName,
CompressionLevel.SmallestSize,
true
);

AnsiConsole.MarkupLine(
$" Packed to {Path.GetRelativePath(baseDir, zipFileName)}"
);

packTask.Increment((1.0 / folders.Count) * 100);
}

AnsiConsole.MarkupLine($"{prompt} Packing done.");

packTask.StopTask();
}
});
4 changes: 4 additions & 0 deletions .csharpierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
printWidth: 140
useTabs: false
tabWidth: 4
endOfLine: auto
Loading
Loading