Integrating latest from github/staging
Integrating up through commit 5e1bdae
This commit is contained in:
@@ -120,20 +120,8 @@ namespace AssetBundler
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
extern const char* AssetCatalogFilename;
|
||||
extern char g_cachedEngineRoot[AZ_MAX_PATH_LEN];
|
||||
static const size_t MaxErrorMessageLength = 4096;
|
||||
|
||||
//! This struct stores gem related information
|
||||
struct GemInfo
|
||||
{
|
||||
AZ_CLASS_ALLOCATOR(GemInfo, AZ::SystemAllocator, 0);
|
||||
GemInfo(AZStd::string name, AZStd::string relativeFilePath, AZStd::string absoluteFilePath);
|
||||
GemInfo() = default;
|
||||
AZStd::string m_gemName;
|
||||
AZStd::string m_relativeFilePath;
|
||||
AZStd::string m_absoluteFilePath;
|
||||
};
|
||||
|
||||
|
||||
// The Warning Absorber is used to absorb warnings
|
||||
// One case that this is being used is during loading of the asset catalog.
|
||||
@@ -149,14 +137,8 @@ namespace AssetBundler
|
||||
bool OnPreWarning(const char* window, const char* fileName, int line, const char* func, const char* message) override;
|
||||
};
|
||||
|
||||
// computes the asset alias and game name either through the asset catalog file provided by the user or using the platform and game folder
|
||||
AZ::Outcome<void, AZStd::string> ComputeAssetAliasAndGameName(const AZStd::string& platformIdentifier, const AZStd::string& assetCatalogFile, AZStd::string& assetAlias, AZStd::string& gameName);
|
||||
|
||||
// Computes the engine root and cache it locally
|
||||
bool ComputeEngineRoot();
|
||||
|
||||
// Retrurns the engine root
|
||||
const char* GetEngineRoot();
|
||||
// Returns the engine root
|
||||
AZ::IO::FixedMaxPath GetEngineRoot();
|
||||
|
||||
/**
|
||||
* Determines the name of the currently enabled game project
|
||||
@@ -166,58 +148,51 @@ namespace AssetBundler
|
||||
|
||||
|
||||
/**
|
||||
* Constructs an absolute path to the project folder found at: dev/ProjectName
|
||||
* @param engineRoot The absolute path of the dev/ folder
|
||||
* @param projectName A project present in the dev/ folder
|
||||
* Retrieve the project path from the Settings Registry
|
||||
* @return Absolute path of the Project Folder on success, error message on failure
|
||||
*/
|
||||
AZ::Outcome<AZStd::string, AZStd::string> GetProjectFolderPath(const AZStd::string& engineRoot, const AZStd::string& projectName);
|
||||
AZ::Outcome<AZ::IO::Path, AZStd::string> GetProjectFolderPath();
|
||||
|
||||
/**
|
||||
* Constructs an absolute path to the project-specific cache folder found at: dev/Cache/ProjectName
|
||||
* @param engineRoot The absolute path of the dev/ folder
|
||||
* @param projectName A project present in the dev/ folder
|
||||
* Retrieve the project path from the Settings Registry
|
||||
* @return Absolute path of the project-specific cache folder on success, error message on failure
|
||||
*/
|
||||
AZ::Outcome<AZStd::string, AZStd::string> GetProjectCacheFolderPath(const AZStd::string& engineRoot, const AZStd::string& projectName);
|
||||
AZ::Outcome<AZ::IO::Path, AZStd::string> GetProjectCacheFolderPath();
|
||||
|
||||
/**
|
||||
* Calculates the list of enabled platforms for the input project by reading the folder names inside the project-specific cache folder.
|
||||
* If the Asset Processor has not been run yet, or has not been run since the enabled platform list inside AssetProcessorPlatformConfig.ini
|
||||
* If the Asset Processor has not been run yet, or has not been run since the enabled platform list inside AssetProcessorPlatformConfig.setreg
|
||||
* was changed, the output of this function will be incorrect.
|
||||
*
|
||||
* @param projectCacheFolder The directory of a project-specific cache folder: dev/Cache/ProjectName
|
||||
* @param projectCacheFolder The directory of a project-specific cache folder: /ProjectPath/Cache
|
||||
* @param platformNames [out] The list of platforms enabled in the project
|
||||
* @return void on success, error message on failure
|
||||
*/
|
||||
AZ::Outcome<void, AZStd::string> GetPlatformNamesFromCacheFolder(const AZStd::string& projectCacheFolder, AZStd::vector<AZStd::string>& platformNames);
|
||||
AZ::Outcome<void, AZStd::string> GetPlatformNamesFromCacheFolder(AZStd::vector<AZStd::string>& platformNames);
|
||||
|
||||
/**
|
||||
* Computes the absolute path to the Asset Catalog file for a specified project and platform.
|
||||
* With platform set as "pc" and project as "ProjectName", the path will resemble: C:/dev/Cache/ProjectName/pc/projectname/assetcatalog.xml
|
||||
* With platform set as "pc" and project as "ProjectName", the path will resemble: C:/ProjectPath/Cache/pc/assetcatalog.xml
|
||||
*
|
||||
* @param pathToCacheFolder The absolute path to the Cache folder. ex: C:/dev/Cache
|
||||
* @param pathToCacheFolder The absolute path to the Cache folder. ex: C:/ProjectPath/Cache
|
||||
* @param platformIdentifier The platform identifier of the desired Asset Catalog. Valid inputs can be found by reading the folder names
|
||||
* found inside dev/Cache/ProjectName
|
||||
* found inside ProjectPath/Cache
|
||||
* @param projectName The name of the project you want to search
|
||||
* @return Absolute Path to the Asset Catalog file on success, error message on failure
|
||||
*/
|
||||
AZ::Outcome<AZStd::string, AZStd::string> GetAssetCatalogFilePath(const char* pathToCacheFolder, const char* platformIdentifier, const char* projectName);
|
||||
AZ::Outcome<AZ::IO::Path, AZStd::string> GetAssetCatalogFilePath();
|
||||
|
||||
/**
|
||||
* Computes the absolute path to the platform-specific Cache folder where product assets are stored.
|
||||
* With platform set as "pc" and project as "ProjectName", the path will resemble: C:/dev/Cache/ProjectName/pc/projectname/
|
||||
* With platform set as "pc" the path will resemble: C:/ProjectPath/Cache/pc/projectname/
|
||||
*
|
||||
* @param projectSpecificCacheFolderAbsolutePath The absolute path to the Cache folder. Example: C:/dev/Cache/ProjectName
|
||||
* @param projectSpecificCacheFolderAbsolutePath The absolute path to the Cache folder. Example: C:/ProjectPath/Cache
|
||||
* @param platform the platform of the desired cache location
|
||||
* @param projectName The name of the current project
|
||||
* @return Absolute path to the platform-specific Cache folder where product assets are stored
|
||||
*/
|
||||
AZStd::string GetPlatformSpecificCacheFolderPath(const AZStd::string& projectSpecificCacheFolderAbsolutePath, const AZStd::string& platform, const AZStd::string& projectName);
|
||||
AZ::IO::Path GetPlatformSpecificCacheFolderPath();
|
||||
|
||||
AZStd::string GenerateKeyFromAbsolutePath(const AZStd::string& absoluteFilePath);
|
||||
|
||||
void ConvertToRelativePath(const AZStd::string& parentFolderPath, AZStd::string& absoluteFilePath);
|
||||
void ConvertToRelativePath(AZStd::string_view parentFolderPath, AZStd::string& absoluteFilePath);
|
||||
|
||||
AZ::Outcome<void, AZStd::string> MakePath(const AZStd::string& path);
|
||||
|
||||
@@ -228,30 +203,31 @@ namespace AssetBundler
|
||||
AzFramework::PlatformFlags GetPlatformsOnDiskForPlatformSpecificFile(const AZStd::string& platformIndependentAbsolutePath);
|
||||
|
||||
//! Returns a map of <absolute file path, source folder display name> of all default Seed List files for the current game project.
|
||||
AZStd::unordered_map<AZStd::string, AZStd::string> GetDefaultSeedListFiles(const char* root, const char* projectName, const AZStd::vector<AzToolsFramework::AssetUtils::GemInfo>& gemInfoList, AzFramework::PlatformFlags platformFlags);
|
||||
AZStd::unordered_map<AZStd::string, AZStd::string> GetDefaultSeedListFiles(AZStd::string_view enginePath, AZStd::string_view projectPath,
|
||||
const AZStd::vector<AzFramework::GemInfo>& gemInfoList, AzFramework::PlatformFlags platformFlags);
|
||||
|
||||
//! Returns a vector of relative paths to Assets that should be included as default Seeds, but are not already in a Seed List file.
|
||||
AZStd::vector<AZStd::string> GetDefaultSeeds(const char* root, const char* projectName);
|
||||
AZStd::vector<AZStd::string> GetDefaultSeeds(AZStd::string_view enginePath, AZStd::string_view projectPath, AZStd::string_view projectName);
|
||||
|
||||
//! Returns the absolute path of {ProjectName}_Dependencies.xml
|
||||
AZStd::string GetProjectDependenciesFile(const char* root, const char* projectName);
|
||||
AZ::IO::Path GetProjectDependenciesFile(AZStd::string_view productPath, AZStd::string_view projectName);
|
||||
|
||||
//! Returns the absolute path of the project dependencies file in the default project template
|
||||
AZStd::string GetProjectDependenciesFileTemplate(const char* root);
|
||||
AZ::IO::Path GetProjectDependenciesFileTemplate(AZStd::string_view enginePath);
|
||||
|
||||
//! Creates the ProjectName_Dependencies.xml file if it does not exist, and adds returns the relative path to the asset in the Cache.
|
||||
AZStd::string GetProjectDependenciesAssetPath(const char* root, const char* projectName);
|
||||
AZ::IO::Path GetProjectDependenciesAssetPath(AZStd::string_view enginePath, AZStd::string_view projectPath, AZStd::string_view projectName);
|
||||
|
||||
//! Returns the map from gem seed list file path to gem name
|
||||
AZStd::unordered_map<AZStd::string, AZStd::string> GetGemSeedListFilePathToGemNameMap(const AZStd::vector<AzToolsFramework::AssetUtils::GemInfo>& gemInfoList, AzFramework::PlatformFlags platformFlags);
|
||||
AZStd::unordered_map<AZStd::string, AZStd::string> GetGemSeedListFilePathToGemNameMap(const AZStd::vector<AzFramework::GemInfo>& gemInfoList, AzFramework::PlatformFlags platformFlags);
|
||||
|
||||
//! Given an absolute gem seed file path determines whether the file is valid for the current game project.
|
||||
//! This method is for validating gem seed list files only.
|
||||
bool IsGemSeedFilePathValid(const char* root, AZStd::string seedAbsoluteFilePath, const AZStd::vector<AzToolsFramework::AssetUtils::GemInfo>& gemInfoList, AzFramework::PlatformFlags platformFlags);
|
||||
bool IsGemSeedFilePathValid(AZStd::string_view enginePath, AZStd::string seedAbsoluteFilePath, const AZStd::vector<AzFramework::GemInfo>& gemInfoList, AzFramework::PlatformFlags platformFlags);
|
||||
|
||||
//! Returns platformFlags of all enabled platforms by parsing all the asset processor config files.
|
||||
//! Please note that the game project could be in a different location to the engine therefore we need the assetRoot param.
|
||||
AzFramework::PlatformFlags GetEnabledPlatformFlags(const char* root, const char* assetRoot, const char* gameName);
|
||||
AzFramework::PlatformFlags GetEnabledPlatformFlags(AZStd::string_view enginePath, AZStd::string_view assetRoot, AZStd::string_view projectPath);
|
||||
|
||||
//! Filepath is a helper class that is used to find the absolute path of a file
|
||||
//! if the inputted file path is an absolute path than it does nothing
|
||||
|
||||
Reference in New Issue
Block a user