[LYN-8041] Enable relocation of the Project Game Release Layout (#5380)
* Enable relocation of the Project Game Release Layout Relocating the Project Game Release Layout to another directory on the file system failed due to the querying of the engine root failing due to the ComponentApplication::m_engineRoot not using the project path stored in the SettingsRegisry if the engine root cannot be detected Removed the ApplicationRequestBus GetEngineRoot function. The ComponentApplicationRequestBus has a function of the same name that returns the same path. Removed the deprecated GetAppRoot function. The path it returns has no defined value. It was not the engine root or the project root. Removed unused CFileUtil and CFileUtil_impl functions that were invoking the ApplicationREquestBus GetEngineRoot function. On the way to update the functions it was discovered that they aren't called Added a CalculateBranchToken overload that can populate a fixed_string to avoid heap allocations Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Protect against an empty list of artifacts to remove when generating the engine.pak Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
d053a03b5f
commit
5fc4551ac0
@@ -14,7 +14,7 @@
|
||||
#include <AzCore/Module/DynamicModuleHandle.h>
|
||||
#include <AzCore/Settings/SettingsRegistryMergeUtils.h>
|
||||
#include <AzCore/StringFunc/StringFunc.h>
|
||||
#include <AzFramework/API/ApplicationAPI.h>
|
||||
#include <AzCore/Utils/Utils.h>
|
||||
#include <AzFramework/IO/LocalFileIO.h>
|
||||
#include <AzToolsFramework/API/EditorAssetSystemAPI.h>
|
||||
#include <AzToolsFramework/Asset/AssetUtils.h>
|
||||
@@ -205,7 +205,7 @@ namespace AzToolsFramework::AssetUtils
|
||||
return platformConfigFilePathsAdded;
|
||||
}
|
||||
|
||||
AZStd::vector<AZ::IO::Path> GetConfigFiles(AZStd::string_view engineRoot, AZStd::string_view assetRoot, AZStd::string_view projectPath,
|
||||
AZStd::vector<AZ::IO::Path> GetConfigFiles(AZStd::string_view engineRoot, AZStd::string_view projectPath,
|
||||
bool addPlatformConfigs, bool addGemsConfigs, AZ::SettingsRegistryInterface* settingsRegistry)
|
||||
{
|
||||
constexpr const char* AssetProcessorGamePlatformConfigFileName = "AssetProcessorGamePlatformConfig.ini";
|
||||
@@ -232,14 +232,13 @@ namespace AzToolsFramework::AssetUtils
|
||||
Internal::AddGemConfigFiles(gemInfoList, configFiles);
|
||||
}
|
||||
|
||||
AZ::IO::Path assetRootDir(assetRoot);
|
||||
assetRootDir /= projectPath;
|
||||
AZ::IO::Path projectRoot(projectPath);
|
||||
|
||||
AZ::IO::Path projectConfigFile = assetRootDir / AssetProcessorGamePlatformConfigFileName;
|
||||
AZ::IO::Path projectConfigFile = projectRoot / AssetProcessorGamePlatformConfigFileName;
|
||||
configFiles.push_back(projectConfigFile);
|
||||
|
||||
// Add a file entry for the Project AssetProcessor setreg file
|
||||
projectConfigFile = assetRootDir / AssetProcessorGamePlatformConfigSetreg;
|
||||
projectConfigFile = projectRoot / AssetProcessorGamePlatformConfigSetreg;
|
||||
configFiles.push_back(projectConfigFile);
|
||||
|
||||
return configFiles;
|
||||
@@ -251,10 +250,10 @@ namespace AzToolsFramework::AssetUtils
|
||||
AZStd::vector<AZStd::string> tokens;
|
||||
AZ::StringFunc::Tokenize(relPathFromRoot.c_str(), tokens, AZ_CORRECT_FILESYSTEM_SEPARATOR_STRING);
|
||||
|
||||
AZStd::string validatedPath;
|
||||
AZ::IO::FixedMaxPath validatedPath;
|
||||
if (rootPath.empty())
|
||||
{
|
||||
AzFramework::ApplicationRequests::Bus::BroadcastResult(validatedPath, &AzFramework::ApplicationRequests::GetEngineRoot);
|
||||
validatedPath = AZ::Utils::GetEnginePath();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -299,10 +298,7 @@ namespace AzToolsFramework::AssetUtils
|
||||
break;
|
||||
}
|
||||
|
||||
AZStd::string absoluteFilePath;
|
||||
AZ::StringFunc::Path::ConstructFull(validatedPath.c_str(), element.c_str(), absoluteFilePath);
|
||||
|
||||
validatedPath = absoluteFilePath; // go one step deeper.
|
||||
validatedPath /= element; // go one step deeper.
|
||||
}
|
||||
|
||||
if (success)
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace AzToolsFramework::AssetUtils
|
||||
//! Also note that if the project has any "game project gems", then those will also be inserted last,
|
||||
//! and thus have a higher priority than the root or non - project gems.
|
||||
//! Also note that the game project could be in a different location to the engine therefore we need the assetRoot param.
|
||||
AZStd::vector<AZ::IO::Path> GetConfigFiles(AZStd::string_view engineRoot, AZStd::string_view assetRoot, AZStd::string_view projectPath,
|
||||
AZStd::vector<AZ::IO::Path> GetConfigFiles(AZStd::string_view engineRoot, AZStd::string_view projectPath,
|
||||
bool addPlatformConfigs = true, bool addGemsConfigs = true, AZ::SettingsRegistryInterface* settingsRegistry = nullptr);
|
||||
|
||||
//! A utility function which checks the given path starting at the root and updates the relative path to be the actual case correct path.
|
||||
|
||||
+4
-6
@@ -9,11 +9,11 @@
|
||||
#include <AzCore/EBus/Results.h>
|
||||
#include <AzCore/std/string/string.h>
|
||||
#include <AzCore/std/containers/vector.h>
|
||||
#include <AzCore/Utils/Utils.h>
|
||||
#include <AzFramework/StringFunc/StringFunc.h>
|
||||
#include <AzToolsFramework/AssetBrowser/AssetBrowserBus.h>
|
||||
#include <AzToolsFramework/API/EditorAssetSystemAPI.h>
|
||||
#include <AzToolsFramework/AssetBrowser/Thumbnails/SourceThumbnail.h>
|
||||
#include <AzFramework/API/ApplicationAPI.h>
|
||||
#include <QString>
|
||||
|
||||
namespace AzToolsFramework
|
||||
@@ -113,11 +113,9 @@ namespace AzToolsFramework
|
||||
|
||||
if (iconPathToUse.isEmpty())
|
||||
{
|
||||
const char* engineRoot = nullptr;
|
||||
AzFramework::ApplicationRequests::Bus::BroadcastResult(engineRoot, &AzFramework::ApplicationRequests::GetEngineRoot);
|
||||
AZ_Assert(engineRoot, "Engine Root not initialized");
|
||||
AZStd::string iconPath = AZStd::string::format("%s%s", engineRoot, DefaultFileIconPath);
|
||||
iconPathToUse = iconPath.c_str();
|
||||
AZ::IO::FixedMaxPath engineRoot = AZ::Utils::GetEnginePath();
|
||||
AZ_Assert(!engineRoot.empty(), "Engine Root not initialized");
|
||||
iconPathToUse = (engineRoot / DefaultFileIconPath).c_str();
|
||||
}
|
||||
|
||||
m_pixmap.load(iconPathToUse);
|
||||
|
||||
+9
-9
@@ -6,10 +6,10 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <AzFramework/StringFunc/StringFunc.h>
|
||||
#include <AzCore/StringFunc/StringFunc.h>
|
||||
#include <AzCore/Utils/Utils.h>
|
||||
#include <AzToolsFramework/Thumbnails/SourceControlThumbnail.h>
|
||||
#include <AzToolsFramework/SourceControl/SourceControlAPI.h>
|
||||
#include <AzFramework/API/ApplicationAPI.h>
|
||||
|
||||
namespace AzToolsFramework
|
||||
{
|
||||
@@ -68,12 +68,12 @@ namespace AzToolsFramework
|
||||
SourceControlThumbnail::SourceControlThumbnail(SharedThumbnailKey key)
|
||||
: Thumbnail(key)
|
||||
{
|
||||
const char* engineRoot = nullptr;
|
||||
AzFramework::ApplicationRequests::Bus::BroadcastResult(engineRoot, &AzFramework::ApplicationRequests::GetEngineRoot);
|
||||
AZ_Assert(engineRoot, "Engine Root not initialized");
|
||||
AZ::IO::FixedMaxPath engineRoot = AZ::Utils::GetEnginePath();
|
||||
AZ_Assert(!engineRoot.empty(), "Engine Root not initialized");
|
||||
|
||||
m_writableIconPath = (engineRoot / WRITABLE_ICON_PATH).String();
|
||||
m_nonWritableIconPath = (engineRoot / NONWRITABLE_ICON_PATH).String();
|
||||
|
||||
AzFramework::StringFunc::Path::Join(engineRoot, WRITABLE_ICON_PATH, m_writableIconPath);
|
||||
AzFramework::StringFunc::Path::Join(engineRoot, NONWRITABLE_ICON_PATH, m_nonWritableIconPath);
|
||||
|
||||
BusConnect();
|
||||
}
|
||||
@@ -90,8 +90,8 @@ namespace AzToolsFramework
|
||||
AZ_Assert(sourceControlKey, "Incorrect key type, excpected SourceControlThumbnailKey");
|
||||
|
||||
AZStd::string myFileName(sourceControlKey->GetFileName());
|
||||
AzFramework::StringFunc::Path::Normalize(myFileName);
|
||||
if (AzFramework::StringFunc::Equal(myFileName.c_str(), filename))
|
||||
AZ::StringFunc::Path::Normalize(myFileName);
|
||||
if (AZ::StringFunc::Equal(myFileName.c_str(), filename))
|
||||
{
|
||||
Update();
|
||||
}
|
||||
|
||||
@@ -1116,7 +1116,6 @@ namespace UnitTest
|
||||
SerializeContext* GetSerializeContext() override { return m_serializeContext.get(); }
|
||||
BehaviorContext* GetBehaviorContext() override { return nullptr; }
|
||||
JsonRegistrationContext* GetJsonRegistrationContext() override { return nullptr; }
|
||||
const char* GetAppRoot() const override { return nullptr; }
|
||||
const char* GetEngineRoot() const override { return nullptr; }
|
||||
const char* GetExecutableFolder() const override { return nullptr; }
|
||||
void EnumerateEntities(const EntityCallback& /*callback*/) override {}
|
||||
|
||||
@@ -36,11 +36,6 @@ namespace UnitTest
|
||||
: public ComponentApplication
|
||||
{
|
||||
public:
|
||||
void SetExecutableFolder(const char* path)
|
||||
{
|
||||
m_exeDirectory = path;
|
||||
}
|
||||
|
||||
void SetSettingsRegistrySpecializations(SettingsRegistryInterface::Specializations& specializations) override
|
||||
{
|
||||
ComponentApplication::SetSettingsRegistrySpecializations(specializations);
|
||||
|
||||
Reference in New Issue
Block a user