Files
tbd-station-14/Content.Packaging/Program.cs
Vasilis 9e7b196ffb Configuration argument for content packaging (#25569)
* Configuration argument for content packaging

Needed this for something so here we are. I think someone mentioned they wanted this? Welp its here now

* Add client, tiny fixes
2024-03-24 13:20:34 +11:00

45 lines
961 B
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();
if (!parsed.SkipBuild)
WipeBin();
if (parsed.Client)
{
await ClientPackaging.PackageClient(parsed.SkipBuild, parsed.Configuration, logger);
}
else
{
await ServerPackaging.PackageServer(parsed.SkipBuild, parsed.HybridAcz, 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");
}