Skip to content

Commit

Permalink
Presenting EXODUS secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
Lokilife committed Aug 1, 2024
1 parent 613b0ac commit 1a18c7f
Show file tree
Hide file tree
Showing 9 changed files with 158 additions and 10 deletions.
7 changes: 3 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@

# Secret
Secrets
Resources/Prototypes/CorvaxSecrets
Resources/Prototypes/CorvaxSecretsServer
Resources/Textures/CorvaxSecrets
Resources/Locale/ru-RU/corvax-secrets
Resources/Prototypes/ExodusSecrets
Resources/Textures/ExodusSecrets
Resources/Locale/ru-RU/exodus-secrets

# Build results
[Dd]ebug/
Expand Down
1 change: 1 addition & 0 deletions Content.Client/Content.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<ProjectReference Include="..\RobustToolbox\Robust.Shared\Robust.Shared.csproj" />
<ProjectReference Include="..\RobustToolbox\Robust.Client\Robust.Client.csproj" />
<ProjectReference Include="..\Content.Shared\Content.Shared.csproj" />
<ProjectReference Include="..\Exodus\Content.Exodus.Interfaces.Client\Content.Exodus.Interfaces.Client.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="Spawners\" />
Expand Down
50 changes: 49 additions & 1 deletion 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("Exodus", "ExodusSecrets.sln")); // Exodus-Secrets
/// <summary>
/// Be advised this can be called from server packaging during a HybridACZ build.
/// </summary>
Expand All @@ -34,6 +35,26 @@ await ProcessHelpers.RunCheck(new ProcessStartInfo
"/m"
}
});
// Exodus-Secrets-Start
if (UseSecrets)
{
await ProcessHelpers.RunCheck(new ProcessStartInfo
{
FileName = "dotnet",
ArgumentList =
{
"build",
Path.Combine("Secrets","Content.Exodus.Client", "Content.Exodus.Client.csproj"),
"-c", "Release",
"--nologo",
"/v:m",
"/t:Rebuild",
"/p:FullRelease=true",
"/m"
}
});
}
// Exodus-Secrets-End
}

logger.Info("Packaging client...");
Expand Down Expand Up @@ -65,15 +86,42 @@ public static async Task WriteResources(

var inputPass = graph.Input;

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

await RobustSharedPackaging.WriteContentAssemblies(
inputPass,
contentDir,
"Content.Client",
new[] { "Content.Client", "Content.Shared", "Content.Shared.Database" },
assemblies, // Exodus-Secrets
cancel: cancel);

await WriteClientResources(contentDir, pass, cancel); // Exodus-Secrets: Support content resource ignore to ignore server-only prototypes

await RobustClientPackaging.WriteClientResources(contentDir, pass, cancel);

inputPass.InjectFinished();
}

// Exodus-Secrets-Start
public static IReadOnlySet<string> ContentClientIgnoredResources { get; } = new HashSet<string>
{
"ExodusSecretsServer"
};

private static async Task WriteClientResources(
string contentDir,
AssetPass pass,
CancellationToken cancel = default)
{
var ignoreSet = RobustClientPackaging.ClientIgnoredResources
.Union(RobustSharedPackaging.SharedIgnoredResources)
.Union(ContentClientIgnoredResources).ToHashSet();

await RobustSharedPackaging.DoResourceCopy(Path.Combine(contentDir, "Resources"), pass, ignoreSet, cancel: cancel);
}
// Exodus-Secrets-End
}
31 changes: 31 additions & 0 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()
{
// Exodus-Secrets-Start
"Content.Exodus.Interfaces.Shared",
"Content.Exodus.Interfaces.Server",
// Exodus-Secrets-End
"Content.Server.Database",
"Content.Server",
"Content.Shared",
Expand Down Expand Up @@ -69,6 +73,7 @@ public static class ServerPackaging
"zh-Hant"
};

private static readonly bool UseSecrets = File.Exists(Path.Combine("Secrets", "ExodusSecrets.sln")); // Exodus-Secrets
public static async Task PackageServer(bool skipBuild, bool hybridAcz, IPackageLogger logger, string configuration, List<string>? platforms = null)
{
if (platforms == null)
Expand Down Expand Up @@ -117,6 +122,28 @@ await ProcessHelpers.RunCheck(new ProcessStartInfo
"/m"
}
});
// Exodus-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.Exodus.Server", "Content.Exodus.Server.csproj"),
"-c", "Release",
"--nologo",
"/v:m",
$"/p:TargetOs={platform.TargetOs}",
"/t:Rebuild",
"/p:FullRelease=true",
"/m"
}
});
}
// Exodus-Secrets-End

