浏览代码

Changes to support Tool applications(Editor, AP, AssetBundler) in non-monolithic release (#17032)

* Changes to support tool applications in non-mono release

The Tool applications such as the Editor, AssetProcessor and
AssetBundler now can work in release configuration when NOT using the
monolithic-permutation.

There are two main changes.
1. Updated the default value for `sys_PakPriority` CVAR to change its
   file search priority to FileFirst in release configuration.
   Previously this was Pak only
2. Updated the Settings Registry Development Settings Overrides to allow
   merging from the engine, each active gem and the active project `Registry` folders when using the release configuration.

Both this changes combined allows the AssetProcessor and Editor to
locate the files within the project directory and to load necessary
settings registry files required for operation. For example the
AssetProcessor(Batch) needs to load the
`AssetProcessorPlatformConfig.setreg` from the `<engine-root>/Registry`
directory in order bootstrap the AP with enabled platforms, exclude
patterns, the location of the engine's and projects scan folders, etc...

Signed-off-by: lumberyard-employee-dm <[email protected]>

* Updating ScriptCanvas to allow the UnitTest testing nodes in release
configuration.

This fixe processing of the ScriptCanvas test assets.

Signed-off-by: lumberyard-employee-dm <[email protected]>

* Update Code/Framework/AzCore/AzCore/Component/ComponentApplication.cpp

Co-authored-by: Guthrie Adams <[email protected]>
Signed-off-by: lumberyard-employee-dm <[email protected]>

* Updated framework version in engine.json

With the changes to the `ALLOW_SETTINGS_REGISTRY_DEVELOPMENT_OVERRIDES` options  to support allowing setreg overrides from the Project, Engine, Gems only, the patch version is being updated to indicate to users a non-breaking change. 

Signed-off-by: lumberyard-employee-dm <[email protected]>

---------

Signed-off-by: lumberyard-employee-dm <[email protected]>
Co-authored-by: Guthrie Adams <[email protected]>
lumberyard-employee-dm 1 年之前
父节点
当前提交
e69db5ad67

+ 20 - 8
Code/Framework/AzCore/AzCore/Component/ComponentApplication.cpp

@@ -115,8 +115,9 @@ namespace AZ::Internal
     {
     {
         None, // 0 = no overrides are allowed
         None, // 0 = no overrides are allowed
         CommandLineOnly, // 1 = registry overrides are allowed from the command line
         CommandLineOnly, // 1 = registry overrides are allowed from the command line
-        CommandLineAndProject, // 2 = registry overrides are allowed from the command line, engine, gem, and project files
-        CommandLineProjectAndUser // 3 = registry overrides are allowed from the command line, engine, gem, project, and user files
+        ProjectOnly, // 2 = registry overrides are allowed from the engine, gem and project registry files
+        CommandLineAndProject, // 3 = registry overrides are allowed from the command line, engine, gem, and project files
+        CommandLineProjectAndUser // 4 = registry overrides are allowed from the command line, engine, gem, project, and user files
     };
     };
 
 
     //! Determines which development settings (user registry files, project registry files, etc) should
     //! Determines which development settings (user registry files, project registry files, etc) should
@@ -129,8 +130,8 @@ namespace AZ::Internal
         // is a debug, profile, or release build.
         // is a debug, profile, or release build.
         return static_cast<DevelopmentSettingsOverrides>(ALLOW_SETTINGS_REGISTRY_DEVELOPMENT_OVERRIDES);
         return static_cast<DevelopmentSettingsOverrides>(ALLOW_SETTINGS_REGISTRY_DEVELOPMENT_OVERRIDES);
 #elif AZ_RELEASE_BUILD
 #elif AZ_RELEASE_BUILD
-        // By default, if no compile setting was provided, turn off all overrides in release builds.
-        return DevelopmentSettingsOverrides::None;
+        // By default, if no compile setting was provided, allow overrides from the engine, gem and project registry files in release builds.
+        return DevelopmentSettingsOverrides::ProjectOnly;
 #else
 #else
         // By default, if no compile setting was provided, turn on all overrides in non-release builds.
         // By default, if no compile setting was provided, turn on all overrides in non-release builds.
         return DevelopmentSettingsOverrides::CommandLineProjectAndUser;
         return DevelopmentSettingsOverrides::CommandLineProjectAndUser;
@@ -1085,7 +1086,11 @@ namespace AZ
         const AZ::SettingsRegistryInterface::Specializations& specializations,
         const AZ::SettingsRegistryInterface::Specializations& specializations,
         AZStd::vector<char>& scratchBuffer)
         AZStd::vector<char>& scratchBuffer)
     {
     {
-        if constexpr (AZ::Internal::GetDevelopmentSettingsOverrides() >= AZ::Internal::DevelopmentSettingsOverrides::CommandLineOnly)
+        constexpr bool overridesAllowedFromCommandLine =
+            AZ::Internal::GetDevelopmentSettingsOverrides() == AZ::Internal::DevelopmentSettingsOverrides::CommandLineOnly ||
+            AZ::Internal::GetDevelopmentSettingsOverrides() == AZ::Internal::DevelopmentSettingsOverrides::CommandLineAndProject ||
+            AZ::Internal::GetDevelopmentSettingsOverrides() == AZ::Internal::DevelopmentSettingsOverrides::CommandLineProjectAndUser;
+        if constexpr (overridesAllowedFromCommandLine)
         {
         {
             if constexpr (
             if constexpr (
                 AZ::Internal::GetDevelopmentSettingsOverrides() == AZ::Internal::DevelopmentSettingsOverrides::CommandLineProjectAndUser)
                 AZ::Internal::GetDevelopmentSettingsOverrides() == AZ::Internal::DevelopmentSettingsOverrides::CommandLineProjectAndUser)
@@ -1129,8 +1134,11 @@ namespace AZ
             registry, AZ_TRAIT_OS_PLATFORM_CODENAME, specializations, &scratchBuffer);
             registry, AZ_TRAIT_OS_PLATFORM_CODENAME, specializations, &scratchBuffer);
 
 
 #if AZ_TRAIT_OS_IS_HOST_OS_PLATFORM
 #if AZ_TRAIT_OS_IS_HOST_OS_PLATFORM
-        if constexpr (
-            AZ::Internal::GetDevelopmentSettingsOverrides() >= AZ::Internal::DevelopmentSettingsOverrides::CommandLineAndProject)
+        constexpr bool overridesAllowedFromProjectRegistries =
+            AZ::Internal::GetDevelopmentSettingsOverrides() == AZ::Internal::DevelopmentSettingsOverrides::ProjectOnly ||
+            AZ::Internal::GetDevelopmentSettingsOverrides() == AZ::Internal::DevelopmentSettingsOverrides::CommandLineAndProject ||
+            AZ::Internal::GetDevelopmentSettingsOverrides() == AZ::Internal::DevelopmentSettingsOverrides::CommandLineProjectAndUser;
+        if constexpr (overridesAllowedFromProjectRegistries)
         {
         {
             AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_EngineRegistry(
             AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_EngineRegistry(
                 registry, AZ_TRAIT_OS_PLATFORM_CODENAME, specializations, &scratchBuffer);
                 registry, AZ_TRAIT_OS_PLATFORM_CODENAME, specializations, &scratchBuffer);
@@ -1147,7 +1155,11 @@ namespace AZ
         const AZ::SettingsRegistryInterface::Specializations& specializations,
         const AZ::SettingsRegistryInterface::Specializations& specializations,
         AZStd::vector<char>& scratchBuffer)
         AZStd::vector<char>& scratchBuffer)
     {
     {
-        if constexpr (AZ::Internal::GetDevelopmentSettingsOverrides() >= AZ::Internal::DevelopmentSettingsOverrides::CommandLineOnly)
+        constexpr bool overridesAllowedFromCommandLine =
+            AZ::Internal::GetDevelopmentSettingsOverrides() == AZ::Internal::DevelopmentSettingsOverrides::CommandLineOnly ||
+            AZ::Internal::GetDevelopmentSettingsOverrides() == AZ::Internal::DevelopmentSettingsOverrides::CommandLineAndProject ||
+            AZ::Internal::GetDevelopmentSettingsOverrides() == AZ::Internal::DevelopmentSettingsOverrides::CommandLineProjectAndUser;
+        if constexpr (overridesAllowedFromCommandLine)
         {
         {
             if constexpr (
             if constexpr (
                 AZ::Internal::GetDevelopmentSettingsOverrides() == AZ::Internal::DevelopmentSettingsOverrides::CommandLineProjectAndUser)
                 AZ::Internal::GetDevelopmentSettingsOverrides() == AZ::Internal::DevelopmentSettingsOverrides::CommandLineProjectAndUser)

+ 4 - 3
Code/Framework/AzCore/CMakeLists.txt

@@ -22,15 +22,16 @@ endif()
 
 
 # By default, the Settings Registry will apply user and project registry files as overrides in development (non-release) builds,
 # By default, the Settings Registry will apply user and project registry files as overrides in development (non-release) builds,
 # and will ignore all overrides in release builds.
 # and will ignore all overrides in release builds.
-# This behavior can be overridden by passing -DALLOW_SETTINGS_REGISTRY_DEVELOPMENT_OVERRIDES=0, 1, 2 or 3 when generating the build files.
+# This behavior can be overridden by passing -DALLOW_SETTINGS_REGISTRY_DEVELOPMENT_OVERRIDES=0, 1, 2, 3 or 4 when generating the build files.
 # The override can be removed by passing -UALLOW_SETTINGS_REGISTRY_DEVELOPMENT_OVERRIDES when generating the build files.
 # The override can be removed by passing -UALLOW_SETTINGS_REGISTRY_DEVELOPMENT_OVERRIDES when generating the build files.
 set(ALLOW_SETTINGS_REGISTRY_DEVELOPMENT_OVERRIDES "" CACHE STRING 
 set(ALLOW_SETTINGS_REGISTRY_DEVELOPMENT_OVERRIDES "" CACHE STRING 
 "Forces the Settings Registry development overrides to be used or ignored.
 "Forces the Settings Registry development overrides to be used or ignored.
   If unset, development overrides are used in development builds and ignored in release builds.
   If unset, development overrides are used in development builds and ignored in release builds.
   0 disables the development overrides in all builds.
   0 disables the development overrides in all builds.
   1 = registry overrides are allowed from the command line.
   1 = registry overrides are allowed from the command line.
-  2 = registry overrides are allowed from the command line, engine, gem, and project files.
-  3 = registry overrides are allowed from the command line, engine, gem, project, and user files.")
+  2 = registry overrides are allowed from the engine, gem, and project files (not command line).
+  3 = registry overrides are allowed from the command line, engine, gem, and project files.
+  4 = registry overrides are allowed from the command line, engine, gem, project, and user files.")
 
 
 # If there's a value in ALLOW_SETTINGS_REGISTRY_DEVELOPMENT_OVERRIDES, the compiler flag will get set to it.
 # If there's a value in ALLOW_SETTINGS_REGISTRY_DEVELOPMENT_OVERRIDES, the compiler flag will get set to it.
 # Otherwise, the variable will be empty and no compiler flag will be set, leaving it to the code to decide
 # Otherwise, the variable will be empty and no compiler flag will be set, leaving it to the code to decide

+ 1 - 1
Code/Framework/AzFramework/AzFramework/Archive/Archive.cpp

@@ -43,7 +43,7 @@
 namespace AZ::IO
 namespace AZ::IO
 {
 {
     AZ_CVAR(int, sys_PakPriority, aznumeric_cast<int>(ArchiveVars{}.m_fileSearchPriority), nullptr, AZ::ConsoleFunctorFlags::DontReplicate,
     AZ_CVAR(int, sys_PakPriority, aznumeric_cast<int>(ArchiveVars{}.m_fileSearchPriority), nullptr, AZ::ConsoleFunctorFlags::DontReplicate,
-        "If set to 0, tells Archive to try to open the file on the file system first othewise check mounted paks.\n"
+        "If set to 0, tells Archive to try to open the file on the file system first otherwise check mounted paks.\n"
         "If set to 1, tells Archive to try to open the file in pak first, then go to file system.\n"
         "If set to 1, tells Archive to try to open the file in pak first, then go to file system.\n"
         "If set to 2, tells the Archive to only open files from the pak");
         "If set to 2, tells the Archive to only open files from the pak");
     AZ_CVAR(int, sys_report_files_not_found_in_paks, 0, nullptr, AZ::ConsoleFunctorFlags::DontReplicate,
     AZ_CVAR(int, sys_report_files_not_found_in_paks, 0, nullptr, AZ::ConsoleFunctorFlags::DontReplicate,

+ 1 - 3
Code/Framework/AzFramework/AzFramework/Archive/ArchiveVars.cpp

@@ -16,9 +16,7 @@ namespace AZ::IO
 #if defined(LY_ARCHIVE_FILE_SEARCH_MODE)
 #if defined(LY_ARCHIVE_FILE_SEARCH_MODE)
         return FileSearchPriority{ LY_ARCHIVE_FILE_SEARCH_MODE };
         return FileSearchPriority{ LY_ARCHIVE_FILE_SEARCH_MODE };
 #else
 #else
-        return FileSearchPriority{ !ArchiveVars::IsReleaseConfig
-            ? FileSearchPriority::FileFirst
-            : FileSearchPriority::PakOnly };
+        return FileSearchPriority{ FileSearchPriority::FileFirst };
 #endif
 #endif
     }
     }
 }
 }

+ 2 - 2
Code/Framework/AzFramework/AzFramework/feature_options.cmake

@@ -8,6 +8,6 @@
 
 
 set(LY_ARCHIVE_FILE_SEARCH_MODE "" CACHE STRING "Set the default file search mode to locate non-Pak files within the Archive System\n\
 set(LY_ARCHIVE_FILE_SEARCH_MODE "" CACHE STRING "Set the default file search mode to locate non-Pak files within the Archive System\n\
     Valid values are:\n\
     Valid values are:\n\
-    0 = Search FileSystem first, before searching within mounted Paks (default in debug/profile)\n\
+    0 = Search FileSystem first, before searching within mounted Paks (default in debug/profile/release)\n\
     1 = Search mounted Paks first, before searching FileSystem\n\
     1 = Search mounted Paks first, before searching FileSystem\n\
-    2 = Search only mounted Paks (default in release)\n")
+    2 = Search only mounted Paks\n")

+ 1 - 1
Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Libraries.cpp

@@ -156,7 +156,7 @@ namespace ScriptCanvas
         LogicLibrary::Reflect(reflectContext);
         LogicLibrary::Reflect(reflectContext);
         OperatorsLibrary::Reflect(reflectContext);
         OperatorsLibrary::Reflect(reflectContext);
 
 
-#ifndef _RELEASE
+#if !defined(AZ_MONOLITHIC_BUILD)
         UnitTestingLibrary::Reflect(reflectContext);
         UnitTestingLibrary::Reflect(reflectContext);
 #endif
 #endif
     }
     }

+ 1 - 1
Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/UnitTesting/UnitTestingLibrary.cpp

@@ -6,7 +6,7 @@
  *
  *
  */
  */
 
 
-#ifndef _RELEASE
+#if !defined(AZ_MONOLITHIC_BUILD)
 
 
 #include "UnitTestingLibrary.h"
 #include "UnitTestingLibrary.h"
 
 

+ 1 - 1
engine.json

@@ -7,7 +7,7 @@
     "version": "3.0.0",
     "version": "3.0.0",
     "api_versions": {
     "api_versions": {
         "editor": "1.0.0",
         "editor": "1.0.0",
-        "framework": "1.2.0",
+        "framework": "1.2.1",
         "launcher": "1.0.0",
         "launcher": "1.0.0",
         "tools": "1.1.0"
         "tools": "1.1.0"
     },
     },