From eb3374a3902c4a9a3539b16161c39e877a896c5d Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EC=B5=9C=EC=A2=85=ED=97=8C/Common=20Platform=20Lab=28SR=29?= =?utf8?q?/Engineer/=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Tue, 30 Jun 2020 06:52:29 +0900 Subject: [PATCH] Seperate the pluginDir and extraDir from the path manager (#252) Change-Id: If710a702feaaa4e1e9047c346c9a656920dcb921 --- NativeLauncher/util/path_manager.cc | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/NativeLauncher/util/path_manager.cc b/NativeLauncher/util/path_manager.cc index 3d73528..d89b84e 100644 --- a/NativeLauncher/util/path_manager.cc +++ b/NativeLauncher/util/path_manager.cc @@ -37,7 +37,8 @@ typedef struct DllPath { std::string runtime_dir; std::string tizenfx_dir; std::string tizenfx_ref_dir; - std::vector extra_dirs; + std::vector extra_dirs; + std::vector plugin_dirs; } DllPath; static DllPath* __dllPath = nullptr; @@ -82,11 +83,11 @@ int initializePathManager(const std::string& runtimeDir, const std::string& tize // ":" seperated extra directories if (!extraDir.empty()) { splitPath(extraDir, __dllPath->extra_dirs); - } else { - char* extraPath = pluginGetDllPath(); - if (extraPath) { - splitPath(extraPath, __dllPath->extra_dirs); - } + } + + char* pluginPath = pluginGetDllPath(); + if (pluginPath) { + splitPath(pluginPath, __dllPath->plugin_dirs); } _INFO("Path manager initialize success"); @@ -97,6 +98,7 @@ int initializePathManager(const std::string& runtimeDir, const std::string& tize void finalizePathManager() { + _INFO("Path manager finalize called"); if (__dllPath) { delete __dllPath; __dllPath = NULL; @@ -120,11 +122,16 @@ std::string getTizenFXRefDir() return __dllPath->tizenfx_ref_dir; } -std::vector getExtraDirs() +std::vector getExtraDirs() { return __dllPath->extra_dirs; } +std::vector getPluginDirs() +{ + return __dllPath->plugin_dirs; +} + static std::string getPlatformTPA() { std::string platform_tpa; @@ -137,6 +144,7 @@ static std::string getPlatformTPA() cacheFile.close(); } else { std::vector tpaDirs = { getRuntimeDir(), getTizenFXDir(), getTizenFXRefDir() }; + tpaDirs.insert(tpaDirs.end(), getExtraDirs().begin(), getExtraDirs().end()); addAssembliesFromDirectories(tpaDirs, platform_tpa); } @@ -146,14 +154,13 @@ static std::string getPlatformTPA() static std::string getPluginTPA() { std::string plugin_tpa; - char* plugin_tpa_list = pluginGetTPA(); if (plugin_tpa_list) { _INFO("plugin TPA list found. use TPA list for plugin"); plugin_tpa = plugin_tpa_list; - } else if (!__dllPath->extra_dirs.empty()) { - _INFO("plugin extra directory found. use plugin extra directroy for TPA"); - addAssembliesFromDirectories(__dllPath->extra_dirs, plugin_tpa); + } else if (!getPluginDirs().empty()) { + _INFO("Plugin directory found. use plugin directroy for TPA"); + addAssembliesFromDirectories(getPluginDirs(), plugin_tpa); } return plugin_tpa; -- 2.7.4