Integrating latest from github/staging

Integrating up through commit 5e1bdae
This commit is contained in:
alexpete
2021-03-26 14:31:50 -07:00
parent 9c54341af8
commit 36c4e827bd
764 changed files with 11453 additions and 20251 deletions
@@ -3330,7 +3330,6 @@ void ResourceCompiler::RegisterDefaultKeys()
RegisterKey("unattended", "Prevents RC from opening any dialogs or message boxes");
RegisterKey("createjobs", "Instructs RC to read the specified input file (a CreateJobsRequest) and output a CreateJobsResponse");
RegisterKey("port", "Specifies the port that should be used to connect to the asset processor. If not set, the default from the bootstrap cfg will be used instead");
RegisterKey("approot", "Specifies a custom directory for the engine root path. This path should contain bootstrap.cfg.");
RegisterKey("branchtoken", "Specifies a branchtoken that should be used by the RC to negotiate with the asset processor. if not set it will be set from the bootstrap file.");
RegisterKey("recompress", "Recompress a pack file during a copy job using the multi-variant process which picks the fastest decompressor");
RegisterKey("use_fastest", "Checks every compressor and uses the one that decompresses the data fastest when adding files to a PAK");
+13 -11
View File
@@ -32,7 +32,6 @@
#include <ResourceCompiler.h>
#include <IResourceCompilerHelper.h>
#include <CmdLine.h>
#include <ParseEngineConfig.h>
#include <CryLibrary.h>
#include <ZipEncryptor.h>
@@ -558,25 +557,28 @@ int rcmain(int argc, char** argv, [[maybe_unused]] char** envp)
RCLog("Initializing System");
string appRootInput = config.GetAsString("approot", "", "");
if (!appRootInput.empty())
{
rc.SetAppRootPath(appRootInput);
}
else
{
// Create a local SettingsRegistry to read the bootstrap.cfg settings if the appRoot hasn't been overriden
// on the command line
AZ::SettingsRegistryImpl settingsRegistry;
AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_Bootstrap(settingsRegistry);
string projectPath = config.GetAsString("gameroot", "", "");
if (!projectPath.empty())
{
const auto projectPathKey = AZ::SettingsRegistryInterface::FixedValueString::format(
"%s/project_path", AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey);
settingsRegistry.Set(projectPathKey, projectPath.c_str());
}
string gameName = config.GetAsString("gamesubdirectory", "", "");
if (!gameName.empty())
{
const auto gameFolderKey = AZ::SettingsRegistryInterface::FixedValueString::format("%s/sys_game_folder",
AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey);
settingsRegistry.Set(gameFolderKey, gameName);
const auto projectNameKey = AZ::SettingsRegistryInterface::FixedValueString::format(
"%s/project_name", AZ::SettingsRegistryMergeUtils::ProjectSettingsRootKey);
settingsRegistry.Set(projectNameKey, gameName.c_str());
}
AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(settingsRegistry);
// and because we're a tool, add the tool folders:
if (AZ::SettingsRegistryInterface::FixedValueString appRoot; settingsRegistry.Get(appRoot, AZ::SettingsRegistryMergeUtils::FilePathKey_EngineRootFolder))
@@ -24,6 +24,7 @@
#include <AzCore/Memory/AllocatorManager.h>
#include <AzCore/Memory/MemoryComponent.h>
#include <AzCore/Settings/SettingsRegistryMergeUtils.h>
#include <AzCore/Utils/Utils.h>
#include <AzToolsFramework/AssetBrowser/AssetBrowserComponent.h>
#include <AzFramework/TargetManagement/TargetManagementComponent.h>
#include <AzToolsFramework/SourceControl/PerforceComponent.h>
@@ -815,22 +816,18 @@ bool CStatCGFCompiler::CompileCGF(AssetBuilderSDK::ProcessJobResponse& response,
#endif
// If no game project was specified, then query it from the Settings Registry
if (gameFolder.length() == 0)
if (gameFolder.empty())
{
auto settingsRegistry = AZ::SettingsRegistry::Get();
auto gameFolderKey = AZ::SettingsRegistryInterface::FixedValueString::format("%s/%s",
AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey, AzFramework::AssetSystem::ProjectName);
if (settingsRegistry)
{
settingsRegistry->Get(gameFolder, gameFolderKey);
}
gameFolder = AZ::Utils::GetProjectName();
}
// If no asset root was specified, then query it from the application
if (assetRoot.length() == 0)
if (assetRoot.empty())
{
EBUS_EVENT_RESULT(assetRoot, AzFramework::ApplicationRequests::Bus, GetAssetRoot);
assetRoot += gameFolder;
if (auto settingsRegistry = AZ::SettingsRegistry::Get(); settingsRegistry != nullptr)
{
settingsRegistry->Get(assetRoot, AZ::SettingsRegistryMergeUtils::FilePathKey_CacheRootFolder);
}
}
const string sourceFile = m_CC.GetSourcePath();
@@ -17,6 +17,7 @@
#include <AssetBuilderSDK/AssetBuilderSDK.h>
#include <AzCore/Component/ComponentApplication.h>
#include <AzCore/UserSettings/UserSettingsComponent.h>
#include <AzCore/Utils/Utils.h>
#include <AzFramework/StringFunc/StringFunc.h>
#include <AzToolsFramework/Application/ToolsApplication.h>
#include "../CryEngine/Cry3DEngine/CGF/CGFLoader.h"
@@ -121,7 +122,7 @@ protected:
const AZStd::string engroot = AZ::Test::GetEngineRootPath();
AZ::IO::FileIOBase::GetInstance()->SetAlias("@engroot@", engroot.c_str());
AZ::IO::Path assetRoot(engroot);
AZ::IO::Path assetRoot(AZ::Utils::GetProjectPath());
assetRoot /= "Cache";
AZ::IO::FileIOBase::GetInstance()->SetAlias("@root@", assetRoot.c_str());
@@ -144,25 +144,35 @@ namespace AZ
AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddBuildSystemTargetSpecialization(
registry, AZ::RC::GetAssetBuilderTargetName());
//the project name can be overridden, check it
AZStd::string overrideProjectName;
overrideProjectName = m_context.m_config->GetAsString("gamesubdirectory", "", "");
AZ::CommandLine* commandLine = application.GetAzCommandLine();
AZStd::string overrideProjectPath = m_context.m_config->GetAsString("gameroot", "", "").c_str();
if (!overrideProjectPath.empty())
{
auto overrideArgs = AZStd::string::format(
"--regset=%s/project_path=%s", AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey, overrideProjectPath.c_str());
AZ::CommandLine::ParamContainer commandLineArgs;
commandLine->Dump(commandLineArgs);
commandLineArgs.emplace_back(overrideArgs.c_str(), overrideArgs.size());
commandLine->Parse(commandLineArgs);
}
AZStd::string overrideProjectName = m_context.m_config->GetAsString("gamesubdirectory", "", "").c_str();
if (!overrideProjectName.empty())
{
// Copy the gamesubdirectory argument into --regset command line parameter for the sys_game_folder
auto gameNameOverride = AZStd::string::format("--regset=%s/sys_game_folder=%s", AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey,
auto gameNameOverride = AZStd::string::format("--regset=%s/project_name=%s", AZ::SettingsRegistryMergeUtils::ProjectSettingsRootKey,
overrideProjectName.c_str());
AZ::CommandLine* commandLine = application.GetAzCommandLine();
auto settingsRegistry = AZ::SettingsRegistry::Get();
AZ::CommandLine::ParamContainer commandLineArgs;
commandLine->Dump(commandLineArgs);
commandLineArgs.emplace_back(gameNameOverride.c_str(), gameNameOverride.size());
commandLine->Parse(commandLineArgs);
AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_CommandLine(*settingsRegistry, *commandLine, false);
AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*settingsRegistry);
}
AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_CommandLine(registry, *commandLine, false);
AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(registry);
bool connectedToAP;
if (!PrepareForExporting(application, m_appRoot, connectedToAP))
{
@@ -233,7 +243,7 @@ namespace AZ
return &m_context;
}
bool SceneCompiler::PrepareForExporting(RCToolApplication& application, const AZStd::string& appRoot, bool& connectedToAssetProcessor)
bool SceneCompiler::PrepareForExporting(RCToolApplication& application, [[maybe_unused]] const AZStd::string& appRoot, bool& connectedToAssetProcessor)
{
// Not all Gems shutdown properly and leak memory, but this shouldn't
// prevent this builder from completing.
@@ -245,7 +255,6 @@ namespace AZ
descriptor.m_enableScriptReflection = false;
AZ::ComponentApplication::StartupParameters startupParam;
startupParam.m_appRootOverride = appRoot.c_str();
startupParam.m_loadDynamicModules = false;
application.Start(descriptor, startupParam);