Update the FileIO Aliases (#4186)
* Update the FileIOAlias naming to make the cache, project root and engine root paths more clear The alias of `@root@`, `@assets@`, and `@projectplatformcache@` has been collapsed to `@projectproductassets@` The alias of `@devroot@` and `@engroot@` has been collapsed to `@engroot@` The alias of `@devassets@` and `@projectroot@` has been collapsed to `@projectroot@` Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Updated use of devassets and devroot properties in python Those properties now use projectroot and engroot Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Updating the alias @engroot@ alias path comment in each platform specific LocalFileIO_*.cpp file Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Removed hardcoded size of 9 for the product asset alias. The ResolvePath function now just appends the @projectproductassets@ alias with the input path Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Remove duplicate @projectproductassets@ check in ProcessFileTreeRequest Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Fix for typos in Hydra python test Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Updated LocalFileIO::Copy call on Windows to use the Unicode aware CopyFileW API Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Updated the AWSMetreicsGemAllocatorFixture to properly suppress asset cache write errors for Test file creation. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Removed unneeded call to set the @projectproductasstes@ alias at the bottom of the AssetSeedManagerTest SetUp Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Added a deprecated alias map to the FileIO System When a deprecated alias is accessed, the FileIO System logs an AZ_Error and indicates the alias that should be used Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Updated python test scripts to use the projectroot binding Retrieving the AutomatedTesting project path based on "<devroot>/AutomatedTesting" has been removed. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Updated references to devroot and devgame within the codebase The GetAbsoluteDevGameFolderPath functions has been replaced with direct call to AZ::Utils::GetProjectPath The GetAbsoluteDevRootFolderPath functions has been replaced with direct calls to AZ::Utils::GetEnginePath Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Updated <engroot>/AutomatedTesting references to projectroot Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Replaced references that assumes the project path is <engroot>/AutomatedTesting with <projectroot> in the AutomatedTesting python test Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Correct casing in emfxworkspace file Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Removed newly added AppendPathParts function Removed the Path constructors which accepts a PathIterable instance The PathIterable isn't safe to return to a user of the Path class as it might be referencing temporary paths supplied via PathView arguments Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Fixed unused parameter warning Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Undid change to the LexicallyProximate function to set the path result to the base path. It needs to return the *this path if the pathResult is empty Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Moved the LocalFileIO ConvertToAbsolutePath implementations to AZ::Utils Fixed the ConvertToAbsolutePath implementation for Unix platforms to use a buffer that is size PATH_MAX(4096 on all our supported Unix platforms). Because the buffer before was AZ::IO::MaxPathLength which as a size of 1024, this was resulting in the Unix `realpath` function smashing the stack when it converts a path to an absolute path that is longer than 1024 characters Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Updated the EditorCore.Tests to attach the AZ Environment to the EditorCore shared library that is statically loaded on launch. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Fixed for DeprecatedAlaisesKeyVisitor Visit function causing the non string_view overloads being hidden causing a hidden base class function warning Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Changed the AWSMetricsGemMock to use a temporary for writing test assets Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Updated the LocalFileIO::ResolvePath function to use HasRootPath to determine if a path starts with a root path such as "D:", "D:/" or "/" IsAbsolute was not the corect check as the path of "D:" is a relative path. To be absolute according to the Windows the path must have a root directory. i.e "D:/" or "D:\" Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Removed absolute path comment from LocalFile_UnixLike.cpp and LocalFile_Android.cpp FindFiles implementations Updated the ConvertToAlias to supply an AZ::IO::FixedMaxPath Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Replaced usage of the @projectproductassets@ alias with @engroot@ when referring to the LmbrCentral source folder in the CopyDependencyBuilderTest and the SeedBuilderTests Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Updated the ScriptCanvas Upgrade Tool to output backed up files to the Project User Path instead of the engine root Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Fixed whitespacing issues in Application.cpp Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Remove unnecessary creation of a FixedMaxPath in the UpgradeTool.cpp Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Modified testSeedFolder variable in the SeedBuilderTests to use the @engroot@ alias instead of @projectproductassets@/.. alias when referring to the LmbrCentral Gem source path Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Updated references to the Project Asset Cache in the PythonTests. Those tests no longer use the logic `azlmbr.paths.projectroot / "Cache" / "pc"` to retrieve a path to the cache root but instead the `azlmbr.paths.projectproductassets` constant Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Fixed the FileIO Deprecated Alias test on Windows Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Removing @projectsourceassets@ alias, as it is only used once. Updated the PhysX EditorSystemComponent.cpp to query the ProjectPath form the SettingsRegistry. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Replaced @projectproductassets@ alias with @products@ Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Rollback changes to the PhysX EditorSystemComponent.cpp The changes to use the ProjectPath from the SettingsRegistry has been implemented in PR #4497 Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
643bd84739
commit
f648cb1fd8
@@ -27,7 +27,7 @@ namespace AWSNativeSDKInit
|
||||
void CopyCaCertBundle()
|
||||
{
|
||||
AZStd::vector<char> contents;
|
||||
AZStd::string certificatePath = "@assets@/certificates/aws/cacert.pem";
|
||||
AZStd::string certificatePath = "@products@/certificates/aws/cacert.pem";
|
||||
AZStd::string publicStoragePath = AZ::Android::Utils::GetAppPublicStoragePath();
|
||||
publicStoragePath.append("/certificates/aws/cacert.pem");
|
||||
|
||||
|
||||
@@ -683,31 +683,26 @@ void AssetBuilderComponent::ProcessJob(const AssetBuilderSDK::ProcessJobFunction
|
||||
AZ_Assert(settingsRegistry != nullptr, "SettingsRegistry must be ready for use in the AssetBuilder.");
|
||||
|
||||
// The root path is the cache plus the platform name.
|
||||
AZ::IO::FixedMaxPath newRoot(m_gameCache);
|
||||
AZ::IO::FixedMaxPath newProjectCache(m_gameCache);
|
||||
// Check if the platform identifier is a valid "asset platform"
|
||||
// If so, use it, other wise use the OS default platform as a fail safe
|
||||
// This is to make sure the "debug platform" isn't added as a path segment
|
||||
// the Cache Root folder
|
||||
// the Cache ProjectCache folder
|
||||
if (AzFramework::PlatformHelper::GetPlatformIdFromName(request.m_platformInfo.m_identifier) != AzFramework::PlatformId::Invalid)
|
||||
{
|
||||
newRoot /= request.m_platformInfo.m_identifier;
|
||||
newProjectCache /= request.m_platformInfo.m_identifier;
|
||||
}
|
||||
else
|
||||
{
|
||||
newRoot /= AzFramework::OSPlatformToDefaultAssetPlatform(AZ_TRAIT_OS_PLATFORM_CODENAME);
|
||||
newProjectCache /= AzFramework::OSPlatformToDefaultAssetPlatform(AZ_TRAIT_OS_PLATFORM_CODENAME);
|
||||
}
|
||||
|
||||
// The asset path is root and the lower case game name.
|
||||
AZ::IO::FixedMaxPath newAssets = newRoot;
|
||||
|
||||
// Now set the paths and run the job.
|
||||
{
|
||||
// Save out the prior paths.
|
||||
ScopedAliasSetter assetAliasScope(*ioBase, "@assets@", newAssets.c_str());
|
||||
ScopedAliasSetter rootAliasScope(*ioBase, "@root@", newRoot.c_str());
|
||||
ScopedAliasSetter projectplatformCacheAliasScope(*ioBase, "@projectplatformcache@", newRoot.c_str());
|
||||
ScopedAliasSetter projectPlatformCacheAliasScope(*ioBase, "@products@", newProjectCache.c_str());
|
||||
ScopedSettingsRegistrySetter cacheRootFolderScope(*settingsRegistry,
|
||||
AZ::SettingsRegistryMergeUtils::FilePathKey_CacheRootFolder, newRoot.Native());
|
||||
AZ::SettingsRegistryMergeUtils::FilePathKey_CacheRootFolder, newProjectCache.Native());
|
||||
|
||||
// Invoke the Process Job function
|
||||
job(request, outResponse);
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace AssetProcessor
|
||||
, m_registryBuiltOnce(false)
|
||||
, m_registriesMutex(QMutex::Recursive)
|
||||
{
|
||||
|
||||
|
||||
for (const AssetBuilderSDK::PlatformInfo& info : m_platformConfig->GetEnabledPlatforms())
|
||||
{
|
||||
m_platforms.push_back(QString::fromUtf8(info.m_identifier.c_str()));
|
||||
@@ -38,17 +38,9 @@ namespace AssetProcessor
|
||||
|
||||
// save 30mb for this. Really large projects do get this big (and bigger)
|
||||
// if you don't do this, things get fragmented very fast.
|
||||
m_saveBuffer.reserve(1024 * 1024 * 30);
|
||||
|
||||
m_absoluteDevFolderPath[0] = 0;
|
||||
m_absoluteDevGameFolderPath[0] = 0;
|
||||
m_saveBuffer.reserve(1024 * 1024 * 30);
|
||||
|
||||
AZStd::string engineRoot;
|
||||
AzFramework::ApplicationRequests::Bus::BroadcastResult(engineRoot, &AzFramework::ApplicationRequests::GetEngineRoot);
|
||||
azstrcpy(m_absoluteDevFolderPath, AZ_MAX_PATH_LEN, engineRoot.c_str());
|
||||
|
||||
AZStd::string gameFolderPath{AssetUtilities::ComputeProjectPath().toUtf8().constData()};
|
||||
azstrcpy(m_absoluteDevGameFolderPath, AZ_MAX_PATH_LEN, gameFolderPath.c_str());
|
||||
AssetUtilities::ComputeProjectPath();
|
||||
|
||||
AssetUtilities::ComputeProjectCacheRoot(m_cacheRootDir);
|
||||
|
||||
@@ -359,7 +351,7 @@ namespace AssetProcessor
|
||||
[[maybe_unused]] bool makeDirResult = AZ::IO::SystemFile::CreateDir(absPath.toUtf8().constData());
|
||||
AZ_Warning(AssetProcessor::ConsoleChannel, makeDirResult, "Failed create folder %s", platformCacheDir.toUtf8().constData());
|
||||
}
|
||||
|
||||
|
||||
// if we succeeded in doing this, then use "rename" to move the file over the previous copy.
|
||||
bool moved = AssetUtilities::MoveFileWithTimeout(tempRegistryFile, actualRegistryFile, 3);
|
||||
allCatalogsSaved = allCatalogsSaved && moved;
|
||||
@@ -382,7 +374,7 @@ namespace AssetProcessor
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
// scoped to minimize the duration of this mutex lock
|
||||
QMutexLocker locker(&m_savingRegistryMutex);
|
||||
@@ -605,7 +597,7 @@ namespace AssetProcessor
|
||||
|
||||
AZStd::string nameForMap(relativeFilePath.toUtf8().constData());
|
||||
AZStd::to_lower(nameForMap.begin(), nameForMap.end());
|
||||
|
||||
|
||||
m_sourceNameToSourceUUIDMap.insert({ nameForMap, sourceUuid });
|
||||
}
|
||||
|
||||
@@ -627,16 +619,6 @@ namespace AssetProcessor
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
const char* AssetCatalog::GetAbsoluteDevGameFolderPath()
|
||||
{
|
||||
return m_absoluteDevGameFolderPath;
|
||||
}
|
||||
|
||||
const char* AssetCatalog::GetAbsoluteDevRootFolderPath()
|
||||
{
|
||||
return m_absoluteDevFolderPath;
|
||||
}
|
||||
|
||||
bool AssetCatalog::GetRelativeProductPathFromFullSourceOrProductPath(const AZStd::string& fullSourceOrProductPath, AZStd::string& relativeProductPath)
|
||||
{
|
||||
ProcessGetRelativeProductPathFromFullSourceOrProductPathRequest(fullSourceOrProductPath, relativeProductPath);
|
||||
@@ -976,7 +958,7 @@ namespace AssetProcessor
|
||||
|
||||
// regardless of which way we come into this function we must always use ConvertToRelativePath
|
||||
// to convert from whatever the input format is to a database path (which may include output prefix)
|
||||
QString databaseName;
|
||||
QString databaseName;
|
||||
QString scanFolder;
|
||||
if (!AzFramework::StringFunc::Path::IsRelative(sourcePath))
|
||||
{
|
||||
@@ -1163,7 +1145,7 @@ namespace AssetProcessor
|
||||
AZStd::string AssetCatalog::GetAssetPathById(const AZ::Data::AssetId& id)
|
||||
{
|
||||
return GetAssetInfoById(id).m_relativePath;
|
||||
|
||||
|
||||
}
|
||||
|
||||
AZ::Data::AssetId AssetCatalog::GetAssetIdByPath(const char* path, const AZ::Data::AssetType& typeToRegister, bool autoRegisterIfNotFound)
|
||||
@@ -1175,7 +1157,7 @@ namespace AssetProcessor
|
||||
AZStd::string relProductPath;
|
||||
GetRelativeProductPathFromFullSourceOrProductPath(path, relProductPath);
|
||||
QString tempPlatformName = GetDefaultAssetPlatform();
|
||||
|
||||
|
||||
AZ::Data::AssetId assetId;
|
||||
{
|
||||
QMutexLocker locker(&m_registriesMutex);
|
||||
@@ -1344,7 +1326,7 @@ namespace AssetProcessor
|
||||
//remove aliases if present
|
||||
normalisedAssetPath = AssetUtilities::NormalizeAndRemoveAlias(normalisedAssetPath);
|
||||
|
||||
if (!normalisedAssetPath.isEmpty()) // this happens if it comes in as just for example "@assets@/"
|
||||
if (!normalisedAssetPath.isEmpty()) // this happens if it comes in as just for example "@products@/"
|
||||
{
|
||||
AZStd::lock_guard<AZStd::mutex> lock(m_databaseMutex);
|
||||
|
||||
@@ -1439,7 +1421,7 @@ namespace AssetProcessor
|
||||
relativePath = entry.m_sourceName;
|
||||
|
||||
watchFolder = scanEntry.m_scanFolder;
|
||||
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1489,7 +1471,7 @@ namespace AssetProcessor
|
||||
{
|
||||
return foundIter->second;
|
||||
}
|
||||
|
||||
|
||||
// we did not find it - try the backup mapping!
|
||||
AssetId legacyMapping = registryToUse.GetAssetIdByLegacyAssetId(assetId);
|
||||
if (legacyMapping.IsValid())
|
||||
@@ -1533,7 +1515,7 @@ namespace AssetProcessor
|
||||
|
||||
return !assetInfo.m_relativePath.empty();
|
||||
}
|
||||
|
||||
|
||||
// Asset isn't in the DB or in the APM queue, we don't know what this asset ID is
|
||||
return false;
|
||||
}
|
||||
@@ -1588,7 +1570,7 @@ namespace AssetProcessor
|
||||
AZStd::string sourceFileFullPath;
|
||||
AzFramework::StringFunc::Path::Join(watchFolder.c_str(), assetInfo.m_relativePath.c_str(), sourceFileFullPath);
|
||||
assetInfo.m_sizeBytes = AZ::IO::SystemFile::Length(sourceFileFullPath.c_str());
|
||||
|
||||
|
||||
assetInfo.m_assetType = AZ::Uuid::CreateNull(); // most source files don't have a type!
|
||||
|
||||
// Go through the list of source assets and see if this asset's file path matches any of the filters
|
||||
|
||||
@@ -88,8 +88,6 @@ namespace AssetProcessor
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// AzToolsFramework::AssetSystem::AssetSystemRequestBus::Handler overrides
|
||||
const char* GetAbsoluteDevGameFolderPath() override;
|
||||
const char* GetAbsoluteDevRootFolderPath() override;
|
||||
bool GetRelativeProductPathFromFullSourceOrProductPath(const AZStd::string& fullPath, AZStd::string& relativeProductPath) override;
|
||||
|
||||
//! Given a partial or full source file path, respond with its relative path and the watch folder it is relative to.
|
||||
@@ -215,8 +213,6 @@ namespace AssetProcessor
|
||||
|
||||
AZStd::vector<char> m_saveBuffer; // so that we don't realloc all the time
|
||||
|
||||
char m_absoluteDevFolderPath[AZ_MAX_PATH_LEN];
|
||||
char m_absoluteDevGameFolderPath[AZ_MAX_PATH_LEN];
|
||||
QDir m_cacheRootDir;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -56,15 +56,8 @@ namespace AssetProcessor
|
||||
// cache this up front. Note that it can fail here, and will retry later.
|
||||
InitializeCacheRoot();
|
||||
|
||||
m_absoluteDevFolderPath[0] = 0;
|
||||
m_absoluteDevGameFolderPath[0] = 0;
|
||||
|
||||
QDir assetRoot;
|
||||
if (AssetUtilities::ComputeAssetRoot(assetRoot))
|
||||
{
|
||||
azstrcpy(m_absoluteDevFolderPath, AZ_MAX_PATH_LEN, assetRoot.absolutePath().toUtf8().constData());
|
||||
azstrcpy(m_absoluteDevGameFolderPath, AZ_MAX_PATH_LEN, AssetUtilities::ComputeProjectPath().toUtf8().constData());
|
||||
}
|
||||
AssetUtilities::ComputeAssetRoot(assetRoot);
|
||||
|
||||
using namespace AZStd::placeholders;
|
||||
|
||||
|
||||
@@ -440,8 +440,6 @@ namespace AssetProcessor
|
||||
AZStd::mutex m_sourceUUIDToSourceInfoMapMutex;
|
||||
|
||||
QString m_normalizedCacheRootPath;
|
||||
char m_absoluteDevFolderPath[AZ_MAX_PATH_LEN];
|
||||
char m_absoluteDevGameFolderPath[AZ_MAX_PATH_LEN];
|
||||
QDir m_cacheRootDir;
|
||||
bool m_isCurrentlyScanning = false;
|
||||
bool m_quitRequested = false;
|
||||
|
||||
@@ -95,7 +95,7 @@ void FileServer::ConnectionAdded(unsigned int connId, Connection* connection)
|
||||
Q_UNUSED(connection);
|
||||
|
||||
// Connection has not completed negotiation yet, register to be notified
|
||||
// when we know what platform is connected and map the @assets@ alias then
|
||||
// when we know what platform is connected and map the @products@ alias then
|
||||
connect(connection, &Connection::AssetPlatformChanged, this, [this, connection]()
|
||||
{
|
||||
auto fileIO = m_fileIOs[connection->ConnectionId()];
|
||||
@@ -114,8 +114,7 @@ void FileServer::ConnectionAdded(unsigned int connId, Connection* connection)
|
||||
projectCacheRoot = QDir(projectCacheRoot.absoluteFilePath(assetPlatform));
|
||||
}
|
||||
const char* projectCachePath = projectCacheRoot.absolutePath().toUtf8().data();
|
||||
fileIO->SetAlias("@assets@", projectCachePath);
|
||||
fileIO->SetAlias("@root@", projectCachePath);
|
||||
fileIO->SetAlias("@products@", projectCachePath);
|
||||
|
||||
if (auto settingsRegistry = AZ::SettingsRegistry::Get(); settingsRegistry != nullptr)
|
||||
{
|
||||
@@ -955,10 +954,10 @@ void FileServer::ProcessFileTreeRequest(unsigned int connId, unsigned int, unsig
|
||||
FileTreeResponse::FolderList folders;
|
||||
|
||||
AZStd::vector<AZ::OSString> untestedFolders;
|
||||
if (fileIO->IsDirectory("@assets@"))
|
||||
if (fileIO->IsDirectory("@products@"))
|
||||
{
|
||||
folders.push_back("@assets@");
|
||||
untestedFolders.push_back("@assets@");
|
||||
folders.push_back("@products@");
|
||||
untestedFolders.push_back("@products@");
|
||||
}
|
||||
if (fileIO->IsDirectory("@usercache@"))
|
||||
{
|
||||
@@ -975,11 +974,6 @@ void FileServer::ProcessFileTreeRequest(unsigned int connId, unsigned int, unsig
|
||||
folders.push_back("@log@");
|
||||
untestedFolders.push_back("@log@");
|
||||
}
|
||||
if (fileIO->IsDirectory("@root@"))
|
||||
{
|
||||
folders.push_back("@root@");
|
||||
untestedFolders.push_back("@root@");
|
||||
}
|
||||
|
||||
AZ::IO::Result res = ResultCode::Success;
|
||||
|
||||
|
||||
@@ -766,7 +766,7 @@ namespace AssetProcessor
|
||||
TEST_F(AssetCatalogTest_GetFullSourcePath, AliasedCachePath_ReturnsAbsolutePathToSource)
|
||||
{
|
||||
//feed it a path with alias and asset id
|
||||
QString fileToCheck = "@assets@/subfolder3/randomfileoutput.random1";
|
||||
QString fileToCheck = "@products@/subfolder3/randomfileoutput.random1";
|
||||
EXPECT_TRUE(TestGetFullSourcePath(fileToCheck, m_data->m_temporarySourceDir, true, "subfolder3/somerandomfile.random"));
|
||||
}
|
||||
|
||||
@@ -787,7 +787,7 @@ namespace AssetProcessor
|
||||
TEST_F(AssetCatalogTest_GetFullSourcePath, InvalidSourcePathContainingCacheAlias_ReturnsAbsolutePathToSource)
|
||||
{
|
||||
//feed it a path with alias and input name
|
||||
QString fileToCheck = "@assets@/somerandomfile.random";
|
||||
QString fileToCheck = "@products@/somerandomfile.random";
|
||||
EXPECT_TRUE(TestGetFullSourcePath(fileToCheck, m_data->m_temporarySourceDir, true, "subfolder3/somerandomfile.random"));
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ void RCcontrollerUnitTests::Reset()
|
||||
m_rcController.m_RCJobListModel.m_jobs.clear();
|
||||
m_rcController.m_RCJobListModel.m_jobsInFlight.clear();
|
||||
m_rcController.m_RCJobListModel.m_jobsInQueueLookup.clear();
|
||||
|
||||
|
||||
m_rcController.m_pendingCriticalJobsPerPlatform.clear();
|
||||
m_rcController.m_jobsCountPerPlatform.clear();
|
||||
|
||||
@@ -56,7 +56,7 @@ void RCcontrollerUnitTests::Reset()
|
||||
m_rcController.m_RCQueueSortModel.AttachToModel(&m_rcController.m_RCJobListModel);
|
||||
m_rcController.m_RCQueueSortModel.m_currentJobRunKeyToJobEntries.clear();
|
||||
m_rcController.m_RCQueueSortModel.m_currentlyConnectedPlatforms.clear();
|
||||
}
|
||||
}
|
||||
|
||||
void RCcontrollerUnitTests::StartTest()
|
||||
{
|
||||
@@ -183,11 +183,11 @@ void RCcontrollerUnitTests::RunRCControllerTests()
|
||||
QStringList tempJobNames;
|
||||
|
||||
// Note that while this is an OS-SPECIFIC path, this test does not actually invoke the file system
|
||||
// or file operators, so is purely doing in-memory testing. So the path does not actually matter and the
|
||||
// or file operators, so is purely doing in-memory testing. So the path does not actually matter and the
|
||||
// test should function on other operating systems too.
|
||||
|
||||
// test - exact match
|
||||
tempJobNames << "c:/somerandomfolder/dev/blah/test.dds";
|
||||
tempJobNames << "c:/somerandomfolder/dev/blah/test.dds";
|
||||
tempJobNames << "c:/somerandomfolder/dev/blah/test.cre"; // must not match
|
||||
|
||||
// test - NO MATCH
|
||||
@@ -218,7 +218,7 @@ void RCcontrollerUnitTests::RunRCControllerTests()
|
||||
|
||||
QList<RCJob*> createdJobs;
|
||||
|
||||
|
||||
|
||||
|
||||
for (QString name : tempJobNames)
|
||||
{
|
||||
@@ -270,7 +270,7 @@ void RCcontrollerUnitTests::RunRCControllerTests()
|
||||
|
||||
// EXACT MATCH TEST (with prefixes and such)
|
||||
NetworkRequestID requestID(1, 1234);
|
||||
m_rcController.OnRequestCompileGroup(requestID, "pc", "@assets@/blah/test.dds", AZ::Data::AssetId());
|
||||
m_rcController.OnRequestCompileGroup(requestID, "pc", "@products@/blah/test.dds", AZ::Data::AssetId());
|
||||
QCoreApplication::processEvents(QEventLoop::AllEvents);
|
||||
|
||||
// this should have matched exactly one item, and when we finish that item, it should terminate:
|
||||
@@ -626,9 +626,9 @@ void RCcontrollerUnitTests::RunRCControllerTests()
|
||||
jobdetailsB.m_jobEntry.m_watchFolderPath = scanFolderInfo.ScanPath();
|
||||
jobdetailsB.m_jobEntry.m_jobKey = "TestJobB";
|
||||
jobdetailsB.m_jobEntry.m_builderGuid = builderUuid;
|
||||
|
||||
|
||||
jobdetailsB.m_critical = true; //make jobB critical so that it will be analyzed first even though we want JobA to run first
|
||||
|
||||
|
||||
AssetBuilderSDK::SourceFileDependency sourceFileBDependency;
|
||||
sourceFileBDependency.m_sourceFileDependencyPath = "fileB.txt";
|
||||
|
||||
@@ -694,10 +694,10 @@ void RCcontrollerUnitTests::RunRCControllerTests()
|
||||
|
||||
m_rcController.DispatchJobs();
|
||||
UNIT_TEST_EXPECT_TRUE(UnitTestUtils::BlockUntil(allJobsCompleted, 5000));
|
||||
UNIT_TEST_EXPECT_TRUE(jobFinishedB);
|
||||
UNIT_TEST_EXPECT_TRUE(jobFinishedB);
|
||||
|
||||
// Now test the use case where we have a cyclic dependency,
|
||||
// although the order in which these job will start is not defined but we can ensure that
|
||||
// Now test the use case where we have a cyclic dependency,
|
||||
// although the order in which these job will start is not defined but we can ensure that
|
||||
// all the job finishes and RCController goes Idle
|
||||
allJobsCompleted = false;
|
||||
Reset();
|
||||
@@ -728,8 +728,8 @@ void RCcontrollerUnitTests::RunRCControllerTests()
|
||||
jobdetailsD.m_jobEntry.m_builderGuid = builderUuid;
|
||||
AssetBuilderSDK::SourceFileDependency sourceFileDDependency;
|
||||
sourceFileDDependency.m_sourceFileDependencyPath = "fileD.txt";
|
||||
|
||||
//creating cyclic job order dependencies i.e JobC and JobD have order job dependency on each other
|
||||
|
||||
//creating cyclic job order dependencies i.e JobC and JobD have order job dependency on each other
|
||||
AssetBuilderSDK::JobDependency jobDependencyC("TestJobC", "pc", AssetBuilderSDK::JobDependencyType::Order, sourceFileCDependency);
|
||||
AssetBuilderSDK::JobDependency jobDependencyD("TestJobD", "pc", AssetBuilderSDK::JobDependencyType::Order, sourceFileDDependency);
|
||||
jobdetailsC.m_jobDependencyList.push_back({ jobDependencyD });
|
||||
|
||||
@@ -262,11 +262,10 @@ namespace UnitTestUtils
|
||||
|
||||
AZ::IO::FileIOBase::SetInstance(m_localFileIO);
|
||||
|
||||
m_localFileIO->SetAlias("@assets@", (newDir + QString("/ALIAS/assets")).toUtf8().constData());
|
||||
m_localFileIO->SetAlias("@products@", (newDir + QString("/ALIAS/assets")).toUtf8().constData());
|
||||
m_localFileIO->SetAlias("@log@", (newDir + QString("/ALIAS/logs")).toUtf8().constData());
|
||||
m_localFileIO->SetAlias("@usercache@", (newDir + QString("/ALIAS/cache")).toUtf8().constData());
|
||||
m_localFileIO->SetAlias("@user@", (newDir + QString("/ALIAS/user")).toUtf8().constData());
|
||||
m_localFileIO->SetAlias("@root@", (newDir + QString("/ALIAS/root")).toUtf8().constData());
|
||||
}
|
||||
|
||||
~ScopedDir()
|
||||
|
||||
@@ -104,17 +104,17 @@ ApplicationManager::BeforeRunStatus GUIApplicationManager::BeforeRun()
|
||||
// The build process may leave behind some temporaries, try to delete them
|
||||
RemoveTemporaries();
|
||||
|
||||
QDir devRoot;
|
||||
AssetUtilities::ComputeAssetRoot(devRoot);
|
||||
QDir projectAssetRoot;
|
||||
AssetUtilities::ComputeAssetRoot(projectAssetRoot);
|
||||
#if defined(EXTERNAL_CRASH_REPORTING)
|
||||
CrashHandler::ToolsCrashHandler::InitCrashHandler("AssetProcessor", devRoot.absolutePath().toStdString());
|
||||
CrashHandler::ToolsCrashHandler::InitCrashHandler("AssetProcessor", projectAssetRoot.absolutePath().toStdString());
|
||||
#endif
|
||||
AssetProcessor::MessageInfoBus::Handler::BusConnect();
|
||||
|
||||
// we have to monitor both the cache folder and the database file and restart AP if either of them gets deleted
|
||||
// It is important to note that we are monitoring the parent folder and not the actual cache folder itself since
|
||||
// we want to handle the use case on Mac OS if the user moves the cache folder to the trash.
|
||||
m_qtFileWatcher.addPath(devRoot.absolutePath());
|
||||
m_qtFileWatcher.addPath(projectAssetRoot.absolutePath());
|
||||
|
||||
QDir projectCacheRoot;
|
||||
AssetUtilities::ComputeProjectCacheRoot(projectCacheRoot);
|
||||
@@ -615,7 +615,6 @@ void GUIApplicationManager::DirectoryChanged([[maybe_unused]] QString path)
|
||||
|
||||
void GUIApplicationManager::FileChanged(QString path)
|
||||
{
|
||||
QDir devRoot = ApplicationManager::GetSystemRoot();
|
||||
QDir projectCacheRoot;
|
||||
AssetUtilities::ComputeProjectCacheRoot(projectCacheRoot);
|
||||
QString assetDbPath = projectCacheRoot.filePath("assetdb.sqlite");
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace CrashHandler
|
||||
if (fileIO)
|
||||
{
|
||||
// If our devroot alias is available, use that
|
||||
const char* devAlias = fileIO->GetAlias("@devroot@");
|
||||
const char* devAlias = fileIO->GetAlias("@engroot@");
|
||||
if (devAlias)
|
||||
{
|
||||
return devAlias;
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace PythonBindingsExample
|
||||
TEST_F(PythonBindingsExampleTest, Application_ImportAzLmbrPaths_Works)
|
||||
{
|
||||
ApplicationParameters params;
|
||||
params.m_pythonStatement = "import azlmbr.paths; print (azlmbr.paths.engroot); print (azlmbr.paths.devroot)";
|
||||
params.m_pythonStatement = "import azlmbr.paths; print (azlmbr.paths.engroot)";
|
||||
EXPECT_TRUE(s_application->RunWithParameters(params));
|
||||
}
|
||||
|
||||
|
||||
@@ -14,8 +14,10 @@
|
||||
#include <AzCore/Memory/SystemAllocator.h>
|
||||
#include <AzCore/XML/rapidxml.h>
|
||||
#include <AzCore/XML/rapidxml_print.h>
|
||||
#include <AzCore/IO/Path/Path.h>
|
||||
#include <AzCore/IO/SystemFile.h>
|
||||
#include <AzCore/std/string/conversions.h>
|
||||
#include <AzCore/Settings/SettingsRegistryMergeUtils.h>
|
||||
#include <AzCore/Casting/numeric_cast.h>
|
||||
#include <AzFramework/StringFunc/StringFunc.h>
|
||||
#include <AzFramework/API/ApplicationAPI.h>
|
||||
@@ -170,11 +172,14 @@ namespace AZ
|
||||
{
|
||||
using AzToolsFramework::AssetSystemRequestBus;
|
||||
|
||||
const char* path = nullptr;
|
||||
AssetSystemRequestBus::BroadcastResult(path, &AssetSystemRequestBus::Events::GetAbsoluteDevGameFolderPath);
|
||||
if (path)
|
||||
AZ::IO::Path projectPath;
|
||||
if (auto settingsRegistry = AZ::SettingsRegistry::Get(); settingsRegistry != nullptr)
|
||||
{
|
||||
return path;
|
||||
settingsRegistry->Get(projectPath.Native(), AZ::SettingsRegistryMergeUtils::FilePathKey_ProjectPath);
|
||||
}
|
||||
if (!projectPath.empty())
|
||||
{
|
||||
return projectPath.Native();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
// SliceConverter reads in a slice file (saved in an ObjectStream format), instantiates it, creates a prefab out of the data,
|
||||
// and saves the prefab in a JSON format. This can be used for one-time migrations of slices or slice-based levels to prefabs.
|
||||
//
|
||||
//
|
||||
// If the slice contains legacy data, it will print out warnings / errors about the data that couldn't be serialized.
|
||||
// The prefab will be generated without that data.
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace AZ
|
||||
AZ_Error("SerializeContextTools", false, "Command line not available.");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
JsonSerializerSettings convertSettings;
|
||||
convertSettings.m_keepDefaults = commandLine->HasSwitch("keepdefaults");
|
||||
convertSettings.m_registrationContext = application.GetJsonRegistrationContext();
|
||||
@@ -82,7 +82,7 @@ namespace AZ
|
||||
// Load the asset catalog so that we can find any nested assets successfully. We also need to tick the tick bus
|
||||
// so that the OnCatalogLoaded event gets processed now, instead of during application shutdown.
|
||||
AZ::Data::AssetCatalogRequestBus::Broadcast(
|
||||
&AZ::Data::AssetCatalogRequestBus::Events::LoadCatalog, "@assets@/assetcatalog.xml");
|
||||
&AZ::Data::AssetCatalogRequestBus::Events::LoadCatalog, "@products@/assetcatalog.xml");
|
||||
application.Tick();
|
||||
|
||||
AZStd::string logggingScratchBuffer;
|
||||
@@ -870,7 +870,7 @@ namespace AZ
|
||||
|
||||
// Wait for the disconnect to finish.
|
||||
bool disconnected = false;
|
||||
AzFramework::AssetSystemRequestBus::BroadcastResult(disconnected,
|
||||
AzFramework::AssetSystemRequestBus::BroadcastResult(disconnected,
|
||||
&AzFramework::AssetSystem::AssetSystemRequests::WaitUntilAssetProcessorDisconnected, AZStd::chrono::seconds(30));
|
||||
|
||||
AZ_Error("Convert-Slice", disconnected, "Asset Processor failed to disconnect successfully.");
|
||||
|
||||
Reference in New Issue
Block a user