Files
wwdpublic/Content.Packaging/Program.cs
SimpleStation14 a8911da2f3 Mirror: Configuration argument for content packaging (#316)
## Mirror of PR #25569: [Configuration argument for content
packaging](https://github.com/space-wizards/space-station-14/pull/25569)
from <img src="https://avatars.githubusercontent.com/u/10567778?v=4"
alt="space-wizards" width="22"/>
[space-wizards](https://github.com/space-wizards)/[space-station-14](https://github.com/space-wizards/space-station-14)

###### `9e7b196ffbaa8c0a772d5d7544e51deaa2fe5a26`

PR opened by <img
src="https://avatars.githubusercontent.com/u/34938708?v=4"
width="16"/><a href="https://github.com/VasilisThePikachu">
VasilisThePikachu</a> at 2024-02-25 21:40:05 UTC

---

PR changed 4 files with 34 additions and 15 deletions.

The PR had the following labels:


---

<details open="true"><summary><h1>Original Body</h1></summary>

> <!-- Please read these guidelines before opening your PR:
https://docs.spacestation14.io/en/getting-started/pr-guideline -->
> <!-- The text between the arrows are comments - they will not be
visible on your PR. -->
> 
> Requires https://github.com/space-wizards/RobustToolbox/pull/4992
> 
> ## About the PR
> <!-- What did you change in this PR? -->
> 
> Needed this for something so here we are. I think someone mentioned
they wanted this? Welp its here now
> 
> New argument is ``--configuration`` by default release but you can
pass in anything else. Probably debug or tools


</details>

Co-authored-by: SimpleStation14 <Unknown>
Co-authored-by: VMSolidus <evilexecutive@gmail.com>
2024-07-09 19:52:39 -04: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");
}