From a2c3ecf83f9135a75d562f10a642bfcbe023db2c Mon Sep 17 00:00:00 2001 From: methylDragon Date: Thu, 26 May 2022 16:08:16 -0700 Subject: [PATCH] Fix `IGN_LAUNCH_PLUGIN_PATH` logic Signed-off-by: methylDragon --- src/Manager.cc | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/Manager.cc b/src/Manager.cc index b77c485c..9aa45a52 100644 --- a/src/Manager.cc +++ b/src/Manager.cc @@ -1096,12 +1096,12 @@ void ManagerPrivate::LoadPlugin(const tinyxml2::XMLElement *_elem) std::string homePath; gz::common::env(IGN_HOMEDIR, homePath); - // TODO(CH3): Deprecated. Remove on ticktock. systemPaths.AddPluginPaths( - gz::common::joinPaths(homePath, ".ignition", "gazebo", "plugins")); + gz::common::joinPaths(homePath, ".gz", "sim", "plugins")); + // TODO(CH3): Deprecated. Remove on ticktock. systemPaths.AddPluginPaths( - gz::common::joinPaths(homePath, ".gz", "sim", "plugins")); + gz::common::joinPaths(homePath, ".ignition", "gazebo", "plugins")); std::string pathToLib; if (common::exists(file)) @@ -1116,6 +1116,13 @@ void ManagerPrivate::LoadPlugin(const tinyxml2::XMLElement *_elem) // GZ_LAUNCH_PLUGIN_PATH systemPaths.SetPluginPathEnv("IGN_LAUNCH_PLUGIN_PATH"); pathToLib = systemPaths.FindSharedLibrary(file); + + if (!pathToLib.empty()) + { + gzwarn << "Found plugin [" << pathToLib + << "] using deprecated environment variable [IGN_LAUNCH_PLUGIN_PATH]." + " Please use [GZ_LAUNCH_PLUGIN_PATH] instead." << std::endl; + } } if (pathToLib.empty()) @@ -1125,12 +1132,6 @@ void ManagerPrivate::LoadPlugin(const tinyxml2::XMLElement *_elem) << "variable.\n"; return; } - else - { - gzwarn << "Found plugin [" << pathToLib - << "] using deprecated environment variable [IGN_LAUNCH_PLUGIN_PATH]." - " Please use [GZ_LAUNCH_PLUGIN_PATH] instead." << std::endl; - } plugin::Loader loader; std::unordered_set localPlugins = loader.LoadLib(pathToLib);