Merge pull request #3685 from aws-lumberyard-dev/cgalvan/UpdateProjectConfiguratorReferences
Updated remaining Project Configurator references to Project Manager and consolidated JsonUtils API usage.
This commit is contained in:
@@ -19,8 +19,7 @@ namespace AZ
|
||||
{
|
||||
// Scene system components are components that can be used to create system components
|
||||
// in situations where the full initialization and/or construction of regular
|
||||
// system components don't apply such as in the Project Configurator's advanced
|
||||
// settings and the ResourceCompilerScene.
|
||||
// system components don't apply such as in the ResourceCompilerScene.
|
||||
class SCENE_CORE_CLASS SceneSystemComponent
|
||||
: public AZ::Component
|
||||
{
|
||||
|
||||
@@ -21,10 +21,10 @@
|
||||
#include <AzCore/Serialization/Json/RegistrationContext.h>
|
||||
#include <AzCore/Serialization/Json/JsonSerialization.h>
|
||||
#include <AzCore/Serialization/Json/JsonSerializationResult.h>
|
||||
#include <AzCore/Serialization/Json/JsonUtils.h>
|
||||
#include <AzCore/Serialization/Utils.h>
|
||||
#include <AzCore/std/algorithm.h>
|
||||
#include <AzCore/Utils/Utils.h>
|
||||
#include <AzFramework/FileFunc/FileFunc.h>
|
||||
#include <AzFramework/StringFunc/StringFunc.h>
|
||||
#include <AzToolsFramework/Debug/TraceContext.h>
|
||||
#include <SceneAPI/SceneCore/Utilities/Reporting.h>
|
||||
@@ -163,8 +163,7 @@ namespace AZ
|
||||
return false;
|
||||
}
|
||||
|
||||
AZ::IO::Path fileIoPath(absoluteFilePath);
|
||||
auto saveToFileOutcome = AzFramework::FileFunc::WriteJsonFile(saveToJsonOutcome.GetValue(), fileIoPath);
|
||||
auto saveToFileOutcome = AZ::JsonSerializationUtils::WriteJsonFile(saveToJsonOutcome.GetValue(), absoluteFilePath);
|
||||
if (!saveToFileOutcome.IsSuccess())
|
||||
{
|
||||
AZ_Error(ErrorWindowName, false, "%s%s", errorMsg.c_str(), saveToFileOutcome.GetError().c_str());
|
||||
@@ -309,7 +308,7 @@ namespace AZ
|
||||
else
|
||||
{
|
||||
// Attempt to read the stream as JSON
|
||||
auto readJsonOutcome = AzFramework::FileFunc::ReadJsonFromString(fileContents);
|
||||
auto readJsonOutcome = AZ::JsonSerializationUtils::ReadJsonString(fileContents);
|
||||
AZStd::string errorMsg;
|
||||
if (!readJsonOutcome.IsSuccess())
|
||||
{
|
||||
|
||||
@@ -137,7 +137,7 @@ namespace AZ
|
||||
|
||||
// Check if this library hasn't already been reflected. This can happen as the ResourceCompilerScene needs
|
||||
// to explicitly load and reflect the SceneAPI libraries to discover the available extension, while
|
||||
// Gems with system components need to do the same in the Project Configurator.
|
||||
// Gems with system components need to do the same in the Project Manager.
|
||||
if (context && (context->IsRemovingReflection() || !context->FindClassData(AZ::SceneAPI::DataTypes::IGroup::TYPEINFO_Uuid())))
|
||||
{
|
||||
AZ::SceneAPI::DataTypes::IManifestObject::Reflect(context);
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
#include <AzCore/IO/SystemFile.h>
|
||||
#include <AzCore/Serialization/Json/RegistrationContext.h>
|
||||
#include <AzCore/Serialization/Json/JsonSystemComponent.h>
|
||||
#include <AzCore/Serialization/Json/JsonUtils.h>
|
||||
#include <AzCore/Serialization/Utils.h>
|
||||
#include <AzFramework/FileFunc/FileFunc.h>
|
||||
#include <AzToolsFramework/Application/ToolsApplication.h>
|
||||
#include <SceneAPI/SceneCore/Containers/SceneManifest.h>
|
||||
#include <SceneAPI/SceneCore/DataTypes/IManifestObject.h>
|
||||
@@ -325,7 +325,7 @@ namespace AZ
|
||||
ASSERT_TRUE(writeToJsonResult.IsSuccess());
|
||||
|
||||
AZStd::string jsonText;
|
||||
auto writeToStringResult = AzFramework::FileFunc::WriteJsonToString(writeToJsonResult.GetValue(), jsonText);
|
||||
auto writeToStringResult = AZ::JsonSerializationUtils::WriteJsonString(writeToJsonResult.GetValue(), jsonText);
|
||||
ASSERT_TRUE(writeToStringResult.IsSuccess());
|
||||
|
||||
MockSceneManifest loaded;
|
||||
@@ -340,7 +340,7 @@ namespace AZ
|
||||
ASSERT_TRUE(writeToJsonResult.IsSuccess());
|
||||
|
||||
AZStd::string jsonText;
|
||||
auto writeToStringResult = AzFramework::FileFunc::WriteJsonToString(writeToJsonResult.GetValue(), jsonText);
|
||||
auto writeToStringResult = AZ::JsonSerializationUtils::WriteJsonString(writeToJsonResult.GetValue(), jsonText);
|
||||
ASSERT_TRUE(writeToStringResult.IsSuccess());
|
||||
|
||||
MockSceneManifest loaded;
|
||||
@@ -371,7 +371,7 @@ namespace AZ
|
||||
ASSERT_TRUE(writeToJsonResult.IsSuccess());
|
||||
|
||||
AZStd::string jsonText;
|
||||
auto writeToStringResult = AzFramework::FileFunc::WriteJsonToString(writeToJsonResult.GetValue(), jsonText);
|
||||
auto writeToStringResult = AZ::JsonSerializationUtils::WriteJsonString(writeToJsonResult.GetValue(), jsonText);
|
||||
ASSERT_TRUE(writeToStringResult.IsSuccess());
|
||||
|
||||
// Deserialize JSON
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace AZ
|
||||
{
|
||||
// Check if this library hasn't already been reflected. This can happen as the ResourceCompilerScene needs
|
||||
// to explicitly load and reflect the SceneAPI libraries to discover the available extension, while
|
||||
// Gems with system components need to do the same in the Project Configurator.
|
||||
// Gems with system components need to do the same in the Project Manager.
|
||||
if (!context->IsRemovingReflection() && context->FindClassData(SceneData::MeshGroup::TYPEINFO_Uuid()))
|
||||
{
|
||||
return;
|
||||
|
||||
@@ -20,12 +20,12 @@
|
||||
#include <AzCore/RTTI/BehaviorContext.h>
|
||||
#include <AzCore/RTTI/ReflectionManager.h>
|
||||
#include <AzCore/Serialization/Json/JsonSystemComponent.h>
|
||||
#include <AzCore/Serialization/Json/JsonUtils.h>
|
||||
#include <AzCore/Serialization/Json/RegistrationContext.h>
|
||||
#include <AzCore/std/smart_ptr/make_shared.h>
|
||||
#include <AzCore/std/smart_ptr/shared_ptr.h>
|
||||
#include <AzCore/UnitTest/Mocks/MockSettingsRegistry.h>
|
||||
#include <AzCore/UnitTest/TestTypes.h>
|
||||
#include <AzFramework/FileFunc/FileFunc.h>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
@@ -154,7 +154,7 @@ namespace AZ
|
||||
ASSERT_TRUE(writeToJsonResult.IsSuccess());
|
||||
|
||||
AZStd::string jsonText;
|
||||
auto writeToStringResult = AzFramework::FileFunc::WriteJsonToString(writeToJsonResult.GetValue(), jsonText);
|
||||
auto writeToStringResult = AZ::JsonSerializationUtils::WriteJsonString(writeToJsonResult.GetValue(), jsonText);
|
||||
ASSERT_TRUE(writeToStringResult.IsSuccess());
|
||||
EXPECT_THAT(jsonText.c_str(), ::testing::HasSubstr(R"("$type": "MockRotationRule")"));
|
||||
EXPECT_THAT(jsonText.c_str(), ::testing::HasSubstr(R"("rotation": [)"));
|
||||
@@ -191,7 +191,7 @@ namespace AZ
|
||||
ASSERT_TRUE(writeToJsonResult.IsSuccess());
|
||||
|
||||
AZStd::string jsonText;
|
||||
auto writeToStringResult = AzFramework::FileFunc::WriteJsonToString(writeToJsonResult.GetValue(), jsonText);
|
||||
auto writeToStringResult = AZ::JsonSerializationUtils::WriteJsonString(writeToJsonResult.GetValue(), jsonText);
|
||||
ASSERT_TRUE(writeToStringResult.IsSuccess());
|
||||
EXPECT_THAT(jsonText.c_str(), ::testing::HasSubstr(R"("$type": "MockRotationRule")"));
|
||||
EXPECT_THAT(jsonText.c_str(), ::testing::HasSubstr(R"("rotation": [)"));
|
||||
@@ -230,7 +230,7 @@ namespace AZ
|
||||
ASSERT_TRUE(writeToJsonResult.IsSuccess());
|
||||
|
||||
AZStd::string jsonText;
|
||||
auto writeToStringResult = AzFramework::FileFunc::WriteJsonToString(writeToJsonResult.GetValue(), jsonText);
|
||||
auto writeToStringResult = AZ::JsonSerializationUtils::WriteJsonString(writeToJsonResult.GetValue(), jsonText);
|
||||
ASSERT_TRUE(writeToStringResult.IsSuccess());
|
||||
EXPECT_THAT(jsonText.c_str(), ::testing::HasSubstr(R"("$type": "CoordinateSystemRule")"));
|
||||
EXPECT_THAT(jsonText.c_str(), ::testing::HasSubstr(R"("useAdvancedData": true,)"));
|
||||
|
||||
Reference in New Issue
Block a user