await PublishClientServer(platform.Rid, platform.TargetOs, configuration);
}
Expand Down Expand Up @@ -175,6 +202,10 @@ private static async Task WriteServerResources(
var inputPassCore = graph.InputCore;
var inputPassResources = graph.InputResources;
var contentAssemblies = new List<string>(ServerContentAssemblies);
// Exodus-Secrets-Start
if (UseSecrets)
contentAssemblies.AddRange(["Content.Exodus.Shared", "Content.Exodus.Server"]);
// Exodus-Secrets-End

// Additional assemblies that need to be copied such as EFCore.
var sourcePath = Path.Combine(contentDir, "bin", "Content.Server");
Expand Down
1 change: 1 addition & 0 deletions Content.Server/Content.Server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<ProjectReference Include="..\RobustToolbox\Robust.Shared\Robust.Shared.csproj" />
<ProjectReference Include="..\RobustToolbox\Robust.Server\Robust.Server.csproj" />
<ProjectReference Include="..\Content.Shared\Content.Shared.csproj" />
<ProjectReference Include="..\Exodus\Content.Exodus.Interfaces.Server\Content.Exodus.Interfaces.Server.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="Objectives\Interfaces\" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\RobustToolbox\Robust.Client\Robust.Client.csproj">
<Private>false</Private>
</ProjectReference>
<ProjectReference Include="..\Content.Exodus.Interfaces.Shared\Content.Exodus.Interfaces.Shared.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\RobustToolbox\Robust.Server\Robust.Server.csproj">
<Private>false</Private>
</ProjectReference>
<ProjectReference Include="..\Content.Exodus.Interfaces.Shared\Content.Exodus.Interfaces.Shared.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\RobustToolbox\Robust.Shared\Robust.Shared.csproj" />
</ItemGroup>
</Project>
42 changes: 37 additions & 5 deletions SpaceStation14.sln
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Roslyn", "Roslyn", "{7844DA
RobustToolbox\Robust.Roslyn.Shared\Robust.Roslyn.Shared.props = RobustToolbox\Robust.Roslyn.Shared\Robust.Roslyn.Shared.props
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Exodus", "Exodus", "{3A6F6EA7-C7CB-401C-ADAA-A176C09CB063}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Content.Exodus.Interfaces.Client", "Exodus\Content.Exodus.Interfaces.Client\Content.Exodus.Interfaces.Client.csproj", "{C47BA283-2900-431E-A31A-1FAB639A5BDC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Content.Exodus.Interfaces.Shared", "Exodus\Content.Exodus.Interfaces.Shared\Content.Exodus.Interfaces.Shared.csproj", "{FC64C642-7FC2-4263-950D-858F4D37706C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Content.Exodus.Interfaces.Server", "Exodus\Content.Exodus.Interfaces.Server\Content.Exodus.Interfaces.Server.csproj", "{4FB4F181-B718-4221-B9E9-1C603DA4408A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -454,6 +462,30 @@ Global
{6D63F2DA-D300-4439-89C4-9EB744D0E47C}.Release|Any CPU.Build.0 = Release|Any CPU
{6D63F2DA-D300-4439-89C4-9EB744D0E47C}.Tools|Any CPU.ActiveCfg = Debug|Any CPU
{6D63F2DA-D300-4439-89C4-9EB744D0E47C}.Tools|Any CPU.Build.0 = Debug|Any CPU
{C47BA283-2900-431E-A31A-1FAB639A5BDC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C47BA283-2900-431E-A31A-1FAB639A5BDC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C47BA283-2900-431E-A31A-1FAB639A5BDC}.DebugOpt|Any CPU.ActiveCfg = Debug|Any CPU
{C47BA283-2900-431E-A31A-1FAB639A5BDC}.DebugOpt|Any CPU.Build.0 = Debug|Any CPU
{C47BA283-2900-431E-A31A-1FAB639A5BDC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C47BA283-2900-431E-A31A-1FAB639A5BDC}.Release|Any CPU.Build.0 = Release|Any CPU
{C47BA283-2900-431E-A31A-1FAB639A5BDC}.Tools|Any CPU.ActiveCfg = Debug|Any CPU
{C47BA283-2900-431E-A31A-1FAB639A5BDC}.Tools|Any CPU.Build.0 = Debug|Any CPU
{FC64C642-7FC2-4263-950D-858F4D37706C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FC64C642-7FC2-4263-950D-858F4D37706C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FC64C642-7FC2-4263-950D-858F4D37706C}.DebugOpt|Any CPU.ActiveCfg = Debug|Any CPU
{FC64C642-7FC2-4263-950D-858F4D37706C}.DebugOpt|Any CPU.Build.0 = Debug|Any CPU
{FC64C642-7FC2-4263-950D-858F4D37706C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FC64C642-7FC2-4263-950D-858F4D37706C}.Release|Any CPU.Build.0 = Release|Any CPU
{FC64C642-7FC2-4263-950D-858F4D37706C}.Tools|Any CPU.ActiveCfg = Debug|Any CPU
{FC64C642-7FC2-4263-950D-858F4D37706C}.Tools|Any CPU.Build.0 = Debug|Any CPU
{4FB4F181-B718-4221-B9E9-1C603DA4408A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4FB4F181-B718-4221-B9E9-1C603DA4408A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4FB4F181-B718-4221-B9E9-1C603DA4408A}.DebugOpt|Any CPU.ActiveCfg = Debug|Any CPU
{4FB4F181-B718-4221-B9E9-1C603DA4408A}.DebugOpt|Any CPU.Build.0 = Debug|Any CPU
{4FB4F181-B718-4221-B9E9-1C603DA4408A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4FB4F181-B718-4221-B9E9-1C603DA4408A}.Release|Any CPU.Build.0 = Release|Any CPU
{4FB4F181-B718-4221-B9E9-1C603DA4408A}.Tools|Any CPU.ActiveCfg = Debug|Any CPU
{4FB4F181-B718-4221-B9E9-1C603DA4408A}.Tools|Any CPU.Build.0 = Debug|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -482,13 +514,13 @@ Global
{A965CB3B-FD31-44AF-8872-85ABA436098D} = {83B4CBBA-547A-42F0-A7CD-8A67D93196CE}
{7844DA69-B0F0-49FB-A05E-ECA37372277A} = {83B4CBBA-547A-42F0-A7CD-8A67D93196CE}
{3CFEB7DB-12C6-46F3-89FC-1450F3016FFA} = {7844DA69-B0F0-49FB-A05E-ECA37372277A}
{6FBF108E-5CB5-47DE-8D7E-B496ABA9E3E2} = {7844DA69-B0F0-49FB-A05E-ECA37372277A}
{07CA34A1-1D37-4771-A2E3-495A1044AE0B} = {7844DA69-B0F0-49FB-A05E-ECA37372277A}
{88B0FC0F-7209-40E2-AF16-EB90AF727C5B} = {7844DA69-B0F0-49FB-A05E-ECA37372277A}
{83F510FE-9B50-4D96-AFAB-CC13998D6AFE} = {7844DA69-B0F0-49FB-A05E-ECA37372277A}
{07CA34A1-1D37-4771-A2E3-495A1044AE0B} = {83B4CBBA-547A-42F0-A7CD-8A67D93196CE}
{6FBF108E-5CB5-47DE-8D7E-B496ABA9E3E2} = {83B4CBBA-547A-42F0-A7CD-8A67D93196CE}
{07CA34A1-1D37-4771-A2E3-495A1044AE0B} = {83B4CBBA-547A-42F0-A7CD-8A67D93196CE}
{88B0FC0F-7209-40E2-AF16-EB90AF727C5B} = {7844DA69-B0F0-49FB-A05E-ECA37372277A}
{83F510FE-9B50-4D96-AFAB-CC13998D6AFE} = {83B4CBBA-547A-42F0-A7CD-8A67D93196CE}
{C47BA283-2900-431E-A31A-1FAB639A5BDC} = {3A6F6EA7-C7CB-401C-ADAA-A176C09CB063}
{FC64C642-7FC2-4263-950D-858F4D37706C} = {3A6F6EA7-C7CB-401C-ADAA-A176C09CB063}
{4FB4F181-B718-4221-B9E9-1C603DA4408A} = {3A6F6EA7-C7CB-401C-ADAA-A176C09CB063}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {AA37ED9F-F8D6-468E-A101-658AD605B09A}
Expand Down

0 comments on commit 1a18c7f

Please sign in to comment.