2026-01-11 03:54:14 +11:00
|
|
|
|
using Progrart.Core.ProjectSystem;
|
|
|
|
|
|
using Progrart.Core.Storage;
|
2026-01-13 03:33:49 +11:00
|
|
|
|
using System.Diagnostics;
|
2026-01-11 03:54:14 +11:00
|
|
|
|
|
|
|
|
|
|
namespace Progrart.Cmd
|
|
|
|
|
|
{
|
|
|
|
|
|
internal class Program
|
|
|
|
|
|
{
|
2026-01-13 03:33:49 +11:00
|
|
|
|
static async Task Main(string[] args)
|
2026-01-11 03:54:14 +11:00
|
|
|
|
{
|
2026-01-13 03:33:49 +11:00
|
|
|
|
Trace.Listeners.Add(new TextWriterTraceListener(Console.Out));
|
2026-01-11 03:54:14 +11:00
|
|
|
|
string? project_file = null;
|
2026-01-13 03:33:49 +11:00
|
|
|
|
bool isParallel = false;
|
2026-01-11 03:54:14 +11:00
|
|
|
|
string? configuration = null;
|
|
|
|
|
|
for (int i = 0; i < args.Length; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
string? item = args[i];
|
|
|
|
|
|
switch (item)
|
|
|
|
|
|
{
|
2026-01-13 03:33:49 +11:00
|
|
|
|
case "-j":
|
|
|
|
|
|
isParallel=true;
|
|
|
|
|
|
break;
|
2026-01-11 03:54:14 +11:00
|
|
|
|
case "-c":
|
|
|
|
|
|
case "--config":
|
|
|
|
|
|
case "--configuration":
|
|
|
|
|
|
{
|
|
|
|
|
|
i++;
|
|
|
|
|
|
item = args[i];
|
|
|
|
|
|
configuration = item;
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
default:
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
if (File.Exists(item))
|
|
|
|
|
|
{
|
|
|
|
|
|
project_file = item;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if (project_file != null)
|
|
|
|
|
|
if (configuration != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
FileInfo fi = new FileInfo(project_file);
|
|
|
|
|
|
if (fi.Directory is DirectoryInfo di)
|
|
|
|
|
|
{
|
|
|
|
|
|
using var fs = fi.OpenRead();
|
|
|
|
|
|
using var sr = new StreamReader(fs);
|
|
|
|
|
|
ClassicStorageProvider provider = new ClassicStorageProvider(di);
|
|
|
|
|
|
Builder builder = new Builder(sr, provider);
|
2026-01-13 03:33:49 +11:00
|
|
|
|
builder.OnProgressUpdate = (max, index) =>
|
2026-01-11 03:54:14 +11:00
|
|
|
|
{
|
2026-01-13 03:33:49 +11:00
|
|
|
|
Console.WriteLine($"Done {index}/{max}");
|
2026-01-11 03:54:14 +11:00
|
|
|
|
};
|
|
|
|
|
|
builder.OnCompleted = () =>
|
|
|
|
|
|
{
|
|
|
|
|
|
Environment.Exit(0);
|
|
|
|
|
|
};
|
2026-01-13 03:33:49 +11:00
|
|
|
|
Console.WriteLine("Start build...");
|
|
|
|
|
|
//Task.Run(async () =>
|
|
|
|
|
|
//{
|
|
|
|
|
|
//});
|
|
|
|
|
|
//while (true)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// Thread.Sleep(1000);
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
await builder.Build(configuration, isParallel);
|
2026-01-11 03:54:14 +11:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|