Skip to content

Commit

Permalink
Set modules BuildId to "SML"
Browse files Browse the repository at this point in the history
  • Loading branch information
mircearoata committed Apr 28, 2021
1 parent 9350917 commit 452ec53
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 33 deletions.
38 changes: 5 additions & 33 deletions Build/Alpakit.Automation/PackagePlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ namespace Alpakit.Automation
{
public class FactoryGameParams
{
public string GameBuildId;
public bool CopyToGameDirectory;
public bool StartGame;
public string GameDirectory;
Expand Down Expand Up @@ -104,26 +103,6 @@ private static ProjectParams GetParams(BuildCommand cmd)
return projectParameters;
}

private static string RetrieveBuildIdFromGame(string gameDir)
{
var versionFilePath = Path.Combine(gameDir, "Engine", "Binaries", "Win64", "FactoryGame-Win64-Shipping.version");
if (!FileExists(versionFilePath))
{
throw new AutomationException("Cannot find game version file at '{0}'", versionFilePath);
}

try
{
var versionObject = JsonObject.Read(new FileReference(versionFilePath));
var buildId = versionObject.GetStringField("BuildId");
return buildId;
}
catch (Exception ex)
{
throw new AutomationException("Failed to parse version JSON '{0}': {1}", versionFilePath, ex.Message);
}
}

private static void TryUpdateModulesFile(string filePath, string targetBuildId)
{
try
Expand Down Expand Up @@ -310,27 +289,20 @@ private static void CleanStagingDirectories(IEnumerable<DeploymentContext> deplo
}

public override void ExecuteBuild()
{
var gameBuildVersion = ParseOptionalStringParam("GameVersionOverride");
string maybeGameDirectory = null;
if (gameBuildVersion == null)
{
string gameDir = ParseOptionalStringParam("GameDir");
if (gameDir != null)
{
var gameDir = ParseRequiredStringParam("GameDir");
var bootstrapExePath = Path.Combine(gameDir, "FactoryGame.exe");
if (!FileExists(bootstrapExePath))
{
throw new AutomationException("Provided -GameDir is invalid: '{0}'", gameDir);
}
gameBuildVersion = RetrieveBuildIdFromGame(gameDir);
maybeGameDirectory = gameDir;
}

LogInformation("Game Build Id: {0}", gameBuildVersion);

var factoryGameParams = new FactoryGameParams
{
GameBuildId = gameBuildVersion,
GameDirectory = maybeGameDirectory,
GameDirectory = gameDir,
StartGame = ParseParam("LaunchGame"),
CopyToGameDirectory = ParseParam("CopyToGameDir")
};
Expand All @@ -348,7 +320,7 @@ public override void ExecuteBuild()
try
{
CopyBuildToStagingDirectory(projectParams, deploymentContexts);
PackagePluginProject(deploymentContexts, gameBuildVersion);
PackagePluginProject(deploymentContexts, "SML");
ArchivePluginProject(projectParams, deploymentContexts);
DeployPluginProject(projectParams, deploymentContexts, factoryGameParams);
}
Expand Down
Binary file modified Build/Alpakit.Automation/Scripts/Alpakit.Automation.dll
Binary file not shown.

0 comments on commit 452ec53

Please sign in to comment.