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
This commit is contained in:
Vasilis
2024-03-24 03:20:34 +01:00
committed by GitHub
parent 4c840a7e6a
commit 9e7b196ffb
4 changed files with 34 additions and 15 deletions

View File

@@ -69,7 +69,7 @@ public static class ServerPackaging
"zh-Hant"
};
public static async Task PackageServer(bool skipBuild, bool hybridAcz, IPackageLogger logger, List<string>? platforms = null)
public static async Task PackageServer(bool skipBuild, bool hybridAcz, IPackageLogger logger, string configuration, List<string>? platforms = null)
{
if (platforms == null)
{
@@ -82,7 +82,7 @@ public static class ServerPackaging
// Rather than hosting the client ZIP on the watchdog or on a separate server,
// Hybrid ACZ uses the ACZ hosting functionality to host it as part of the status host,
// which means that features such as automatic UPnP forwarding still work properly.
await ClientPackaging.PackageClient(skipBuild, logger);
await ClientPackaging.PackageClient(skipBuild, configuration, logger);
}
// Good variable naming right here.
@@ -91,13 +91,13 @@ public static class ServerPackaging
if (!platforms.Contains(platform.Rid))
continue;
await BuildPlatform(platform, skipBuild, hybridAcz, logger);
await BuildPlatform(platform, skipBuild, hybridAcz, configuration, logger);
}
}
private static async Task BuildPlatform(PlatformReg platform, bool skipBuild, bool hybridAcz, IPackageLogger logger)
private static async Task BuildPlatform(PlatformReg platform, bool skipBuild, bool hybridAcz, string configuration, IPackageLogger logger)
{
logger.Info($"Building project for {platform}...");
logger.Info($"Building project for {platform.TargetOs}...");
if (!skipBuild)
{
@@ -108,7 +108,7 @@ public static class ServerPackaging
{
"build",
Path.Combine("Content.Server", "Content.Server.csproj"),
"-c", "Release",
"-c", configuration,
"--nologo",
"/v:m",
$"/p:TargetOs={platform.TargetOs}",
@@ -118,7 +118,7 @@ public static class ServerPackaging
}
});
await PublishClientServer(platform.Rid, platform.TargetOs);
await PublishClientServer(platform.Rid, platform.TargetOs, configuration);
}
logger.Info($"Packaging {platform.Rid} server...");
@@ -137,7 +137,7 @@ public static class ServerPackaging
logger.Info($"Finished packaging server in {sw.Elapsed}");
}
private static async Task PublishClientServer(string runtime, string targetOs)
private static async Task PublishClientServer(string runtime, string targetOs, string configuration)
{
await ProcessHelpers.RunCheck(new ProcessStartInfo
{
@@ -147,7 +147,7 @@ public static class ServerPackaging
"publish",
"--runtime", runtime,
"--no-self-contained",
"-c", "Release",
"-c", configuration,
$"/p:TargetOs={targetOs}",
"/p:FullRelease=True",
"/m",