Add GameCooker events for game files deploy and packaging
This commit is contained in:
@@ -106,6 +106,9 @@ using namespace GameCookerImpl;
|
|||||||
|
|
||||||
Delegate<GameCooker::EventType> GameCooker::OnEvent;
|
Delegate<GameCooker::EventType> GameCooker::OnEvent;
|
||||||
Delegate<const String&, float> GameCooker::OnProgress;
|
Delegate<const String&, float> GameCooker::OnProgress;
|
||||||
|
Action GameCooker::DeployFiles;
|
||||||
|
Action GameCooker::PostProcessFiles;
|
||||||
|
Action GameCooker::PackageFiles;
|
||||||
Delegate<HashSet<Guid>&> GameCooker::OnCollectAssets;
|
Delegate<HashSet<Guid>&> GameCooker::OnCollectAssets;
|
||||||
|
|
||||||
const Char* ToString(const BuildPlatform platform)
|
const Char* ToString(const BuildPlatform platform)
|
||||||
|
|||||||
@@ -10,17 +10,15 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
API_CLASS(Static, Namespace="FlaxEditor") class FLAXENGINE_API GameCooker
|
API_CLASS(Static, Namespace="FlaxEditor") class FLAXENGINE_API GameCooker
|
||||||
{
|
{
|
||||||
DECLARE_SCRIPTING_TYPE_NO_SPAWN(GameCooker);
|
DECLARE_SCRIPTING_TYPE_NO_SPAWN(GameCooker);
|
||||||
friend CookingData;
|
friend CookingData;
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Single build step.
|
/// Single build step.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
class FLAXENGINE_API BuildStep
|
class FLAXENGINE_API BuildStep
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Finalizes an instance of the <see cref="BuildStep"/> class.
|
/// Finalizes an instance of the <see cref="BuildStep"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -52,7 +50,6 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the current build data. Valid only during active build process.
|
/// Gets the current build data. Valid only during active build process.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -124,6 +121,21 @@ public:
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
static Delegate<const String&, float> OnProgress;
|
static Delegate<const String&, float> OnProgress;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Occurs when game files and data is deployed.
|
||||||
|
/// </summary>
|
||||||
|
API_EVENT() static Action DeployFiles;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Occurs when game files and data are deployed and can be post-processed.
|
||||||
|
/// </summary>
|
||||||
|
API_EVENT() static Action PostProcessFiles;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Occurs when game files and data are ready to be packaged. Called only if game is about to packaged, otherwise this step is skipped.
|
||||||
|
/// </summary>
|
||||||
|
API_EVENT() static Action PackageFiles;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Occurs when building collects assets to cook.
|
/// Occurs when building collects assets to cook.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -5,6 +5,8 @@
|
|||||||
#include "AndroidPlatformTools.h"
|
#include "AndroidPlatformTools.h"
|
||||||
#include "Editor/Editor.h"
|
#include "Editor/Editor.h"
|
||||||
#include "Editor/ProjectInfo.h"
|
#include "Editor/ProjectInfo.h"
|
||||||
|
#include "Editor/Cooker/GameCooker.h"
|
||||||
|
#include "Editor/Utilities/EditorUtilities.h"
|
||||||
#include "Engine/Platform/File.h"
|
#include "Engine/Platform/File.h"
|
||||||
#include "Engine/Platform/FileSystem.h"
|
#include "Engine/Platform/FileSystem.h"
|
||||||
#include "Engine/Platform/Android/AndroidPlatformSettings.h"
|
#include "Engine/Platform/Android/AndroidPlatformSettings.h"
|
||||||
@@ -12,7 +14,6 @@
|
|||||||
#include "Engine/Graphics/Textures/TextureData.h"
|
#include "Engine/Graphics/Textures/TextureData.h"
|
||||||
#include "Engine/Core/Config/GameSettings.h"
|
#include "Engine/Core/Config/GameSettings.h"
|
||||||
#include "Engine/Core/Config/BuildSettings.h"
|
#include "Engine/Core/Config/BuildSettings.h"
|
||||||
#include "Editor/Utilities/EditorUtilities.h"
|
|
||||||
#include "Engine/Content/Content.h"
|
#include "Engine/Content/Content.h"
|
||||||
#include "Engine/Content/JsonAsset.h"
|
#include "Engine/Content/JsonAsset.h"
|
||||||
|
|
||||||
@@ -276,6 +277,7 @@ bool AndroidPlatformTools::OnPostProcess(CookingData& data)
|
|||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
GameCooker::PackageFiles();
|
||||||
|
|
||||||
// Validate environment variables
|
// Validate environment variables
|
||||||
Dictionary<String, String> envVars;
|
Dictionary<String, String> envVars;
|
||||||
|
|||||||
@@ -220,6 +220,7 @@ bool MacPlatformTools::OnPostProcess(CookingData& data)
|
|||||||
const auto buildSettings = BuildSettings::Get();
|
const auto buildSettings = BuildSettings::Get();
|
||||||
if (buildSettings->SkipPackaging)
|
if (buildSettings->SkipPackaging)
|
||||||
return false;
|
return false;
|
||||||
|
GameCooker::PackageFiles();
|
||||||
LOG(Info, "Building app package...");
|
LOG(Info, "Building app package...");
|
||||||
const String dmgPath = data.OriginalOutputPath / appName + TEXT(".dmg");
|
const String dmgPath = data.OriginalOutputPath / appName + TEXT(".dmg");
|
||||||
const String dmgCommand = String::Format(TEXT("hdiutil create {0}.dmg -volname {0} -fs HFS+ -srcfolder {0}.app"), appName);
|
const String dmgCommand = String::Format(TEXT("hdiutil create {0}.dmg -volname {0} -fs HFS+ -srcfolder {0}.app"), appName);
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ bool DeployDataStep::Perform(CookingData& data)
|
|||||||
// Deploy engine data for the target platform
|
// Deploy engine data for the target platform
|
||||||
if (data.Tools->OnDeployBinaries(data))
|
if (data.Tools->OnDeployBinaries(data))
|
||||||
return true;
|
return true;
|
||||||
|
GameCooker::DeployFiles();
|
||||||
|
|
||||||
// Register engine in-build assets
|
// Register engine in-build assets
|
||||||
data.AddRootEngineAsset(TEXT("Shaders/AtmospherePreCompute"));
|
data.AddRootEngineAsset(TEXT("Shaders/AtmospherePreCompute"));
|
||||||
|
|||||||
@@ -5,5 +5,6 @@
|
|||||||
|
|
||||||
bool PostProcessStep::Perform(CookingData& data)
|
bool PostProcessStep::Perform(CookingData& data)
|
||||||
{
|
{
|
||||||
|
GameCooker::PostProcessFiles();
|
||||||
return data.Tools->OnPostProcess(data);
|
return data.Tools->OnPostProcess(data);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user