Modify the AssetBundler to correctly identify the Gems that are enabled in the current active project (#5072)

* Modify the AssetBundler to correctly identify the Gems that are enabled in the current active project

Signed-off-by: Tommy Walton <waltont@amazon.com>

* Removed unnecessary if() statement and updated the comment.

Signed-off-by: Tommy Walton <waltont@amazon.com>

* Disabling gem loading in the asset bundler tests, just like the asset bundler itself.

Signed-off-by: Tommy Walton <waltont@amazon.com>
monroegm-disable-blank-issue-2
Tommy Walton 4 years ago committed by GitHub
parent 689f5b2a4a
commit f350ba3042
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -47,6 +47,10 @@ ly_add_target(
AZ::AssetBundlerBatch.Static AZ::AssetBundlerBatch.Static
) )
# Adds a specialized .setreg to identify gems enabled in the active project.
# This associates the AssetBundlerBatch target with the .Builders gem variants.
ly_set_gem_variant_to_load(TARGETS AssetBundlerBatch VARIANTS Builders)
# AssetBundler - Qt GUI Application # AssetBundler - Qt GUI Application
ly_add_target( ly_add_target(
NAME AssetBundler ${PAL_TRAIT_BUILD_ASSETBUNDLER_APPLICATION_TYPE} NAME AssetBundler ${PAL_TRAIT_BUILD_ASSETBUNDLER_APPLICATION_TYPE}
@ -73,6 +77,10 @@ ly_add_target(
${additional_dependencies} ${additional_dependencies}
) )
# Adds a specialized .setreg to identify gems enabled in the active project.
# This associates the AssetBundler target with the .Builders gem variants.
ly_set_gem_variant_to_load(TARGETS AssetBundler VARIANTS Builders)
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) if(PAL_TRAIT_BUILD_TESTS_SUPPORTED)
ly_add_target( ly_add_target(

@ -54,7 +54,12 @@ namespace AssetBundler
bool ApplicationManager::Init() bool ApplicationManager::Init()
{ {
AZ::Debug::TraceMessageBus::Handler::BusConnect(); AZ::Debug::TraceMessageBus::Handler::BusConnect();
Start(AzFramework::Application::Descriptor());
ComponentApplication::StartupParameters startupParameters;
// The AssetBundler does not need to load gems
startupParameters.m_loadDynamicModules = false;
Start(AzFramework::Application::Descriptor(), startupParameters);
AZ::SerializeContext* context; AZ::SerializeContext* context;
EBUS_EVENT_RESULT(context, AZ::ComponentApplicationBus, GetSerializeContext); EBUS_EVENT_RESULT(context, AZ::ComponentApplicationBus, GetSerializeContext);
AZ_Assert(context, "No serialize context"); AZ_Assert(context, "No serialize context");

@ -71,7 +71,11 @@ namespace AssetBundler
m_data->m_applicationManager.reset(aznew MockApplicationManagerTest(0, 0)); m_data->m_applicationManager.reset(aznew MockApplicationManagerTest(0, 0));
m_data->m_applicationManager->Start(AzFramework::Application::Descriptor());
AZ::ComponentApplication::StartupParameters startupParameters;
// The AssetBundler does not need to load gems
startupParameters.m_loadDynamicModules = false;
m_data->m_applicationManager->Start(AzFramework::Application::Descriptor(), startupParameters);
// Without this, the user settings component would attempt to save on finalize/shutdown. Since the file is // Without this, the user settings component would attempt to save on finalize/shutdown. Since the file is
// shared across the whole engine, if multiple tests are run in parallel, the saving could cause a crash // shared across the whole engine, if multiple tests are run in parallel, the saving could cause a crash

Loading…
Cancel
Save