Skip to content
This repository has been archived by the owner on Nov 1, 2024. It is now read-only.

Commit

Permalink
Merge pull request #27 from Corvax-Frontier/test-packaging
Browse files Browse the repository at this point in the history
add corvax interfaces to packaging
  • Loading branch information
Vonsant authored Apr 12, 2024
2 parents 7fc55ba + 754c077 commit 421796e
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 4 deletions.
27 changes: 25 additions & 2 deletions Content.Packaging/ClientPackaging.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace Content.Packaging;

public static class ClientPackaging
{
private static readonly bool UseSecrets = File.Exists(Path.Combine("Secrets", "CorvaxSecrets.sln")); // Corvax-Secrets
/// <summary>
/// Be advised this can be called from server packaging during a HybridACZ build.
/// </summary>
Expand All @@ -34,6 +35,24 @@ await ProcessHelpers.RunCheck(new ProcessStartInfo
"/m"
}
});
if (UseSecrets)
{
await ProcessHelpers.RunCheck(new ProcessStartInfo
{
FileName = "dotnet",
ArgumentList =
{
"build",
Path.Combine("Secrets","Content.Corvax.Client", "Content.Corvax.Client.csproj"),
"-c", "Release",
"--nologo",
"/v:m",
"/t:Rebuild",
"/p:FullRelease=true",
"/m"
}
});
}
}

logger.Info("Packaging client...");
Expand Down Expand Up @@ -64,12 +83,16 @@ public static async Task WriteResources(
AssetGraph.CalculateGraph(graph.AllPasses.Append(pass).ToArray(), logger);

var inputPass = graph.Input;

// Corvax-Secrets-Start: Add Corvax interfaces to Magic ACZ
var assemblies = new List<string> { "Content.Client", "Content.Shared", "Content.Shared.Database", "Content.Corvax.Interfaces.Client", "Content.Corvax.Interfaces.Shared" };
if (UseSecrets)
assemblies.AddRange(new[] { "Content.Corvax.Shared", "Content.Corvax.Client" });
// Corvax-Secrets-End
await RobustSharedPackaging.WriteContentAssemblies(
inputPass,
contentDir,
"Content.Client",
new[] { "Content.Client", "Content.Shared", "Content.Shared.Database" },
assemblies,
cancel: cancel);

await RobustClientPackaging.WriteClientResources(contentDir, pass, cancel);
Expand Down
34 changes: 32 additions & 2 deletions Content.Packaging/ServerPackaging.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ public static class ServerPackaging

private static readonly List<string> ServerContentAssemblies = new()
{
// Corvax-Secrets-Start
"Content.Corvax.Interfaces.Shared",
"Content.Corvax.Interfaces.Server",
// Corvax-Secrets-End
"Content.Server.Database",
"Content.Server",
"Content.Shared",
Expand Down Expand Up @@ -68,7 +72,7 @@ public static class ServerPackaging
"zh-Hans",
"zh-Hant"
};

private static readonly bool UseSecrets = File.Exists(Path.Combine("Secrets", "CorvaxSecrets.sln")); // Corvax-Secrets
public static async Task PackageServer(bool skipBuild, bool hybridAcz, IPackageLogger logger, List<string>? platforms = null)
{
if (platforms == null)
Expand Down Expand Up @@ -117,6 +121,29 @@ await ProcessHelpers.RunCheck(new ProcessStartInfo
"/m"
}
});
// Corvax-Secrets-Start
if (UseSecrets)
{
logger.Info($"Secrets found. Building secret project for {platform}...");
await ProcessHelpers.RunCheck(new ProcessStartInfo
{
FileName = "dotnet",
ArgumentList =
{
"build",
Path.Combine("Secrets","Content.Corvax.Server", "Content.Corvax.Server.csproj"),
"-c", "Release",
"--nologo",
"/v:m",
$"/p:TargetOs={platform.TargetOs}",
"/t:Rebuild",
"/p:FullRelease=true",
"/m"
}
});
}
// Corvax-Secrets-End


await PublishClientServer(platform.Rid, platform.TargetOs);
}
Expand Down Expand Up @@ -175,7 +202,10 @@ private static async Task WriteServerResources(
var inputPassCore = graph.InputCore;
var inputPassResources = graph.InputResources;
var contentAssemblies = new List<string>(ServerContentAssemblies);

// Corvax-Secrets-Start
if (UseSecrets)
contentAssemblies.AddRange(new[] { "Content.Corvax.Shared", "Content.Corvax.Server" });
// Corvax-Secrets-End
// Additional assemblies that need to be copied such as EFCore.
var sourcePath = Path.Combine(contentDir, "bin", "Content.Server");

Expand Down

0 comments on commit 421796e

Please sign in to comment.