Files
space-station-14/Content.Packaging/Program.cs
Pieter-Jan Briers d11f3fb3c1 Content.Packaging can now emit binlogs for the build (#42659)
* Content.Packaging can now emit binlogs for the build

I was checking why packaging is so much slower and it *seems* to be entirely the actual build being twice as slow as before .NET 10. Strange.

Content.Packaging can now emit MSBuild binlogs that we can analyze to see why that's the case.

* Enable --log-build on Test Packaging workflow, produce artifact with binlogs

* Disable setup-dotnet in packaging workflow

I have a suspicion...
2026-01-27 00:39:00 +00:00

50 lines
1.1 KiB
C#

using Content.Packaging;
using Robust.Packaging;
IPackageLogger logger = new PackageLoggerConsole();
if (!CommandLineArgs.TryParse(args, out var parsed))
{
logger.Error("Unable to parse args, aborting.");
return;
}
if (parsed.WipeRelease)
WipeRelease();
else
{
// Ensure the release directory exists. Otherwise, the packaging will fail.
Directory.CreateDirectory("release");
}
if (!parsed.SkipBuild)
WipeBin();
if (parsed.Client)
{
await ClientPackaging.PackageClient(parsed.SkipBuild, parsed.LogBuild, parsed.Configuration, logger);
}
else
{
await ServerPackaging.PackageServer(parsed.SkipBuild, parsed.HybridAcz, parsed.LogBuild, logger, parsed.Configuration, parsed.Platforms);
}
void WipeBin()
{
logger.Info("Clearing old build artifacts (if any)...");
if (Directory.Exists("bin"))
Directory.Delete("bin", recursive: true);
}
void WipeRelease()
{
if (Directory.Exists("release"))
{
logger.Info("Cleaning old release packages (release/)...");
Directory.Delete("release", recursive: true);
}
Directory.CreateDirectory("release");
}